GetSectionFromURL.py now depreciates in Plone 4

I read from Weblion Sprint 10/2011 that:

"However, themed folders below root turned out to be somewhat problematic, as getSectionFromURL.py is now depreciating in Plone 4."

source: https://weblion.tlt.psu.edu/FogBugz/default.asp?pg=pgWikiDiff&ixWikiPage=944&nRevision1=1

I used this all the time in Plone 3. Does anyone know of an โ€œeasyโ€ method for targeting subfolders in Plone 4?

+4
source share
3 answers

The folder identifier is still set in the section body class, it no longer uses the getSectionFromURL method for this, it uses:

plone_view.bodyClass(template, view) 

and get plone_view

 plone_view context/@@plone 
+1
source

with the default sunburst theme, you only get body.section-chinese (for the top folder slot / chinese / calendar) and, in addition, some other classes on the body tag:

  • presentation document template (for the currently used template or presentation)
  • portaltype-document (for the content type of the current context)

If this is not enough to properly configure the calendar, you need to either

a) enter your own view @@ plone (for your skin layer), which adds the functions that you previously used in the getSectionFromURL method, or

b) still use the old getSectionFromURL script and adapt main_template accordingly

0
source

What you can do is configure getSectionFromURL according to http://www.uwosh.edu/ploneprojects/docs/how-tos/how-to-make-plone-generate-.section-css-classes

Configure 'getSectionFromURL' (from plone_scripts)

Edit the last line:

  return "section-" + contentPath[0] 

in

  return " ".join(["section-" + "-".join(contentPath[:d+1]) for d in range(len(contentPath))]) 

Then configure your main_template by changing the line

  body_class python:plone_view.bodyClass(template, view); 

to

  body_class here/getSectionFromURL; 
0
source

Source: https://habr.com/ru/post/1385570/


All Articles