[Zope-CMF] Skins

Karl Anderson karl@digicool.com
21 Jun 2001 09:51:32 -0700


James van der Veen <james@codenamefuture.nl> writes:

> HI all,
> 
> I have a (I think)simple skins question.
> 
> I have added a Folder to the CMFDefault/skins dir. called school. I added
> some docs I want to add to the custom skin every time I make a portal.
> Well All is fine till now .. I restart zope create a new portal and my skin
> is in the skins folder. And here comes the BUT...
> The Docs are still protected (like the generic and contents etc folders). I
> would like the docs in my school folder to be unlocked sothe portal mangers
> can change them in the same school dir.
> 
> Can someone tell me how to do this?

I'm not sure what you're asking, but I'm creating CMF sites with
custom skins pre-added with the method below.  Basically, create the
skin views, which are DTML Methods, create a skin folder for them, put the
skin views in the skin folder, create a default skin which is the
Basic skin with this skin folder prepended.

If you just want the skins views to be put in Custom, you don't need
to mess with the new folder or creating a new skin - just create the
skin views and stick them in Custom.
        
    def _customizeSkins(self, portal):
        "copy our custom skins to the new CMF site"
        # we need to create these methods here, not in the module,
        # else we get a foreign db connection exception
        logged_in = DTMLMethod(logged_inStr, __name__ = "logged_in")
        login_form = DTMLMethod(login_formStr, __name__ = "login_form")
        first_logged_in = DTMLMethod(first_logged_inStr,
                                     __name__ = "first_logged_in")

        ps = getToolByName(portal, "portal_skins")
        ps.manage_addProduct['OFSP'].manage_addFolder(id='tour')
        basicSel = ps._getSelections()['Basic']
        tourSel = 'tour, ' + basicSel
        ps.addSkinSelection('Tour', tourSel, make_default = 1)

        skinFolder = getattr(ps, 'tour')
        skinFolder._setObject('login_form', login_form)
        skinFolder._setObject('logged_in', logged_in)
        skinFolder._setObject('first_logged_in', first_logged_in)


-- 
Karl Anderson                          karl@digicool.com