+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / News Page

News Page

14 posts, 0 answered
  1. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    05 Nov 2010
    Link to this post
    Hi,

    How would I go about creating a news page with the news summaries in a left column and the detail on the right, So that if you click on the heading/more on the summary it would display the full story in a box to the right on the same page.

    Is this possible?

    Thank you

    Ben.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Nov 2010
    Link to this post
    Hello Ivor,

    Drop two NewsView controls on the same page. For the first control that you want to show only list, go to its Advanced tab and set BehaviorMode to Master. For the second control that you want to show details set BehaviorMode to Detail  - this will render the control in details mode only when you click the title of an item from the first control.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    05 Nov 2010
    Link to this post
    Ah cool thanks Ivan,

    I thought that might be the case only it doesn't seem to work. The detail control has an error saying [ NewsView "NewsView2" ]

    Any ideas?

    Many thanks

    Ben
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Nov 2010
    Link to this post
    Hello Ivor,

    This is the message only in details mode which is the control instance id. The scenario does work. I am sending you a short video from our demo website.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    05 Nov 2010
    Link to this post
    Oh yes, sorry my mistake, it does work.

    Thank you very much for your help.

    Ben.
  6. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    08 Nov 2010
    Link to this post
    Hi, me again,

    Do you know if it's possible to add images in a poll? E.g. Vote for this picture.

    Many thanks

    Ivor.
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Nov 2010
    Link to this post
    Hello Ivor,

    It is possible. You have to replace the TextBox with RadEditor control

    1. You have map PollItemEdit.ascx and PollItemNew.ascx external template ( How to map a template)

    2. Then remove the ASP.NET TextBox control with ID="questionText" with RadEditor control which should have the same ID

    Here is the PollItemNew.ascx

    <%@ Control  Language="C#" %>
    <%@ Register Assembly="Telerik.Polls" Namespace="Telerik.Polls.WebControls" TagPrefix="sfPls" %>
    <div class="ToolsAll">
        <div class="backWrapp">
            <asp:HyperLink runat="server" ID="backBtn" CssClass="actions back"><asp:Literal runat="server" Text="<%$Resources:CancelAndGoBack %>"></asp:Literal></asp:HyperLink>
        </div>
    </div>
    <div class="workArea insert">
        <telerik:MessageControl runat="server" ID="msgCtrl">
            <ItemTemplate>
                <asp:Literal runat="server" ID="messageText"></asp:Literal>
            </ItemTemplate>
        </telerik:MessageControl>
     
    <div class="mainForm polls">
            <p class="mand">* <asp:Literal runat="server" Text="<%$Resources:MandatoryFields %>"></asp:Literal></p>
            <h3><telerik:FieldLabel runat="server" ID="titleLabel" Text="<%$Resources:PollTitle %>" TargetID="pollTitle"></telerik:FieldLabel></h3>       
            <fieldset class="set">
                <div class="setIn clearfix title">               
                         <asp:TextBox runat="server" ID="pollTitle" MaxLength="200"></asp:TextBox>
                         <asp:RequiredFieldValidator runat="server" ID="titleVal"
                         ControlToValidate="pollTitle"
                         ErrorMessage="<%$Resources:TitleEmpty %>"
                         Display="dynamic"
                         CssClass="validMessage"
                         ValidationGroup="pollContent" SetFocusOnError="true">
                            <strong><asp:Literal runat="server" Text="<%$Resources:TitleEmpty %>"></asp:Literal></strong>
                         </asp:RequiredFieldValidator>
                         <p class="example"><asp:Literal runat="server" Text="<%$Resources:TitleNote %>"></asp:Literal></p>              
                </div>
            </fieldset>
            <div class="bottom"><div><!-- --></div></div>
            <h3><asp:Literal ID="Literal1" runat="server" Text="<%$Resources:QuestionsAndAnswers %>"></asp:Literal></h3>
            <asp:Repeater runat="server" ID="questionFields">
                <ItemTemplate>
                    <fieldset class="set question">
                        <ol class="setIn">
                            <li class="title">
                               <%-- <asp:Label ID="Label1" AssociatedControlID="questionText" Text="<%$Resources:Question %>" runat="server"></asp:Label>--%>
                          <%--      <asp:TextBox runat="server" id="questionText" EnableViewState="true"
                                TextMode="MultiLine" Text='<%# Eval("Text") %>'></asp:TextBox>   --%>   
                          <telerik:RadEditor
                        runat="server"
                       ID="questionText"
                        ContentAreaCssFile="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorContentArea.css"
                        ToolsFile="~/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml"                  
                        Skin="WebBlue"                    
                        NewLineBr="False"
                        Width="95%"
                        ContentFilters="EncodeScripts,FixUlBoldItalic,FixEnclosingP,IECleanAnchors,MozEmStrong,ConvertFontToSpan,ConvertToXhtml,IndentHTMLContent">
                        <ImageManager ViewPaths="~/Images" UploadPaths="~/Images" DeletePaths="~/Images" />
                        <MediaManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
                        <FlashManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
                        <DocumentManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
                        <CssFiles>
                            <telerik:EditorCssFile Value="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorCssFile.css" />
                        </CssFiles>
                        <Tools>
                        <telerik:EditorToolGroup>
                                <telerik:EditorTool Text="My Separator" Name="MySeparator" />
                        </telerik:EditorToolGroup>
                            
                        </Tools>
                    </telerik:RadEditor>
                    <telerik:RadScriptBlock runat="server" ID="block1">
                    <script type="text/javascript">
     
                        Telerik.Web.UI.Editor.CommandList["MySeparator"] = function(commandName, editor, args) {
        editor.pasteHtml('<span style="width:200px;border: 1px dashed #bb0000;background-color: #fafafa;color: blue;"> ' + new Date() + ' </span>');
    };
                    Telerik.Web.UI.Editor.CommandList["LibraryImageManager"] = function(commandName, editor, args)
                    {
                       var editorArgs = editor.getSelectedElement();
                       if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                            editorArgs = editor.getSelection();
                        
                       var myCallbackFunction = function(sender, args)
                       {
                            if (typeof(editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "IMG")
                                args.parentNode.replaceChild(editorArgs, args);
                            else
                            {
                                var cloned = args.cloneNode(true);
                                var div = args.ownerDocument.createElement("DIV");
                                div.appendChild(cloned);
                                editorArgs.pasteHtml(div.innerHTML);
                            }
                       }
                       editor.showExternalDialog(
                       '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx") %>',
                       editorArgs,
                       750,
                       600,
                       myCallbackFunction,
                       null,
                       'ImageLibraryDialog',
                       true,
                       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                       false,
                       true)
                    };
     
                    Telerik.Web.UI.Editor.CommandList["LibraryDocumentManager"] = function(commandName, editor, args)
                    {
                       var editorArgs = editor.getSelectedElement();
                       if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                            editorArgs = editor.getSelection();
                        
                       var myCallbackFunction = function(sender, args)
                       {
                            if (typeof(editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                                args.parentNode.replaceChild(editorArgs, args);
                            else
                            {
                                var cloned = args.cloneNode(true);
                                var div = args.ownerDocument.createElement("DIV");
                                div.appendChild(cloned);
                                editorArgs.pasteHtml(div.innerHTML);
                            }
                       }
                       editor.showExternalDialog(
                       '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx") %>',
                       editorArgs,
                       750,
                       600,
                       myCallbackFunction,
                       null,
                       'ImageLibraryDialog',
                       false,
                       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                       false,
                       true)
                    };
     
                    Telerik.Web.UI.Editor.CommandList["LinkManager"] = function(commandName, editor, args)
                    {
                       var editorArgs = editor.getSelectedElement();
                       if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                       {                                                                  
                            var sel = editor.getSelection(); 
                            editorArgs = sel;
                            editorArgs.Html = sel.getHtml();
                            editorArgs.Text = sel.getText();                                   
                       }
                        
                       var myCallbackFunction = function(sender, args)
                       {
                            if (typeof(editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                                args.parentNode.replaceChild(editorArgs, args);
                            else
                            {
                                var cloned = args.cloneNode(true);
                                var div = args.ownerDocument.createElement("DIV");
                                div.appendChild(cloned);
                                editorArgs.pasteHtml(div.innerHTML);
                            }
                       }
                       editor.showExternalDialog(
                       '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>',
                       editorArgs,
                       750,
                       600,
                       myCallbackFunction,
                       null,
                       'ImageLibraryDialog',
                       false,
                       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                       false,
                       true)
                    };
     
                    Telerik.Web.UI.Editor.CommandList["SetLinkProperties"] = function(commandName, editor, args)
                    {
                       var editorArgs = editor.getSelectedElement();
                       if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                            editorArgs = editor.getSelection();
                        
                       var myCallbackFunction = function(sender, args)
                       {
                            if (typeof(editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                                args.parentNode.replaceChild(editorArgs, args);
                            else
                            {
                                var cloned = args.cloneNode(true);
                                var div = args.ownerDocument.createElement("DIV");
                                div.appendChild(cloned);
                                editorArgs.pasteHtml(div.innerHTML);
                            }
                       }
                       editor.showExternalDialog(
                       '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>',
                       editorArgs,
                       750,
                       600,
                       myCallbackFunction,
                       null,
                       'ImageLibraryDialog',
                       false,
                       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                       false,
                       true)
                    };
                    var oldFunction = Telerik.Web.UI.Editor.CommandList["ToggleScreenMode"]; //save the original Paste function
     
                    Telerik.Web.UI.Editor.CommandList["ToggleScreenMode"] = function(commandName, editor, args)
                    {
                        oldFunction(commandName, editor, args);
                        var bd = document.getElementsByTagName("body")[0];
                         
                        if(/fullScreenMode/.test(bd.className)) {
                            var rep = bd.className.match(' '+'fullScreenMode')?' '+'fullScreenMode':'fullScreenMode';
                            bd.className=bd.className.replace(rep,'');
     
                        } else {
                            bd.className += bd.className?' '+'fullScreenMode':'fullScreenMode';
                        }
                    };
                     
                     
                    </script
                    </telerik:RadScriptBlock>             
                                <span runat="Server" id="questionVal"></span>
                                <p class="example"><asp:Literal runat="server" Text="<%$Resources:QuestionNote %>"></asp:Literal></p>
                            </li>
                             
                            <li class="answers">                       
                                <h4><asp:Literal runat="server" Text="<%$Resources:Answers %>"></asp:Literal></h4>
                                     
     
                                    <ol>                       
                                    <asp:Repeater runat="server" ID="answerFields">
                                        <ItemTemplate>
                                            <li class="clearfix">
                                                <dl>
                                                    <dt class="pollAns">
                                                        <asp:Label ID="index" AssociatedControlID="answerTxtBox" runat="server"></asp:Label>
                                                        <asp:TextBox runat="server"
                                                        ID="answerTxtBox"
                                                        Text='<%#Eval("Text")%>'
                                                        MaxLength="200"
                                                        ></asp:TextBox>                                                
                                                    </dt>                                       
                                                    <dd class="pollAns">
                                                        <span class="colLab"><asp:Literal runat="server" Text="<%$Resources:PollChartColor %>"></asp:Literal>:</span>
                                                        <telerik:RadColorPicker runat="server" ID="colorPicker" ShowIcon="true" />
                                                    </dd>
                                                    <dd class="pollAns">
                                                        <asp:LinkButton runat="server" ID="deleteAnswer" Text="Delete" CssClass="deletePollAnswer"></asp:LinkButton>
                                                    </dd>
                                                </dl>
                                            </li>                                   
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ol>                       
                            <span class="actions answer"> + <asp:LinkButton runat="server" ID="addAnswer"><asp:Literal runat="server" Text="<%$Resources:AddAnAnswer %>"></asp:Literal></asp:LinkButton></span>
                            </li>
                            <li class="select">
                                <telerik:LabelToolTip
                                    ID="typeAnswersToolTip"
                                    runat="server"
                                    LabelMode="true"
                                    HelpBoxCssClass="HelpBox"
                                    LabelText="<%$Resources:TypeOfAnswers %>"
                                    ToolTipText="<%$Resources:TypeOfAnswers %>" />
                                   <asp:DropDownList ID="qtypes" runat="server">
                                        <asp:ListItem Text="<%$Resources:RadioButtons %>" Value="RadioButton" />
                                        <asp:ListItem Text="<%$Resources:Checkbox %>" Value="Checkbox" />
                                        <asp:ListItem Text="<%$Resources:DropDownList %>" Value="DropDownList" />
                                   </asp:DropDownList>
                            </li>
                            <li>
                                <asp:LinkButton runat="server" ID="deleteQuestion" Text="<%$Resources:DeleteQuestion %>" CssClass="deletePollQuestion"></asp:LinkButton>
                            </li>
                        </ol>   
                    </fieldset>
                    <div class="bottom"><div><!-- --></div></div>               
                </ItemTemplate>           
            </asp:Repeater>
            <asp:LinkButton runat="server" ID="addQuestion" CssClass="CmsButLeft new"><strong class="CmsButRight light"><asp:Literal runat="server" Text="<%$Resources:AddAQuestion %>"></asp:Literal></strong></asp:LinkButton>
        <p class="button_area bot">
            <asp:LinkButton runat="server" ID="okBtn" CssClass="CmsButLeft okdark" ValidationGroup="pollContent"><strong class="CmsButRight dark"><asp:Literal runat="server" Text="<%$Resources:CreateThisPoll %>"></asp:Literal></strong></asp:LinkButton>
            <span><asp:Literal runat="server" Text="<%$Resources:Or %>"></asp:Literal></span>
            <asp:HyperLink runat="server" ID="cancelBtn" CssClass="cmscclcmd"><asp:Literal runat="server" Text="<%$Resources:Cancel %>"></asp:Literal></asp:HyperLink>
        </p>       
    </div>
    <div class="info" id="divFaq" runat="server">
    <div class="infoBottom">
        <h3><asp:Literal runat="server" Text="<%$Resources:PollsFAQ %>"></asp:Literal></h3>
        <asp:Literal runat="server" Text="<%$Resources:PollsFAQText %>"></asp:Literal>
        <p class="hideAllFAQs">
            <a href="javascript:void(0)" onclick="javascript:Personalization.hideFaqSection('<%= divFaq.ClientID %>')">Hide FAQs everywhere</a>
        </p>
        </div>
    </div>
    <div class="clear"><!-- --></div>
    </div>


    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    08 Nov 2010
    Link to this post
    Perfect! Thank you Ivan.

    Sorry last question...

    Going back to the news page... Is it possible to display the most recent news in the detail column when the page opens?

    Regards

    Ivor



  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Nov 2010
    Link to this post
    Hello Ivor,

    When you click "GoBack" you can append a QueryString to the url and sort the control data in DESC order. In this case you have to create a custom control that inherits from NewsView and override its SortExpression property. Inside the get accessort you can read the QueryString and if it is not null you can return "Publication_Date DESC". If you want to get certain number of items you can override CreateDataSource of the control and return the list you want  by using GetContent method of ContentManager class and its overloads.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    10 Nov 2010
    Link to this post
    Hi,

    Thanks but I don't think that's quite what I need.

    I need to simply show the most recent news detail when the page loads. So the page is not blank.


    I think I could probably do this by having a separate template and break the query between the two columns so it just shows the most recent detail but I'm not sure how to?

    Any ideas?

    I'm pretty new to Sitefinity and a designer rather than a developer so what ever the simplest would be best.

    Many thanks

    Ben.

  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Nov 2010
    Link to this post
    Hi Ivor,

    What do you mean by "recent news detail". What "detail" you need to show? If you have one NewsView control on the page, you cannot get a list of most recent items with the out of the box implementation.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  12. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    10 Nov 2010
    Link to this post
    The most recent news item by date.

    If it's not possible to display that in the detail column would it be possible to add the news detail into the master feed instead of the summary?

    Many thanks

    Ben
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Nov 2010
    Link to this post
    Hello Ivor,

    You can use SortExpression property of the control with parameter Publication_Date DESC. This will sort the list of items in descending order.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  14. Ivor
    Ivor avatar
    20 posts
    Registered:
    28 Sep 2010
    10 Nov 2010
    Link to this post
    Yes but that will not work for a news detail content place holder.

    Anyway no problem, I'll get a developer to look at it, it's a bit to complicated for me, thank you for your help.
Register for webinar
14 posts, 0 answered