I made a template to show a random photo on the front page.
As far as I understand, it is easy to use the same approach to show other random stuff (like a changing front-page in a "store", for example by setting the path to a smartfolder and using a macro to display a page.

Thought I should tell, as this might be handy for some (?)

Here is the code (you can see the results at: http://xweb11.plana.dk: 8092/brunII ) (saved the template as front-page)

__________________________________________________________________

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="no" lang="no"
metal:use-macro="here/main_template/macros/master" 18n:domain="plone">

<body>

<div metal:fill-slot="main">
<h1>Fotograf Hans Jørgen Brun</h1>
<p class="documentDescription">Norges mest premierte fotograf</p>

<div tal:define="presults python:container.portal_catalog (Type='Image',
                         review_state=['published','visible'],
                         path='/brunII/barn/')"
             tal:condition="presults"
             tal:on-error="nothing" >


<tal:block tal:define="pobj python:random.choice (presults).getObject()">

<img tal:attributes="src string:${pobj/absolute_url}/ image" alt="" />

            </tal:block>
          </div>
        </div>

</body>
</html>

_________________________________________________________________

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to