Blog Entry

An alternative way to detect the Plone front page

viernes, abril 10, 2009 by , under ,

First, I tried this example:
http://plone.org/documentation/how-to/change-the-logo-on-for-the-front-page-only

It works .. almost. It also shows the logo in other contex like @@dashboard, which was something I did not wanted to happen. So I started looking for another way until I found a clue on the select_default_page.cpt

So I tried this instead:

<div tal:define="is_ATDocument python: test(context.meta_type=='ATDocument',1, 0);
parent python:context.getParentNode()"
tal:condition="is_ATDocument">

<p id="uno"
tal:define="is_default_page python: test(parent.getDefaultPage() == context.getId(),1,0);"
tal:condition="is_default_page">This is the default Page (index_html on Plone less than 3.0)</p>
</div>


The div will be rendered only when the context is an ATDocument, then it's contents will be rendered only if the document is the default page.

Any comments?
It seems to me it is working.

1 Responses to “An alternative way to detect the Plone front page”

5:21 p.m.

Comment by Noe Misael Nieto Arroyo.

Someone on #plone IRC pointed to this webpage
https://weblion.psu.edu/trac/weblion/wiki/CheckForFirstPage