[triangle-zpug] Plone newbie questions

Chris Calloway cbc at unc.edu
Fri Oct 24 18:44:47 CEST 2003

Thanks, Sam.

Yes, the CMF idiom is the same but different. I sent the question about
how long it would take simply because that was the question my managers
were most interested in. Without knowing how they would be accomplished,
I was somewhat at a loss. Managers like to estimate time by function. We
programmers know it has to be estimated from the implementation details
in order to be accurate. Managers want to know how long it's going to
take on the front end before anyone knows how it's going to be done. So
I posted the question, and then went about finding out how to do things,
as that's the order my managers wanted things done in. They actually
requested that I post the questions. All it did was slow me down from
finding the answers myself. :)

Changing the tab behavior in portal_actions accomlished two objectives.
You can see from the following that it is similar to CMF, but different:

For logged in users the portal_tab action is:

action: string:${portal/portal_membership/getHomeUrl}
condition: python: member and portal.portal_membership.getHomeFolder()

For logged out users:

action: string:${portal_url}/login_form
condition: not:member

member is kind of a plone-ish built-in like CMF's user. It's actually
derived from CMF's user. Or rather, they are both derived from the same

Like you, I also followed the register.py and found what I want in
login_success.pt, which is really what the action should be like a for a 
"My Plone" tab. login_success does a TAL interation over results from
portal_catalog according to search criteria and uses BATCH to limit the
display to a usable level. I can just customize login_success in my
custom skin folder, rename it, and point my portal_tab action at it
instead of the user's home page.

But I did figure out after midnight that it was going to take me longer
than just until Monday. :) Plone repurposes ZCATALOG in ways that aren't
documented yet, and I have more digging to do.

But I am using login_success as a template now for something else. So 
digging around alnight wasn't a total loss. Thanks again.


Chris Calloway
CB #3056, 06 Howell Hall, UNC, Chapel Hill, NC 27599
(919) 962-4205

sbrauer1 at nc.rr.com wrote:

> Bear in mind I'm writing this from a CMF point of view, but I bet a lot of this applies to Plone too:
> You can customize the "logged_in" page such that it redirects the user to their homepage.  You can get the url of the user's homepage with this python expression: here.portal_membership.getHomeUrl()
> You can get the actual home folder object with this python expression:
> here.portal_membership.getHomeFolder()
> You can customize the script that the join form calls (I believe "register" is the script) and have it delete the default index_html (use homefolder.manage_delObjects('index_html').  Then have the script create a ZPT with the id index_html that does whatever you want.  For instance:
> homefolder.manage_addProduct['PageTemplates'].manage_addPageTemplate(
>         id='index_html', title='', text="<span tal:replace='structure here/member_homepage'>homepage</span>")
> Then create a ZPT in the skin called member_homepage that does the various catalog queries and lays out a member homepage.  
> Hope this helps!
> - Sam
> ----- Original Message -----
> From: Chris Calloway <cbc at unc.edu>
> Date: Thursday, October 23, 2003 7:34 pm
> Subject: [triangle-zpug] Plone newbie questions
>>I'm sending this here because it is simply not showing up on 
>>plone-users. Plus, I actually solved a couple of problems since 
>>to post to plone-users. And my manager thinks some of you NCSU 
>>are going to have the answers.
>>I have the kind of questions that deserve an RTFM response. It's that
>>I'm a plone development newbie, new on the job, thrown off the deep 
>>end,and I have a do or die deadline Monday. And I am furiously RingTFM
>>and looking at examples. Assume I know enough Python, some Zope, and
>>teensy amount of CMF (enough to know how steep the curve is). I've 
>>builtunsophisticated non-CMF Zope sites. I've read Zope Book (made the
>>mistake of reading the print version), Zope Bible, and Plone book. I'm
>>now reading the ZWACK. The instance is Plone 1.04, CMF 1.3.1, Zope 
>>2.6.1, Redhat 9 (current RPM that is, I think).
>>1) How do I change the default login behavior to go to a user's home
>>page upon login?
>>2) Joining creates an index_html in the user's member folder. The
>>default is that this index_html is a document. How do I control 
>>what is
>>generated into that initial index_html? The reason will be apparent in
>>the next question.
>>3) This index_html on the user's home page should be pre-machined to
>>show customized content in this manner:
>>a) /myportal/portal_properties/site_properties has had the addition 
>>of a
>>lines property called "available_interests." Done.
>>b) /myportal/portal_memberdata has had the addition of a string 
>>propertycalled "interests". Done.
>>c) A personalize_form added to /myportal/portal_skins/custom allows 
>>theuser to select multiple available_interests and save them as the 
>>user'sinterests. Done.
>>d) Each item (documents, images, events, etc.) which has been added to
>>the portal has been tagged with keywords in the metadata by content
>>developers. Notice there are now two things here: a user's 
>>interests and
>>an item's keywords. Done.
>>e) The list of available_interests exactly matches the list of 
>>existingkeywords. Done. (This was done this way because later on 
>>there needs to
>>be a facility for many to many relationships between interests and
>>keywords, a method for content developers to create those 
>>relationships,and a method for persist those relationships. But 
>>that's for later when
>>things are hopefully more sane after deadline.)
>>f) Now assuming that there are these keyword/interest relationships,
>>which for today is simply string equivalence, this index_html which is
>>automagically generated in each user's folder upon joining should:
>>i) Grab the user's interests,
>>ii) Find all the items in the portal with keywords corresponding
>>(equivalent) to the user's interests,
>>iii) Display links in a folderish fashion (similar to content view) to
>>all those items found in the interest/keyword search as the user's
>>automatically generated index_html. That is, push content in which the
>>user is interested onto the user's home page.
>>iv) Note this is not the same as Favorites. Favorites are chosen and
>>maintained by the user on an item by item basis. The pushed content is
>>chosen for the user by an automated collaboration of the user's chosen
>>interests and the content developer's chosen keywords for an item.
>>v) FYI, the objective for a later version of this is to limit the push
>>on the user's home page to only certain content types, to have a 
>>defaultbehavior for each of those content types to display on the 
>>user's home
>>page in some manner other than just a link, and to have the display of
>>content types visually segregated on the user's home page by 
>>content type.
>>4) If I'm totally full of it to think that I can get up the speed to
>>have this done by Monday, please let me know. The first thing the I 
>>needto know is if this is possible to accomplish in the now to 
>>Monday time
>>frame before I do much more hunting. Assume I'm working all 
>>This kind of stuff is a piece of cake in a straight up Zope site. 
>>But in 
>>the Plone idiom I'm still lost.
>>BTW, I enjoyed our meeting again last night. If you've read this 
>>I'll reward you by remebering one thing I forgot to point out last 
>>night. That is: if you want to play with Plone without installing 
>>you can go get yourself some free as in beer Plone hosting here:
>>Not only can you get yourself some free hosting, but it comes with 
>>own subdomain. Objectis is a French company.

More information about the triangle-zpug mailing list