#593: Output collection in body classes for collection based css styling
--------------------------+----------------------
  Reporter:  tbrooks      |      Owner:  tbrooks
      Type:  enhancement  |     Status:  in_merge
  Priority:  minor        |  Milestone:
 Component:  WebSearch    |    Version:
Resolution:               |   Keywords:  INSPIRE
--------------------------+----------------------

Comment (by jcaffaro):

 Note that you might want to wash the collection name prior to using it as
 a CSS class name, to ensure that it contains only allowed characters in
 this context. Most obvious case being the "space" character, but other
 more tricky constraints regarding valid class names do exist.
 You can have a look at [http://invenio-
 software.org/repo/invenio/tree/modules/miscutil/lib/htmlutils.py#n46
 htmlutils.nmtoken_from_string(..)] which does something similar to clean
 value for the "{{{name}}}" attribute of HTML tags.
 The parameter "{{{body_css_classes}}}" of function "{{{tmpl_page(..)}}}"
 would have gained to be more explicit regarding the fact that input
 classes must already be properly constructed...

 Otherwise please add at least some comment to ensure that this piece of
 code does not get generalized in the future (i.e. removing "{{{if
 CFG_INSPIRE_SITE}}}") without proper washing, as collection names can in
 general contain some characters not suitable for CSS class names (even if
 that would maybe not be the case with Inspire).

-- 
Ticket URL: <https://invenio-software.org/ticket/593#comment:2>
Invenio <http://invenio-software.org>

Reply via email to