[Plone-UI] Customize portlets/slots only at front page

Veda Williams veda at onenw.org
Sun Sep 7 23:24:42 UTC 2008


I meant to send this to the ui list as a whole but apparently did not:

You have two options here:

You can create a page template called homepage_view, with code at the top
that overrides the slots:



<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>


<metal:overrideSlotOne fill-slot="column_one_slot">
  <tal:comment replace="nothing">We don't want the portlets
showing</tal:comment>
</metal:overrideSlotOne>


<metal:overrideSlotTwo fill-slot="column_two_slot">
  <tal:comment replace="nothing">We don't want the portlets
showing</tal:comment>
</metal:overrideSlotTwo>


<!-- you could add extra stuff here if you wanted -->

<!-- this stuff below just fills in the main contents of the page with the
standard stuff -->

<metal:main fill-slot="main">
    <tal:main-macro metal:define-macro="main"
           tal:define="text python: here.CookedBody(stx_level=2)">

        <div 
metal:use-macro="here/document_actions/macros/document_actions">
            Document actions (print, sendto etc)
        </div>

        <h1 tal:content="object_title" class="documentFirstHeading">
          Title or id
        </h1>
    
        <div metal:use-macro="here/document_byline/macros/byline">
          Get the byline - contains details about author and modification
date.
        </div>

        <p class="documentDescription"
           tal:content="here/Description"
           tal:condition="here/Description">
            Description
        </p>
        <p tal:condition="python: not 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="here/document_relateditems/macros/relatedItems">
            show related items if they exist
        </div>
    
    </tal:main-macro>
</metal:main>

<!-- end center content stuff -->

</body>
</html>

This is a lot to chew off, but if you have other changes that require
changing your homepage layout, it may be your best option. (Don't forget to
assign homepage_view to portal_types/document as a possible view, then
choose it from the display dropdown menu on your home page).


Your other option is to comment it out with css like this:

.section-front-page #portal-column-one (display:none; }
.section-front-page #portal-column-two (display:none; }
 
(section-front-page corresponds with the shortname of the homepage, which in
this case would have a shortname of "front-page").

HTH,

- Veda


On 9/5/08 3:29 PM, "diegorubert" <diegorubert at hotmail.com> wrote:

> 
> Hi!
> I'm using Plone 3 and need hide portlets or left slot of front page. I don't
> want really remove because of sub-folders get portlets from it (or gonna
> must configure portlets on each sub-folder), I want just hide them or left
> slot. I saw right_slots and left_slots property, but it don't works anymore
> on Plone 3, and #portal-column-two { display: none; } works, but only if I
> discover how to use it only on front page...
> Can anyone help-me?
> Thanks!





More information about the UI mailing list