0.022
thk thk Thu. 8 May. 2008 14:35 tags old kaotonik , plone 1 views

(This is an old plone howto I wrote)

by thk last modified 2006-05-15 12:14

by default recent portlet doesn't show up to non - members.. Here is how to modify this behavior..

1.Go to portal_skins ->  plone_portlets

2.Customize the portlet_recent portlet.

3.Here is the lines that we will change

<div metal:define-macro="portlet"
     tal:condition="python:not isAnon and template.getId()!='recently_published'">​   

<tal:recentlist tal:define="last_login_time python:member.getProperty('last_login_time', DateTime());
        ​        typesToShow  python:putils.getUserFriendlyTypes();
        ​        results python:request.get('items',
        ​        ​        ​        ​        ​   here.portal_catalog.searchResults(sort_on='modif​ied',
        ​        ​        ​        ​        ​   portal_type=typesToShow,
        ​        ​        ​        ​        ​   sort_order='reverse')[:5]);">



4.Change to

<div metal:define-macro="portlet"> ​  

<tal:recentlist tal:define="typesToShow  python:putils.getUserFriendlyTypes();
        ​        results python:request.get('items',
        ​        ​        ​        ​        ​   here.portal_catalog.searchResults(sort_on='creat​ed',
        ​        ​        ​        ​        ​   portal_type=typesToShow,
        ​        ​        ​        ​        ​   sort_order='reverse')[:5]);">  ​        ​        ​        ​        ​