Ticket #13213 (confirmed Feature Request)

Opened 4 years ago

Last modified 4 years ago

diazo should have looping to make mockup html more useful

Reported by: djay Owned by:
Priority: minor Milestone: 4.x
Component: Diazo (plone.app.theming) Version: 4.2
Keywords: Cc:

Description

Currently to loop in diazo you need to use xsl:for-each. To use this you need to take your html from your mockup html and place it directly inside your rules.xml file which means changes made html by designers often have to be made both in the mockup and rules.xml. This defeats the purpose of separating the html and the rules into two different files.

In addition the xsl:for-each can result in long confusing code and writing it requires the understanding many different xsl constructs. Given that looping is fairly common in most themes for example with navigation menus it would be good to lower the amount needed to be learnt by reusing the simpler to understand diazo constructs.

Ignore the actual syntax but consider if there was a kind of diazo looping syntax that allowed the html to left inside the mockup. For example

<replace theme="//li[0]" for-each-content="//dd">
  <replace theme=".//a" content=",//a"/>
</replace>

The idea is that this would loop only over the items selected in the content and use the theme="//li[0]" as the mini template to be replaced as many times as there is items in for-each-content="//dd" Inside the replace you can then specify how you want the template specified by theme="//li[0]" to be changed.

Change History

comment:1 Changed 4 years ago by kleist

  • Status changed from new to confirmed
  • Component changed from Unknown to Diazo (plone.app.theming)
  • Type changed from Bug to Feature Request
  • Keywords diazo removed
Note: See TracTickets for help on using tickets.