Back to index

plone3  3.1.7
getSectionFromURL.py
Go to the documentation of this file.
00001 ## Script (Python) "getSection"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=
00008 ##title=Returns section name (first part of URL) to the body tag
00009 ##
00010 contentPath = context.portal_url.getRelativeContentPath(context)
00011 if not contentPath:
00012     return ''
00013 else:
00014     return "section-" + contentPath[0]