[Product-Developers] How do I change the breadcrumbs for a custom template?

Tim Knapp duffyd at kokorice.org
Mon Dec 24 04:09:22 UTC 2007


Hi Mark,

Just a suggestion, which will *hopefully* resolve this issue for you (if
you haven't tried it already):

Ensure the page is defined as a selectable view for say 'Page' and then
you can click the display dropdown and select your defined page
template. This should ensure you don't break the breadcrumbs.

To setup your custom template as a selectable view for Page using
GenericSetup, do something like this in your product:
e.g. profile/types/Document.xml ->  <property name="view_methods"
purge="False">
<element value="my_chosable_view"/>

If you're not developing a custom product (i.e. using ZopeSkel or
DIYPloneStyle) you can go into portal_types and add your custom template
under the view_methods property. Then create a new 'page' in the root of
your site and select your template as the 'display' view.

HTH,
Tim

On Sun, 2007-12-23 at 20:45 -0700, Mark Phillips wrote:

> I am using:
> Plone 2.5.2, 
> CMF-1.6.4, 
> Zope (Zope 2.9.7-final, python 2.4.4, linux2), 
> Five 1.4.2, 
> Python 2.4.4 (#2, Aug 16 2007, 02:03:40) [GCC 4.1.3 20070812
> (prerelease) (Debian 4.1.2-15)], 
> PIL 1.1.6
> 
> I have created a page template for my home page. It searches the catalog
> for the latest page with the keyword "lead story", and then displays
> that page as the home page. However, the breadcrumbs show:
> 
> 	You are here: Home → portal_skins → custom 
> 
> I would like them to show:
> 
> 	You are here: Home → Members → mark → my-page
> 
> or where ever the actual page is located.
> 
> How do I change the breadcrumbs in my new template? 
> 
> Thanks!
> 
> Mark
> 
> The new page template:
> 
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
>       lang="en"
>       metal:use-macro="here/main_template/macros/master"
>       i18n:domain="plone">
> <body>
> 
> <div metal:fill-slot="main" tal:define="results
> python:container.portal_catalog(portal_type='Document',sort_on='Date',review_state='published',Subject='lead story');
>                  the_result python:results[0].getObject()">
>     <tal:main-macro metal:define-macro="main"
>           tal:define="text python:the_result.CookedBody(stx_level=2);
>                       len_text python:len(text.strip())">
>         <div
> metal:use-macro="here/document_actions/macros/document_actions">
>             Document actions (print, sendto etc)
>         </div>
> 
>         <h1 tal:content="the_result/Title" class="documentFirstHeading">
>             Title or id
>         </h1>
> 
>         <div metal:use-macro="the_result/document_byline/macros/byline">
>             Get the byline - contains details about author and
> modification date.
>         </div>
> 
>         <p class="documentDescription"
>            tal:content="the_result/Description"
>            tal:condition="the_result/Description">
>             News summary
>         </p>
> 
>         <div class="newsImageContainer"
>              tal:condition="the_result/image_mini|nothing">
>             <a href="#"
>                tal:attributes="href string:
> $the_result/image/image_view_fullscreen">
>                <img tal:replace="structure python:
> the_result.tag(scale='mini', css_class='newsImage')" src="" alt="" />
>             </a>
>             <p class="discreet"
>                   tal:content="the_result/getImageCaption">Image
> Caption</p>
>         </div>
> 
>         <p tal:condition="python: not len_text and is_editable"
>            i18n:translate="no_body_text"
>            class="discreet">
>             This item does not have any body text, click the edit tab to
> change it.
>         </p>
> 
>         <div class="stx"
>              tal:condition="text"
>              tal:attributes="class python:test(here.Format() in
> ('text/structured',
>                                                    'text/x-rst', ),
> 'stx', 'plain')">
>             <div tal:replace="structure text" />
>         </div>
> 
>         <div
> metal:use-macro="the_result/document_relateditems/macros/relatedItems">
>             Show related items if they exist
>         </div>
>         
>         <div class="visualClear"
> id="clear-space-after-relatedItems"></div>
> 
>     </tal:main-macro>
> </div>
> 
> </body>
> </html>  
> 
> 
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20071224/46a81d65/attachment-0002.html>


More information about the Product-Developers mailing list