On 24.02.2011 23:26, Will Scheidegger wrote:
Answering my own question... something like this below did the job. But
I don't think it would win a price in a code beauty contest...

I Will, I can beat you in "Worst Code Competition" with this (this code run in a template):

<div id="leftSidebar">

  [#assign sourcePath = model.siteRoot.@handle + "/leftSidebar"]
  [#assign isHome = model.siteRoot.@uuid == page.@uuid]

  [#if mgnl.editMode && isHome]
    <ul class="mgnlEditMode">
  [#else]
    <ul>
  [/#if]

  [#assign i = 0]
  [@cms.contentNodeIterator repository="website" path=sourcePath]
    [#if i != 0]
      <li class="separator">&bull;</li>
    [/#if]
    [#assign i = i + 1]
    [@cms.includeTemplate noEditBars=!isHome/]
  [/@cms.contentNodeIterator]

  [#if mgnl.editMode && isHome]
    <li>
      <div>
[@cms.newBar contentNodeCollectionName="leftSidebar" newLabel="+" paragraph="${stk.asStringList(def.extrasArea.paragraphs)}" /]
      </div>
    </li>
  [/#if]

  </ul>
</div>

This is directly taken from a running project.
only two observations:
1) I point directly to a specific node collection: leftSidebar in homepage
2) I use the var isHome to manage the style and the edit bars

HTH, who won the prize?
;-)

matteo



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to