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

Posted by Community Admin on 04-Aug-2018 17:08

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

All Replies

Posted by Community Admin on 21-Jun-2016 00:00

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.

Posted by Community Admin on 24-Jun-2016 00:00

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
 

Posted by Community Admin on 24-Jun-2016 00:00

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.

Posted by Community Admin on 24-Jun-2016 00:00

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
 

This thread is closed