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

Forums / Developing with Sitefinity / Two click process to download PDF from press releases.

Two click process to download PDF from press releases.

20 posts, 0 answered
  1. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    Hi Guys,

    Currently on our client's site, it takes two clicks for them to download a pdf document from the press releases section of the their site which, in normal usability terms does not make sense.

    How can I change this so that the user only needs to click once to retrieve their pdf document please?

    Here's an example:

    bit.ly/eGxhny 
    (the site might time out which is an issue we are trying to sort out with the client, but it will fire up if you refresh a couple of time)

    If you click on Full Story, you will be taken to another page where you can then click to download the PDF.

    Thanks for the help in advance!


  2. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    Sorry to push guys, but this is one that I need resolved quickly today, so if you can help I'd appreciate it.

    Thanks!
  3. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    We have done this in another project but it was some time back already and I don't recall how this was done. Also, I am not an ASP.net so I am trying to figure out how this all plugs in together.

    You can view how this "should" work by going to bit.ly/fxGA5v

    Thanks again
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Nov 2010
    Link to this post
    Hello James,

    As you may already know the forums do not have a dedicated support response time. If you need urgent issues to be escalated and resolved in a timely manner you should consider opening a support ticket. Also please make sure that you provide as much relevant information about the issue as possible. From the provided information it is not very clear what control are you using (custom or built in).

    From looking at the page I can make two assumptions - either you have registered a new metafield for the news module and you wish to display it in the list mode of the News View control or this is not coming from a custom metafield but is the content of the News item. In any case what you should do is to make the control template for the display the information.

    If you are using the content of the news item you should just open the control for edit on the page and go to the Settings tab. Then from the options for the list mode you should choose to display content.

    If this is coming from a custom meta field you should edit the control template ~/Sitefinity/ControlTemplates/News/ListPageMaaster.ascx and add a control which will hold the value of your custom metafield just the same way as you have added it in the single mode template, you just need to add the control insde of the ItemTemplate of the repeater control.

    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
  5. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    Hi Radoslav,

    Apologies, I've completely forgotten about the ticket option.

    Ok, the problem I am seeing is that when the list of news items display on a page, they could either be a link to the complete article, in which case, the link will have to go to the details page of that article...

    or

    the news item list could be a link to a pdf.

    What I need is that if the news item is a pdf, it should open the pdf in a new window and if the news item is an article it would go through to the details page.

    I have tried making the changes in the newsview settings but there are no options to display content in the news list like this:

    For every item in the news list, display:

    •  set label and format )
    •  set label )

    Only in the news page, do I see an option for content.

    In the news page, display:


    Could I be misunderstanding you?

    Thanks
  6. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    Hi Radoslav,

    Would you like me to open another ticket for this, or should we keep chatting here about this problem?

    Thanks,
  7. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    On this page for example: bit.ly/fxGA5v

    It is a very good indication of what I need to do. Only, if the link in this list is an actual article, it needs to go through to to the detail page of that article.

    Thanks again.
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Nov 2010
    Link to this post
    Hi James,

    Thank you for getting back to me.

    It is still a little bit unclear to me how you add the link to the pdf document? If you add it in the content of the News article (sorry for misleading you on this one) you have to open he external template file ~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx and add the bellow markup in the ItemTemplate of the repeater:
    <asp:Repeater ID="repeater" runat="server">
        <HeaderTemplate>
            <ul class="sf_newsList">
        </HeaderTemplate>
        <ItemTemplate>
            <li>
             ...
                <p>
                    <asp:Literal ID="content" runat="server"></asp:Literal>
                </p>
             ...
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>

    Then set the News View control to use this template (if you have not already done so).


    Greetings,
    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
  9. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    Hi Radaslov,

    Thanks for getting back to me again and I apologise for screwing you about like this.

    I have submitted a ticket which better explains what I need at the end of the day. Could you please have a look at it and let me know if the solution you are suggesting is going to work for my scenario.

    Apologies again if I have not been clear.

    Cheers
  10. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    Seems I am having more joy out of the forum than the support ticket Radoslav  :)

    Here's the last thing I mentioned in the ticket:

    If I can make an amendment and my apologies for this.

    Basically, all I need is that when the list of News Articles in the NewsView control appear on the page, they will have PDF files attached to them.

    When I click on these links, a PDF file shoudl launch in a new window.

    So, we have two types of news content:

    1. Normal article-like news items: These open up in the details page like these bit.ly/gJOZjc

    2. Article news items that have PDF's attached to them like  this bit.ly/gxD5Rx

    It's is this number two option of news items that I need to open up in a PDF document in a new tab/window an not open the details page as it currently does.

    My apologies if I have created some confusion but this will now be the final requirement.

    Thanks,
    James
  11. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Nov 2010
    Link to this post
    Hi James,

    Since we started the conversation in the forum thread it is better to keep it here.

    Can you please clarify the bellow question? This will help me provide you with steps on what you need to do.

    How do you set the link to the PDF attachment in the news item? Do you write it directly in the item's content?

    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
  12. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    30 Nov 2010
    Link to this post
    Two more things Radoslav.

    1. I am adding these PDF's as a news item in the News Module of SF.
    2. I don't have this file, ~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx in this folder.

    If I make a copy of this from ~/Sitefinity/Admin/ControlTemplates/News/ListPageMaster.ascx and put it in the ~/Sitefinity/ControlTemplates/News/ folder, it does not make a change to the list repeater.

    Cheers,
  13. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Nov 2010
    Link to this post
    Hi James,

    How do you set the control template of the news view control? Do you have it defined in ~/App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml as bellow:
    <viewSettings hostType="Telerik.News.WebControls.NewsView">
        <additionalTemplates>
            <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.-->
            <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx" />
            <!--Provides user interface for displaying a single news item in the NewsView control of the News module.-->
            <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx" />
        </additionalTemplates>
    </viewSettings>

    Or you have it set in the controls properties when you go to the Advanced tab in section Appearance?

    Sincerely yours,
    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
  14. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    01 Dec 2010
    Link to this post
    Hi Radaslov,

    This is how I have my XML set up.

    <?xml version="1.0" encoding="utf-8" ?>
    <controlsConfig>
      <viewMap>
        <!-- Insert a new news item template -->
        <!--<viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemNew" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/PostsList.ascx"></viewSettings>-->
        <viewSettings hostType="Telerik.Blogs.WebControls.BlogArchive" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/ArchiveTemplate.ascx" />
        <viewSettings hostType="Telerik.Blogs.WebControls.Admin.BlogCommentsListView" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/CommentsList.ascx" />
        <viewSettings hostType="Telerik.Blogs.WebControls.Admin.BlogCommentsEditView" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/CommentsEdit.ascx" />
        <viewSettings hostType="Telerik.Blogs.WebControls.BlogCommentsList" layoutTemplatePath="~/Sitefinity/ControlTemplates/Blogs/CommentsList.ascx" />
        <viewSettings hostType="Telerik.News.WebControls.NewsView">
          <additionalTemplates>
            <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.-->
            <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/ListPageMaster.ascx" />
            <!--Provides user interface for displaying a single news item in the NewsView control of the News module.-->
            <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/ListPageDetails.ascx" />
          </additionalTemplates>
        </viewSettings>
      </viewMap>
    </controlsConfig>


    I notice that my path to the ListPageMaster points to:
    ~/Sitefinity/Admin/ControlTemplates/News/ListPageMaster.ascx

    whereas yours points to:
    ~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx

    I have attached a screenshot of the NewsView Appearance settings for you.

    Thanks again for your help.
  15. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    01 Dec 2010
    Link to this post
    Hi James,

    Ok, since your list mode setting points to the ~/Sitefinity/Admin/ControlTemplates/News/ListPageMaster.ascx file you need to open up this file and add the content literal as proposed in my previous response.

    Kind regards,
    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
  16. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    01 Dec 2010
    Link to this post
    Let me give that a try. Will get back to you shortly.

    Thanks
  17. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    01 Dec 2010
    Link to this post
    Radoslav, you're a legend!

    Ok, only problem I have now is that there are three different news sections. The one we've been trying to sort out is the one that deals with PDF items.

    I see now that your solution applies to all my news sections which I don't really want to do.

    So, I am assuming that if I make a copy of the ListPageMaster.ascx (and call it something like ListPageMaster2.ascx) and remove the literal, then, in the settings of the NewsView for my two other News sections, I can point the settings to use this template of the ListPageMaster.ascx instead?

    Can you please let me know if this approach will work? Also, do I go to NewsView settings > Advanced > Appearance > SingleItemTemplatePath and choose my template from there?

    Thanks again,
    James
  18. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    01 Dec 2010
    Link to this post
    With some blood and sweat, I managed to get my proposal working Radoslav.

    What I need now is for that link to be opened up in the new tab or window of the browser as we don't want to point the client away from the site. Could you help me with that please?

    Thanks,
    James
  19. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    02 Dec 2010
    Link to this post
    Hi James,

    In order to open documents in new tab you should add a target="_blank" attribute to the link. From inspecting the pages you have provided the links already contained this attribute.

    Kind regards,
    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
  20. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    08 Dec 2010
    Link to this post
    Hi Radoslav,

    Thanks for all your help through this process!

    Much appreciated!
Register for webinar
20 posts, 0 answered