ASPX templates
Version 2.x > ASPX templates > Including other pages in content View modes: 
User avatar
Member
Member
redactuk - 5/4/2007 6:51:53 PM
   
Including other pages in content
How can i create an ASP template that includes automatically the data content from an existing editable region that is aprt of another template?

Example I have 20 pages and each page will have an identical right-column. What i want to do is create a very bais page that will allow the user to enter/edit the content of the right menu, then have another template automatically include the content that the user saves.

Any ideas?

User avatar
Certified Developer 8
Certified Developer 8
norashlea - 5/6/2007 3:33:31 AM
   
RE:Including other pages in content
hth

Use an Article. I found that I had to create xslt transformations, though, as aspx transformation just spat errors.

In CMSDesk, create a page using root template and then add an article.

Put a CMSViewer on each page template where you want content repeated, with ClassNames="cms.article". Set the Path of the CMSViewer to /[your page]/%

Note -- if you create more than one article, they'll all be repeated. If you only want the specific article shown, modify the Path accordingly.

If you don't want the articles hidden behind a page "icon" in the tree, change the allowed children on root to include article, and create the articles at the root level. Make sure you specify the exact article name in the path for CMSViewer, though.

User avatar
Member
Member
redactuk - 5/8/2007 1:05:28 PM
   
RE:Including other pages in content
Thank you for reply!

I've got a slight issue in that I switched to Source view when editing the article and inserted HTML, but now the article is displayed as raw HTML! Presumably this is something I need to rectiry by changing the XSLT? Where do I edit or create new XSLTs?

Thanks

User avatar
Member
Member
redactuk - 5/9/2007 11:47:31 AM
   
RE:Including other pages in content
Ok I've resolved this now.

Rather than playihng around with existing code I create a new document type - custom.code that I can now basically use as a user-defined web-part anywhere in the site simply to pull in content from another part of the site. Works well.

User avatar
Member
Member
Marco - 1/7/2008 12:46:50 AM
   
RE:Including other pages in content
Hi,

I would like to do the same as you already found out, filling the same content once and reuse it on multiple pages.

Can you provide me an example of how you did this?

Best regards,

Marco Muts

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/29/2008 3:41:51 PM
   
RE:Including other pages in content
Hi,
you can use the same steps as were described by norashlea. Or maybe you can try to use linked documents - http://www.kentico.com/docs/devguide/linked_docs.htm