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

Forums / Developing with Sitefinity / How Can I Add New Option Under "Open single item in..." in News Module

How Can I Add New Option Under "Open single item in..." in News Module

4 posts, 0 answered
  1. Brian
    Brian avatar
    26 posts
    Registered:
    12 Jun 2015
    21 Jun
    Link to this post

    Hi Guys,

    I need some advice on the best way to add a new option for the single item view on the news module.  Currently, it allows me to select a dynamically generated page with the same layout as the current page or a another page that I can select.  I need to be able to have the item appear in a modal popup on the same page as the list.

    I don't know if I can do this by doing something with the back end, or if I need to create a another control that inherits from the news module.  If the latter, can you recommend the best way to go about it or point me to an example?  

    This is for a pretty hot project (deadline < 1 week), and I need to get this done ASAP.  Any help would be greatly appreciated.

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    24 Jun
    Link to this post
    Hello Brian,

    In order to achieve your need you can update exciting List template or create a new one (e.g. Modal Details view), where to use custom functionality instead. More information how to achieve that is available here:
    http://docs.sitefinity.com/create-and-edit-widget-templates

    Then for example you can replace the "DetailsViewHyperLink" control with a Label control like:
    <asp:label id="myLabel" Text='<%# Eval("Title")%>' runat="server" />
    and add the additional logic you need.

    Regards,
    Svetoslav Manchev
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Brian
    Brian avatar
    26 posts
    Registered:
    12 Jun 2015
    24 Jun in reply to Svetoslav Manchev
    Link to this post
    Hi and thanks.  I have a lot of it figure out now.  The big issue I am still having is getting the proper URL.  I can get UrlName, but that leads to a dead link.
  4. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    24 Jun
    Link to this post
    Hello Brian,

    What is the content that you need to display on the modal widow - the news only or the whole details view page?

    You can get/construct the Item url or its fields similar to approach user for the Title (or any other property you need:
    <asp:label id="myLabel" Text='<%# System.Web.HttpContext.Current.Request.Url.AbsoluteUri +Eval("ItemDefaultUrl")%>' runat="server" />
    which will return the entire page, or the fields you need /Content, Description, Id, etc respectively/.

    In case you are using version 9.0+ you can call the respective news item in the modal window by its Id like for example:
    http://www.mysite.com/api/default/newsitems(ac802da6-fe1d-6c4d-a96f-ff01008aa7da)
    and display it in the appropriate format.

    More information about the web services is available here:
    http://docs.sitefinity.com/for-developers-client-side-programming-and-web-services

    Regards,
    Svetoslav Manchev
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
4 posts, 0 answered