Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Reuse Content View modes: 
User avatar
Member
Member
positivepurchasing - 10/2/2013 6:27:57 AM
   
Reuse Content
Hi,

How do I reuse content?

For example, I have several pages that require the same list of hyperlinks on the left hand side (a sub-menu), but have different content to the right of the sub-menu.

Can I create a 'partial page' and include it in a page template which can then be re-used?

Cheers
Paul.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 10/2/2013 7:53:48 AM
   
RE:Reuse Content
There are a few things you can do. I'm sure there are other ways but I've found these to be the most common.

1. Simply copy and paste the html from one page to the next. (least desirable and most maintenance)

2. Use visual inheritance (highly recommended and very powerful). Create a page template with the zones/webparts needed on it. Then put a page place holder where you want the content that is different. Then create another page template that has the zone/layout/webparts you want on it (this will be your sub page).

This is how you might setup a standard asp.net website using master pages. Your master page contains your header, footer and main navigation. Then your pages that inherit your master page only have content areas on them. You can then inherit those content pages on other content pages, simply nesting them. Using Visual Inheritance is really no different with the exception that you get a nice UI to work in.

User avatar
Member
Member
positivepurchasing - 10/3/2013 4:37:01 AM
   
RE:Reuse Content
Hi FroggEye.


Thanks for your reply.

1. Is how many of the sites are currently set up here and as you say it's awful.

2. This seems the way to go.


Cheers
Paul.

User avatar
Member
Member
positivepurchasing - 10/3/2013 6:34:07 AM
   
RE:Reuse Content
Hi.


I've had ago at the visual inheritance method and that works fine, using page place holder controls and content controls. But to achieve the required layout I now have an extra level in my treeview structure. Is there a way to make a page return a 404 and to remove it from the url to the sub pages, on the public site?


Cheers
Paul.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 10/3/2013 8:16:10 AM
   
RE:Reuse Content
I think I'm understanding what you want. If you need to move pages on an already live site you can make some setting changes at the site level so your "old" URLs are remembered and if someone navigates to them, it redirects them to the new URL automatically.

Take a look in the CMSSiteManager>Settings>URLs & SEO>SEO - URLs. in there you can check
- Redirect document aliases to main URL
- Redirect documents to main extension

In the Document URLs section you can set Remember original URLs when moving documents. This setting will create the alias automatically for you when you move the document.

If you don't already have a 404 page setup, simply create a simple 404 on your site (wherever you'd like in the content tree) and in the CMSSiteManager>Settings>Content>Page not found section set the Page not found URL to ~/404.aspx or whatever the path is to your 404 page. Then by default kentico will send the user there if a page is not found.