[triangle-zpug] Hide a portlet best practice

Chris Calloway cbc at unc.edu
Thu Mar 23 22:11:25 CET 2006


Edmund Moseley wrote:

> Quick question of best-practice.
> 
> I want to hide the navigation on the login_password cpt.
> Initially, I tried adding an empty left_slots property to the cpt, but 
> that didn't work.

Yeah, I think that's a folder property? It will be found by acquisition 
on any of the 'rents.

Obviously you are using metadata files on the filesystem? Or did you 
customize login_password in order to be able to add a property to it?

I guess I'm not totally clear on how you added a property to a 
filesystem cpt.

> I assume it is because it uses the main_template and 
> so defaults to whatever is there.
> I finally got the navigation to disappear by filling the column_one_slot 
> with nothing:
> 
> <div metal:fill-slot="column_one_slot">
> 
> </div>
> 
> Is this how I should go about this, or is there a better way?

I *think* you want to customize portlet_navigation with a conditional 
which renders nothing when the template (?) or context (?) built-in name 
contains login_password (or whatever other templates your are trying to 
hide the navigation portlet). Put this is in a site skin product in 
order to be best practice.

If you wanted to get really fancy, you could create a lines property 
with all the template names you want to omit the navigation portlet. 
Then your navigation portlet reads that lines property and uses the 
resulting list in the conditional. That way, the templates which omit 
navigation portlet are not hard coded into the portlet code, and can be 
maintained by the site manager TTW on a properties tab if not in a site 
skin, or maintained in a metadata file under version control if the 
custom navigation portlet is in a site skin.

-- 
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 17-6 Venable Hall   phone: (919) 962-4323
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599







More information about the triangle-zpug mailing list