Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Using multiple Tree menu webparts in a site View modes: 
User avatar
Member
Member
fretief - 2/1/2010 11:59:21 PM
   
Using multiple Tree menu webparts in a site
Hi,

I am trying to use multiple tree menu webparts in my site, but it seems like the webpart can only be used once.

If I point it to a path in my site on one page, the other Tree Menu webparts inherits that path.

Can I not specify a different path per web part?

If not - does anyone have a work around?

Thanks

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 2/2/2010 1:41:09 AM
   
RE:Using multiple Tree menu webparts in a site
Hi,

CMS Tree menu web part can be used multiple times even on the same page template. Page templates are global objects and any change to one page template (any change to any web part located in the page template) is propagated all over the documents which are using the same page template. In other words, if you configure for example path property in your web part on your page template, this change is propagated over all the documents which use the same page template.

Best regards,
Miroslav Remias.

User avatar
Member
Member
fretief - 2/2/2010 5:22:34 AM
   
RE:Using multiple Tree menu webparts in a site
Thanks a lot - using different templates did the trick

User avatar
Member
Member
seona13 - 2/18/2010 11:41:31 PM
   
RE:Using multiple Tree menu webparts in a site
I'm also having a problem with this, and the idea of having to use different templates just to make the web part not inherit a global property has me seriously confused.

I had assumed that part of the value of using templates was that if you wanted to make a layout change (say, changing the class that a container uses so that it can be affected by a different CSS style) you made it once and all of the pages using that template would get the change. I had never considered that content would be something that a template would propagate to all of the pages that use it as well.

Am I simply not understanding the Kentico way of looking at these two concepts? Because particularly in the case of the "Highlighted path" value for the Tree Menu, it seems counter-intuitive to me that this would not be unique for each page that the menu appears on, regardless of whether the page is using a template or not.

Can someone please help me make sense of all this? It would be greatly appreciated.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 3/3/2010 3:48:46 AM
   
RE:Using multiple Tree menu webparts in a site
Hello,

Please note that content from editable regions is not propagated to other pages that uses the same template as content is stored per document. But properties of web parts are stored per template so they can be shared by all documents that use this template (this is actually the purpose of using template).

Regarding the 'Highlighted document path' property, please note that if you don't specify this value, current document is automatically used, so you don't need to specify current document manually into this property for each document. Anyway, if you want to set some property dynamically you can create copy of web part and check current page and set properties in code-behind of it.

Best Regards,

Martin Dobsicek

User avatar
Member
Member
seona13 - 3/4/2010 4:50:50 PM
   
RE:Using multiple Tree menu webparts in a site
Hi Martin,

Thanks for the response. I'm slowly getting my head around the way web parts are shared between templates. I've been getting some assistance from a few other people in the support team by email and it's all starting to come together in my head (finally!).

It looks like the only options for doing what I need (a side menu that shows the siblings of whatever section you're in (so a page under Support show all of the support pages, a page under Tools shows all of the tools pages, etc) can only be done with an ad hoc template on each page, or at the very least a separate template for each site section.

Cheers,

Seona.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 3/14/2010 12:42:37 PM
   
RE:Using multiple Tree menu webparts in a site
Hi Seona,

You can use macros to display items under appropriate level of current path, e.g. following macro displays all documents under the second level of the current path:

/{0}/{1}/%

Please see Path expressions section of Dev.Guide for more details.

Best Regards,

Martin Dobsicek