Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > WebParts and Page Templates View modes: 
User avatar
Member
Member
markus.jung-teletrader - 9/7/2010 2:53:26 AM
   
WebParts and Page Templates
Hi,

i created a Webpart based on the provided tutorial and documentation. It worked quite easy. The webpart that I have created is just a basic container element that contains a header and a content part. I used the existing web part 'Static HTML' as template and just extended it with a header property. Then I added the custom html code to display the container. The integration worked and everything is displayed as a suggest it, when I add such a web part on the page.

Now I have created a page template that just divdies the page into a content and a right column area. In the right column area I want to place my container web parts. Again it worked as expected, but the problem is when I add more sites based on the template the web parts which have to be configured in the design mode of the page are globally shared between all the pages. This means if I change the properties of my web part on the one page, it is also changed on the other page.

I would like to have separate 'instances' of my webpart at each page. And also a different number of web parts. Currently I have a separate page template for each page as workaround, but that is not really nice.

Maybe I'm doing it in the wrong way and I do not correctly apply the concept of page templates and web parts.

Thank you for your help!


User avatar
Member
Member
markus.jung-teletrader - 9/8/2010 4:37:26 AM
   
RE:WebParts and Page Templates
Ok, one of the top 10 articles in the knowledge base covers the topic: http://devnet.kentico.com/Knowledge-Base/Design-and-css/Page-templates.aspx.

The article is about 2 years old, has there been any change?

I understand the argumentation with the page template, but for my intuitie understanding a page template should only contain the web part zones. The web parts should be replaceable at each page, but this is just my opinion.

Any way, is there a way to have reusable compenents that can be placed at multiple pages, with different content and with a different number of items at each page?

The problem is rather simple, I just don't want to repeat the same HTML code at each page again. I just want to place a header and a body text into it. The advantage of a web part would be that i can change the HTML container at a single place.

Best Regards,
Markus

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/8/2010 7:59:27 AM
   
RE:WebParts and Page Templates
Hi,

The definition of a template is still the same. Moreover, web parts are the layout of the page - so without them the page template has no sense - just some basic layout. The users want to have the web parts already present on the page template.

In this case you need to create new page templates - you can do it easily on the document Properties tab in CMS Desk, Templates section: You can clone current template as an AD-HOC template or create new, independent page template from the current one - so you do not have to repeat the same code every time.

Best regards,
Juraj Ondrus