ASPX templates
Version 6.x > ASPX templates > ASPX + Portal Template, Web Part Visbility View modes: 
User avatar
Member
Member
Cait - 8/15/2012 2:38:04 PM
   
ASPX + Portal Template, Web Part Visbility
Our shop has decided to utilize ASPX + Portal Engine templating. I designed two ASPX templates with defined zones, without any predefined webparts. One template for the homepage and the other template for all "tier two" pages.

My problem, or what I perceive as an annoyance- when I add a webpart via the design tab to a "tier two" page it shows on all pages with the applied "tier two" template. Many of the pages will have the same web parts but not all.

I have looked at webpart visibility and page inheritance options. I don't think either of these options are feasible as the hide on subpage won't work because the pages are all on the same page level/ document type and the inheritance seems as though it controls the webpart content, not the actual webpart.

Essentially I want my ASPX + Portal Engine template with defined zones to be used on multiple pages while not forcing me to share the webparts.

Is my only option to create additional templates for any page that I want different webparts?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/18/2012 7:37:19 PM
   
RE:ASPX + Portal Template, Web Part Visbility
Hi,

you listed all options. You can configure Visibility property using macro or create a new template for documents which should not contain web parts.

On option you did not mention is adding editable text web part to your template. Then you could insert to the editable area widget which was created based on requested web part. This way you could insert a different widget on each page and it would not change another template as editable text web part content is unique for each document.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
lukejamesk-gmail - 9/6/2012 9:47:08 PM
   
RE:ASPX + Portal Template, Web Part Visbility
If it only needs to be on the one page or a couple of pages you could also consider using a widget.

If the pages have any type of common theme you could also use a macro in the visibility field.

User avatar
Member
Member
lukejamesk-gmail - 9/18/2012 1:01:31 AM
   
RE:ASPX + Portal Template, Web Part Visbility
I have always found that that it is easiest to reuse templates if in the CMSWebPartZone you turn it into a widget zone. If you add widgets in the design tab they will by default load when the template is used however the user can remove them if they like.

I find this especially useful for having a standard sidebar but occasionally you may want to have a different sidebar or content area.