How Can I Add New Option Under "Open single item in..." in News Module
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.
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" />
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.
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" />
http://www.mysite.com/api/default/newsitems(ac802da6-fe1d-6c4d-a96f-ff01008aa7da)