[quills-dev] How to adjust Quills template to check for a ZMI Role (or Owner) ?
Michael Reitsma mreitsma at gmail.comTue Nov 14 17:23:08 UTC 2006
- Previous message: [quills-dev] Questions about features
- Next message: [quills-dev] Importing advice
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I posted this question a while ago but never got any further with it.
I was thinking about using one template to do two things:
When user has a role it would render itself with a different set of
weblogentrys(namely only his), when no role is detected it would render with
all weblogentries found in the site.
This would solve my multiuser problem (a bit).
it would allow me to specify another template as the default template for
all Quills weblogs.
The template would use all weblogentries for rendering at the homepage
Quills instance.
But the template would only use the results for the current user when a test
for a role would succeed.
And thus render correct for the Quills instances in their folders(where they
own them ofcourse).
I would need to add a role in the ZMI and adjust the template so that it
checks for the role .
(If the user doesn't have the role it will display only his own entrys
otherwise it will show all.
That way i could just use portaltypes/aliases to use the siteplanet template
for all weblog instances.)
Ofcourse i would still need a pointer (or two..) how to adjust the template
...
This is what collects the entrys in the template:
div id="content-weblog"
tal:define="results python:container.portal_catalog
(portal_type='WeblogEntry',
sort_on='effective',
sort_order='reverse',
review_state='published');
qt python:container.quills_tool;
Batch python:modules['Products.CMFPlone'].Batch;
b_size python:20;
b_start python:0;
b_start request/b_start | b_start;
batch python:Batch(results, b_size, int(b_start),
orphan=1);
results_dict python: qt.sortWeblogEntriesToDates
(batch);"
So if anyone wants to give a pointer or two what to code here that would be
nice.
Perhaps an even simpler test would be to test if the Owner of the current
Weblog is the same as the current User.
If Owner == User then show only user entries ELSE all entries.
This way i wouldn't have to add Roles to the ZMI either :-)
regards Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.etria.com/pipermail/quills-dev/attachments/20061114/126ecd91/attachment.htm
- Previous message: [quills-dev] Questions about features
- Next message: [quills-dev] Importing advice
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the quills-dev mailing list