Developer forum

Forum » Templates » RenderPageContent and Global Elements

RenderPageContent and Global Elements

Michael Fenech-Andersen
Reply

When displaying a news item I want a sidebar with reference to other latest news and some global elements that I use across the site. 

Page "Right Sidebar page" with ID: 788 contains
- Paragraph 1 (standard Paragraph)
- Paragraph 2 (Global element from another page)
- Paragraph 3 (standard Paragraph)

Viewing this page on the frontend on it's own it shows all elements. 

In my template for displaying a news item NewsArticle_custom.cshtml I have added @RenderPageContent(778) btu it does not include the global element only the two standard Paragraphs. 

Is there another/better way of doing this? 


Replies

 
Lars Larsen
Lars Larsen
Reply

Hi Michael

Instead of having a page to hold the sidebar content, place the sidebar paragraphs directly on the page where they are supposed to be shown. You could even insert all the sidebar paragraphs as global paragraps. To avoid having the editor to put the same three sidebar paragraphs on "every" page, save the page as template. In that way the editor can thoose this page template when creating new instances of the page type, and the three sidebar paragraphs will then be created automatically on the new page.

 

You must be logged in to post in the forum