Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-543

All Sub-menu Items appear as "current" when expanded Site Menu is printed

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.3-B2
    • Fix Version/s: 5.1.2-B1
    • Component/s: Front End
    • Labels:
      None
    • Additional information:
      Hide

      Changes to be made in customized themes:

      BEFORE:
      <inp2:m_Link template='$template'/>
      <inp2:st_CachedMenu render_as="sub_menu_element"/>

      AFTER:
      <inp2:m_Link template='$template' m_cat_id='$cat_id' use_section='$use_section' m_cat_page='1'/>
      <inp2:st_CachedMenu render_as="sub_menu_element" category_id="$cat_id"/>

      Show
      Changes to be made in customized themes: BEFORE: <inp2:m_Link template='$template'/> <inp2:st_CachedMenu render_as="sub_menu_element"/> AFTER: <inp2:m_Link template='$template' m_cat_id='$cat_id' use_section='$use_section' m_cat_page='1'/> <inp2:st_CachedMenu render_as="sub_menu_element" category_id="$cat_id"/>
    • Change Log Message:
      Fixes issue with highlighting active sub-menu
    • External issue ID:
      687
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      All sub-menu items appear as current, when you are printing expanded site
      menu version.

      • menu1
      • menu11
      • menu12
      • menu13
      • menu2
      • menu21
      • menu22
      • menu23

      For example when you want print menu mentioned above and highlight current
      page in it, then you should compare this using given tag:
      *<inp2:m_if check="m_Get" name="m_cat_id"
      equals_to="$cat_id">highlighted</inp2:m_if>* .

      Mentioned above tag will always display "highlighted" because of "m_cat_id"
      request variable, which is compare here is always overwritten from
      *<inp2:st_CachedMenu
      .../>* tag. It was done long ago to automatically pass category into menu
      item links and for this tag to work: <inp2:m_Link template="$template"/>.

      Proper way to build links to menu items is by directly passing category id
      to them like this <inp2:m_Link template="$template" m_cat_id="$cat_id"/>.

      As a fix I propose to remove code, that sets m_cat_id from st_CachedMenu tag
      and patch all our themes (if needed). For users who have customized their
      themes or created new onces I propose to write note about required change in
      theme templates in "ChangeLogMessage" field in task, that would be created
      based on this discussion.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                dmitry Dmitry Andrejev [Intechnic]
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: