[Product-Developers] Best way to generate custom frontpage

Nathan Van Gheem vangheem at gmail.com
Tue Jan 27 21:13:50 UTC 2009


>
> * Why do I need to add the BrowserView class to Plone_Site.xml to make this
> work?  Should I define my BrowserView as a browser:view for this?  It seems
> like
> folder.xml has view_methods also.  Is it possible to develop a
> MyFrontPage.xml
> file with the desired FTI information in it (that would be cool, then it
> would
> be isolated?)

You don't add the BrowserView class, you would add the name you registered
the browser:page with.  You don't need to add to the xml config anyways.
You can just go into the running site, append "/manage" onto the page you
want to change the view of, add a property of "layout" with the value of the
registered view you just created and you should be good to go....

*  More importantly, is this the best way to implement this?  It seems like
> I
> can do something like this with a viewlet.
>
Nah, viewlet is the wrong way to do this.  If you just want to change the
way one page looks, you're on the right track.

* Finally, what is the best scope for MyFrontPage?  Currently I have use
> ``for="*"`` but is it preferable to use something like
> Products.CMFCore.interfaces.
>>
>> ISiteRoot?  BTW, if that sounds like a dumb
>> question, I understand I need to look more at what this clause does.
>
> Products.CMFCore.interfaces.ISiteRoot is probably better, but probably
doesn't matter in your case.

Hope that helps...

-Nathan


On Tue, Jan 27, 2009 at 11:14 AM, Dave Turvene <dave at dahetral.com> wrote:

> For years, I have been using a fairly complex ZPT to generate a custom
> frontpage
> hitting the catalog and formatting recent news, recent blog entries, a
> prose
> area from an ATDocument Cookedbody(), etc.  Over time, the ZPT has become
> too
> complex.  Spurred on by the way-cool Professional Plone Development book, I
> started working on moving my sites to Plone3-ish concepts.
>
> I tried creating a BrowserView
> subclass and stick all the gnarly stuff into it and defining it as a
> browser:page in configure.zcml.  That works great when I do
> ``site/myfrontpage``
> or ``site/@@myfrontpage``, and is MUCH easier than my old nested
> tal:define/tal:repeat/tal:define oddness.  But when I try to set the
> ``default_page`` property to it, I get what looks like a reference to the
> class
> instance itself, not a rendering.  After hacking around some, I ended up
> using a
> mypolicy/profiles/default/types/Plone_Site.xml file with an additional
> view_method value for my browser view.
>
> My questions:
>
> * Why do I need to add the BrowserView class to Plone_Site.xml to make this
> work?  Should I define my BrowserView as a browser:view for this?  It seems
> like
> folder.xml has view_methods also.  Is it possible to develop a
> MyFrontPage.xml
> file with the desired FTI information in it (that would be cool, then it
> would
> be isolated?)
>
> *  More importantly, is this the best way to implement this?  It seems like
> I
> can do something like this with a viewlet.
>
> * Finally, what is the best scope for MyFrontPage?  Currently I have use
> ``for="*"`` but is it preferable to use something like
> Products.CMFCore.interfaces.ISiteRoot?  BTW, if that sounds like a dumb
> question, I understand I need to look more at what this clause does.
>
> I apologize for the long question(s) but this, I believe, can be a valuable
> recipe if done correctly.
>
> Dave
>
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20090127/1db7da99/attachment.html>


More information about the Product-Developers mailing list