[Plone-UI] Custom homepage Plone 3

MichaelT databasemarketer at yahoo.com
Thu Sep 3 14:21:35 UTC 2009


Not sure my response below was accepted, so I'm replying now that I am a
subscriber.


MichaelT wrote:
> 
> In the freearch theme they do this:
> 
>  def recently_published_news(self):
>         context = self.context
>         catalog = getToolByName(context, 'portal_catalog')
>         results = []
>         for r in catalog(portal_type='News Item',
>                          review_state='published',
>                          sort_on='Date',
>                          sort_order='reverse',
>                          sort_limit=2,):
>             results.append(dict(date=r.Date,
>             					year=DateTime(r.Date).year(),
>             					month=DateTime(r.Date).month(),
>             					day=DateTime(r.Date).day(),
>             					news_obj=r.getObject(),
>             					url=r.getURL(),
>                                 title=r.Title,
>                                 description=r.Description,
>                                 ))
>         return results
> 
> Hope that helps.
> 
> Sanders wrote:
>> 
>> I created a site for moaweb.nl in Plone 3 with a custom homepage.
>> It's based on 4 columns where the client can maintain the content
>> completely TTW.
>> 
>> In the custom template I created the following code for the events:
>> <ul>
>> {% for n in evenementen %}
>> <li> {{n.url|safe}} {{n.titel|safe}} </li>
>> {% endfor %}
>> </ul>
>>  /MOA/evenementen-en-agenda/evenementen-agenda Overzicht evenementen
>> &raquo; 
>> 
>> How can I adjust this code so that:
>> - only the X most recent items in folder X are shown?
>> 
>> I tried different pieces of python code but only ended up with no content
>> shown at all.
>> My understandig of this language is very limited and I'm definetly stuck
>> here.
>> 
>> Maybe someone can  give me a push in the right direction?
>> 
>> Greetings,
>> Nique
>> 
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/Custom-homepage-Plone-3-tp3573025p3573533.html
Sent from the User Interface & Design mailing list archive at Nabble.com.




More information about the UI mailing list