More in this section

Forums / Developing with Sitefinity / Read more link showing blank page

Read more link showing blank page

17 posts, 1 answered
  1. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013
    Link to this post
    Hi,
    Ive been working with the built in news widget and I've editted the template to have a 'read more' link using the 'ItemDefaultUrl' but when I click on the link it just brings up a blank page. No errors just an empty page.

    How do I make the link open the relevant news article from the news module?

    O.
  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Apr 2013
    Link to this post
    Hi Owain,

    If you want a 'Read More' link inside your NewsList template, you can use the following markup to point directly to the news details.

    <sf:DetailsViewHyperLink ID="FullStory" Text="<%$ Resources:NewsResources, FullStory %>" runat="server" CssClass="sfnewsFullStory" />

    Just past it somewhere inside your template. As you can see it uses the Resources to set the Text property. You can either change this in the backend (Interface labels & Messages) or hard-code it yourself.

    Kind regards,
    Daniel

    Answered
  3. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013 in reply to Daniel Plomp
    Link to this post
    Thanks for the quick reply - I tried your solution but it's returning a page not found when I click on the link.
    Exception Details: System.Web.HttpException: Page not found

    I wasn't sure where in the backend I could change the Text Property so just hardcoded the 'Read more' text.

  4. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Apr 2013 in reply to Owain
    Link to this post
    Hi Owain,

    So how did you configured the News Widget? Is it all default?
    Do you point to a separate page that holds a News View, or are you automatically render the News details on the same page?

    Kind regards,
    Daniel
  5. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013 in reply to Daniel Plomp
    Link to this post
    Hi,
    Yes, all set up as default and the news is rendered automatically.

  6. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Apr 2013 in reply to Owain
    Link to this post
    Hi Owain,

    Could you maybe share the code of your template?

    Kind regards,
    Daniel
  7. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013 in reply to Daniel Plomp
    Link to this post
    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit"
        Assembly="Telerik.Sitefinity" %>
    <telerik:RadListView ID="DetailsView" ItemPlaceholderID="ItemContainer" AllowPaging="False"
        runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <layouttemplate>
            <div class="sfnewsDetails">
                <%-- <div class="sfnewsLinksWrp">
                    <sf:MasterViewHyperLink class="sfnewsBack" Text="<%$ Resources:NewsResources, AllNews %>" runat="server" />
                </div> --%>
                <asp:PlaceHolder ID="ItemContainer" runat="server" />
            </div>
        </layouttemplate>
        <itemtemplate>
     
            <h1 class="sfnewsTitle">
                <asp:Literal Text='<%# Eval("Title") %>' runat="server" />
            </h1>
            <div class="sfSCSnewsAuthorAndDate">
     <sf:FieldListView ID="PublicationDate" runat="server"
                    Format="{PublicationDate.ToLocal():MMM dd, yyyy}" />
          </div><br/>
            <sf:ContentBrowseAndEditToolbar ID="BrowseAndEditToolbar" runat="server" Mode="Edit,Delete,Unpublish"></sf:ContentBrowseAndEditToolbar>
             
           
          <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Summary")%>' />
           
          <%--  <div class="sfnewsContent">
                <asp:Literal ID="Literal1" Text='<%# Eval("Content") %>' runat="server" />
            </div> --%>
           
          <sf:DetailsViewHyperLink ID="FullStory" Text="Read more" runat="server" CssClass="sfnewsFullStory" />
           
          <%-- <a href='<%# Eval("ItemDefaultUrl")%>'>Read more</a> --%>
     
        <asp:PlaceHolder ID="socialOptionsContainer" runat="server">
       
        </asp:PlaceHolder>
     
        </itemtemplate>
    </telerik:RadListView>
    Yip, no problem at all:
  8. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Apr 2013 in reply to Owain
    Link to this post
    Hi Owain,

    Well, that is strange.
    What I see is that you add the Read More link to the DetailView, which makes no sense to me, as this template is already used for displaying the News details.

    I'm not sure what goes wrong. Can you debug it with Firebug / Fiddler to see if any request goes wrong?

    I tested the same situation. Adding the Read More link to a DetailView is not causing troubles, since it just redirects to the same page.

    What is the URL that the Read More link is navigating to?

    Kind regards,
    Daniel
  9. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013 in reply to Daniel Plomp
    Link to this post
    Hi Daniel,
    Still learning my way around Sitefinity, sorry if I've done this the wrong way.
    The link points to :
    http://mydomain/home/2013/03/21/recruitment-of-members

    But I would prefer it not to have the date format in front of it and I wonder if this is what is causing the issue as the news module has a URL as 'recruitment-of-members' - it used to have allow multiple URLs for this item enabled and it did have 2013/03/21/recruitment-of-members within the box and if I expand the More options panel in the news module I can see that under 'All additional URLs redirect to the default one:'
    The default seems to be '/2013/03/21/recruitment-of-members'

  10. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Apr 2013 in reply to Owain
    Link to this post
    Hi Owain,

    You could try to test it by removing the additional url's and uncheck that checkbox.
    See what happens.

    It is a bit difficult for me to debug this issue.

    Kind regards,
    Daniel
  11. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013 in reply to Daniel Plomp
    Link to this post
    Thanks for your help with this, I should have been more clear. I have unchecked these options - tested and also clicked the boxes and tested again. Still doesnt work. Also just created a new news article and then tried that but it still brings up a page not found error.

    What I may do is see about publishing it to another page and see if that helps. I was more just wanting to see if I had done the read more link correctly which you kindly pointed me in the right direction, I will now try and get the rest to work.

  12. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013 in reply to Owain
    Link to this post
    Update: I pointed the link to a new page instead of the homepage and it all works now! Very odd. Thanks again for your help!

    O.
  13. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Apr 2013 in reply to Owain
    Link to this post
    Hi Owain,

    Glad it worked out for you.
    Still a strange thing, you might want to contact support about it?

    Kind regards,
    Daniel
  14. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    05 Apr 2013 in reply to Daniel Plomp
    Link to this post
    Thanks.
    Sometimes I do think we have a slightly flawed installation of Sitefinity - I have a number of tickets open with them for little issues which shouldnt be present but that is another project in it owns!

  15. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    09 Apr 2013
    Link to this post
    Hello Owain,

    I have tested this on my end by dropping a news widget and pasting your template and the link seems to work properly.

    Would it be possible for you to share a screenshot of the whole error you are presented with (or a video on how this is setup and reproducing the problem)? Also can you elaborate a bit on your scenario? We might be able to provide another solution for this.

    Regards,
    Pavel Benov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  16. Owain
    Owain avatar
    110 posts
    Registered:
    17 Jan 2012
    10 Apr 2013 in reply to Pavel Benov
    Link to this post
    Hi Pavel,
    Not a problem to give you a screen shot - I have a number of 'issues' I am working through with our site with different members of support so I may be delayed but as soon as I get a chance I will post here.

    O.
  17. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    10 Apr 2013
    Link to this post
    Hi Owain,

    Thanks for taking the time for this. Looking forward to your reply. 

    All the best,
    Pavel Benov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
17 posts, 1 answered