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

Forums / General Discussions / Seeing solutions for two problems

Seeing solutions for two problems

6 posts, 0 answered
  1. Robert
    Robert avatar
    10 posts
    Registered:
    29 Oct 2010
    12 Nov 2010
    Link to this post
    Hello all .   I  got two problems in my website.The first one:  Is  there  a mechanism to show the  hits of the articles in both news  list and  news content area?
    The second one: How can i  make  the browser to open a new window to show the content of news  when the news title(the "Full story" as well) is clicked, similar to the property" target="_blank" "?

    Thanks
    Robert
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    12 Nov 2010
    Link to this post
    Hello Robert,

    Thank you for using our services.

    You can achieve the first requirement can be solved by adding a View_Count metafield for your news module. You should edit your website's web.config file:
    <metaFields>
        ...
            <add key="News.View_Count" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="0" />

    Then you should edit the control templates for the News module to display it. In the public part of your website you should edit ~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx and ListPageDetails.ascx files to show the new count just add another liter that has the same ID as the meta field:
    <asp:Literal ID="View_Count" runat="server" Text=""></asp:Literal>

    In the content area you should edit the ~/Sitefinity/Admin/ControlTemplates/News/NewsItemsList.ascx file. You can check out the attached file for reference.

    In order to open news items in new tab you should edit the list template to set the hyperlinks to open in new window:

    <h2 class="sf_newsTitle">
        <asp:HyperLink ID="fullContent1" Target="_blank" runat="server">
            <asp:Literal ID="Title" runat="server"></asp:Literal>
        </asp:HyperLink>
    </h2>
    <p class="sf_newsDate">
        <asp:Literal ID="Publication_Date" runat="server" Text="{0}" />
    </p>
    <p>
        <asp:Literal ID="Summary" runat="server" Text=""></asp:Literal>
    </p>
    <p class="sf_readMore">
        <asp:HyperLink ID="fullContent2" Target="_blank" runat="server">
            <asp:Literal ID="LiteralFS" runat="server" Text="<%$Resources:FullStory %>"></asp:Literal>
        </asp:HyperLink>
    </p>

    All of the above involves working with control templates for the news controls. If you are unfamiliar with this procedure, please check out this KB article.

    Best wishes,
    Radoslav Georgiev
    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. Robert
    Robert avatar
    10 posts
    Registered:
    29 Oct 2010
    12 Nov 2010
    Link to this post
    Hello Radoslav, thanks a lot for your reply.

           The first problem: It's a pity that my folder "~/Sitefinity/ControlTemplates/News" does not contain these three files "ListPageMaster.ascx " ," ListPageDetails.ascx" and " NewsItemsList.ascx" ,only containing  socialbookmark folder and "socialbookmarkTemplate.xml" file. What should I do? 

           The second one: I couldn't find the list template as well and it's likely that my website doesn't have the file at ll.
    My version of Sitefinity is 3.7.2096.3. Can you send me a package containing these files? I will appreciate that.

    Best regards,
    Robert



  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    12 Nov 2010
    Link to this post
    Hi Robert,

    These templates are embedded. Please take a look at How to map a template

    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. Robert
    Robert avatar
    10 posts
    Registered:
    29 Oct 2010
    13 Nov 2010
    Link to this post
    Hello Ivan, thanks for your reply.
    Radosla said in last reply,
     ".... you should edit~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx and ListPageDetails.ascx files to show the new count just add another liter that has the same ID as the meta field..." and "in order to open news items in new tab you should edit the list template...:".Now that these templates are embedded, how can i edit these files?

    I have read the article you recommended "How to map a view to an external template in Sitefinity",
    but i got several questions: I mainly want to let the visitors  see the hits of articles rather than in the  CMS ,then how should i set the property "hostType" in "Telerik.Sitefinity.Configuration.ControlsConfig.xml". 
    And I am not familiar with the template, then how can i create a complete and valid external template so that Sitefinity can recognise it. Are there any masterplates or standards for writing the external templates?

    Best regards
    Robert
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    13 Nov 2010
    Link to this post
    Hi Robert,

    Rado has explained how you can do this in his reply to you .

    Greetings,
    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
Register for webinar
6 posts, 0 answered