Forcing News to Open in a New Window

Posted by Community Admin on 03-Aug-2018 21:17

Forcing News to Open in a New Window

All Replies

Posted by Community Admin on 07-Jan-2011 00:00

Is there any way to force the news module in list mode to open in a new window?  Currently it's reloading the page with the full article in a small area of the page which doesn't fit properly. 

Posted by Community Admin on 10-Jan-2011 00:00

I should clarify, when I say new window I don't mean a popup.  I just mean refreshing the page and having the news article display full page rather then in a small area of the existing page.

I also found this in the Knowledgebase:

ItemListUrl and SingleItemUrl
These properties allow you to have the List and Details views to be displayed on 2 different pages. This is how to do it:

1. Let’s say we have a page called Page1.aspx and we have a Content View control dropped on it. We want to make this page handle the display of the list of content items. We need to set the SingleItemUrl property to point to the URL of the page (Page2.aspx) where another Content View control will handle the display of the full content of only 1 content item.

2. Page2.aspx, as we said, needs to have the Content View control dropped on it and it will display the full content of only 1 content item. We need to set the ItemListUrl  to point to the page (Page1.aspx) with the list of content items so that the user can navigate back to it if needed.

However, SingleItemUrl and ItemListUrl don't seem to exist in Sitefinity 4.0 (unless I'm just missing them).  Any help on solving this would be very greatly appreciated!

Posted by Community Admin on 12-Jan-2011 00:00

Hi Chris,

You could achieve the required scenario as follows:

  1. Create page1 and page2
  2. Go to edit page1 content and drag News widget - it will display the news list:
    • Click Edit to open News widget designer
    • Select Single Item Settings tab
    • In Open Single item in… radio button, choose Select existing page… option
    • Select page2 from the list with existing pages
  3. Go to edit page2 content and drag News widget - it will display the details of the clicked news item:
    • Click Edit to open News widget designer
    • Open the Advanced mode
    • Find ControlDefinition property and click ControlDefinition button
    • Find Views property and click Views button
    • Find NewsFrontendDetails property and click NewsFrontendDetails button
    • Find MasterPageId property and set the ID of page1. To get the ID of page1, you could execute the following query on your database:
      SELECT [id]
      FROM [dbo].[sf_page_node]
      WHERE [title_] = 'page1'

For more details, please refer to the following article: Configuring the News widget

Best wishes,
Pepi
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

Posted by Community Admin on 13-Jan-2011 00:00

Hi Pepi,

Thank you for the response.  Is there an easier way to get the Page ID?  I'm still in development right now so I don't have a SQL database to run queries against.

Also, does the second page HAVE to be tied to the first page?  We're very likely going to use the news list widget on multiple pages and in all cases we'll want the news to open in a new full page.  Does that mean we're going to need to create a full page view for each page that news appears on?

Posted by Community Admin on 13-Jan-2011 00:00

Hi Chris,

Out of the box there is no view that lists the GUIDs of all page node. You can create a simple control where you can list all page nodes and the ids. You can use the fluent API to do this

var pages =  App.WorkWith().Pages().Where(p => p.ApprovalWorkflowState == "Published").Get().ToList();
   foreach (PageNode node in pages)
   
       var id = node.Id;
       var title = node.Title;
   

We will have built-in selectors, but they  will be implemented after the official release.

MasterPageId is the relation to the master page where you can return back to the list per your request. If you do not associate the second page with the first one using MasterPageId  the control will use the current page to show an item in list and detail mode.

Basically the News control has two modes - list ( master mode) and details mode .  List displays all items, Details displays a single item. Without having a physical page the News widget cannot construct the url properly, because the url is formatted based on the page url and content item url

All the best,
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

This thread is closed