Page MenuHomeIn-Portal Phabricator

INP-1157 - Support for user-defined fields in "st_CachedMenu" tag
ClosedPublic

Authored by alex on Feb 16 2016, 9:39 AM.

Details

Test Plan
  • Front-End:
    1. create template using this contents: {P5}
  • Admin Console:
    1. go to ConfigurationWebsiteThemes section
    2. press Rescan Themes button
  • Front-End:
    1. open created template in web browser by going to http://www.website.tld/path/to/template.html url
    2. confirm, that detailed information about top level menu entries is displayed
    3. remember available key names for each displayed menu item
  • PhpStorm:
    1. create /modules/custom/units/sections/helpers/e_menu_helper.php file
    2. in that file create EMenuHelper class, that would extend MenuHelper class
    3. override class constructor and before calling parent class constructor add following entries to $this->itemParams array:
      • key: extra1; value: array('Filename')
      • key: extra2; value: array('Status', null)
      • key: extra3; value: array('CreatedOn', 'Y-m-d')
      • key: extra4; value: array('CreatedOn')
    4. open /modules/custom/units/sections/sections_config.php file
    5. add array('pseudo' => 'MenuHelper', 'class' => 'EMenuHelper'), line to the array in $config['RegisterClasses'] key
  • in CLI:
    1. run the in-portal classmap:rebuild command
  • Admin Console:
    1. go to ToolsSystem Tools section
    2. click on Reset button in the Config Files sub-section
  • Front-End:
    1. reload page
    2. confirm, that following additional keys are now present in data displayed for each menu item: extra1, extra2, extra3, extra4
    3. confirm, that value in extra1 keys represent value of Filename field as-is (no formatter applied)
    4. confirm, that value in extra2 keys represent value of Status field with formatter applied
    5. confirm, that value in extra3 keys represent value of CreatedOn field with formatter applied (custom date format)
    6. confirm, that value in extra4 keys represent value of CreatedOn field as-is (no formatter applied)

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex updated this revision to Diff 482.Feb 16 2016, 9:39 AM
alex retitled this revision from to INP-1157 - MenuHelper improvements.
alex updated this object.
alex edited the test plan for this revision. (Show Details)
alex added 1 JIRA issue(s): INP-1157.
alex edited reviewers, added: erik; removed: glebs.Feb 16 2016, 9:39 AM
alex edited the test plan for this revision. (Show Details)Feb 16 2016, 10:24 AM
erik accepted this revision.Feb 16 2016, 10:29 AM
erik edited edge metadata.
This revision is now accepted and ready to land.Feb 16 2016, 10:29 AM
alex edited the test plan for this revision. (Show Details)Feb 16 2016, 11:10 AM
alex edited edge metadata.
alex added a project: Restricted Project.Mar 10 2016, 5:14 AM
alex retitled this revision from INP-1157 - MenuHelper improvements to INP-1157 - Support for user-defined fields in "st_CachedMenu" tag.Jul 15 2016, 2:41 PM
alex planned changes to this revision.Jul 25 2016, 4:05 AM

The changes to all but menu_helper.php file needs to be removed, because it's a debug code.

alex updated this revision to Diff 585.Jul 25 2016, 4:09 AM

Removed non-related debugging code changes.

This revision is now accepted and ready to land.Jul 25 2016, 4:09 AM
This revision was automatically updated to reflect the committed changes.