Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Each template in the theme can have optional meta HTML comment, that is used to configure a category, that is created to match that template in the "Structure & Data" section. The typical comment looks like this:

<!--##
<NAME>Name of the page</NAME>
<DESC>Description of the page</DESC>
<SECTION>Top Category||Sub Category||Sub Sub Category</SECTION>
##-->

While using meta comment during project development the following was always missing:

  1. ability to specify if created section would be visible in menu or not (currently by default section created based on template would be hidden in menu)
  2. ability to specify section order in menu (currently new section will always be added to the end)
  3. ability to specify url fragment for that section (currently it's auto-generated based on section name in the <NAME> node)

Solution

  1. add the "CategoriesEventHandler::ensureCorrectPriority($priority, $parent_category_id)" method that will:
    1. if given value is positive multiply by "-1"
    2. call "CategoriesEventHandler::_getNextPriority" method to get minimal allowed priority
    3. if number given priority is smaller, than minimal allowed, then use minimal allowed one
    4. return priority
  2. add "IN_MENU" node of "boolean" type
  3. add "ORDER" node of "integer" type
  4. add "FILENAME" node of "string" type
  5. in theĀ "CategoriesEventHandler::_prepareAutoPage" method:
    1. when "IN_MENU" is true, then set "IsMenu" field to "1"
    2. when "ORDER" is specified, then call "CategoriesEventHandler::ensureCorrectPriority" method to get actual priority value instead of calling "CategoriesEventHandler::_getNextPriority")
    3. when "FILENAME" is specified, then set "AutoFilename" to "0" and put specified value into "Filename" field

Related Discussions

Related Tasks

  • No labels