Subnav Simple (Version 1) - Shortcodes

This feature will allow users to create a subnav using a shortcode. This is recommend in comparison to creating a text blocks links because the menu can be update once and will automatically apply to all pages use the feature under the same parent page.

By default, the shortcode is as seen below. You must use the same spelling and the shortcode is case sensitive.

[UTH_subnav]

Create/Update a Menu

To create this subnav, all pages must be properly nested under 1 parent.

1. To change the nesting of a page, click the Edit Page button in the top black admin toolbar.

2. Scroll down to the page attributes

3. Find the proper parent page and save changes.

All pages that have a parent will be indented under the parent. To display the menu on pages, please see the "Implementation / Example of shortcode usage (With Screenshots)" section of this help guide.

Shortcode attributes

These are features that can be used to customize the feature.

  • level - Sets the level of the page that the subnav will be used on
    • Options (Must be one of the following)
      • Child
      • Parent
    • Default: Child - the level will only need to be overwritten on the parent page (home) of the subsite
  • post_type - Specify the post type that the feature is being used on
    • Options:
      • Any valid post type slug
    • Default: 'page'

Implementation / Example of shortcode usage (With Screenshots)

Example URL: https://stahec.uthscsa.edu/centers/mid-rio-grande-border-ahec/ 

1. Parent Page (Home)

 

In the screenshot above, the Mid Rio Grande AHEC page is set to:

[UTH_subnav level="parent"]

The parent tag means the menu will auto-generate by gathering all child pages that are 1 level below this page. This level="parent" will also place the parent at the top of the menu and will add the (Home) text to the menu name.

2. Child Pages

 

In the screenshot above, the Health Careers Information page is set to;

[UTH_subnav]

Because no shortcode attributes are set, it will automatically go to the defaults of level="child" and post_type="page" to grab all sibling pages.

Design Options

This shortcode can be used in any text block. All text blocks can have an optional class added to it for design options, such as "panel" or "panel outline".

It is recommended to use this subnav in the right-hand side of the page and limit the menu width to 1/3 the width of the page.

 

Limitations

Known current limitations would include (but not limited to)

  • The subnav only goes 1 level deep (no dropdowns)
  • The menu will generate based on page titles and only changing the page title can update the menu name
  • Items will generate based on the page relationships and pages that are not related cannot be added to the same subnav.
  • Pages that are published cannot be hidden from the subnav if they meet the relationship and nesting requirements of the shortcode.
  • The active menu item will turn black but we currently don't have a way of breaking it as a link. (Link will still be clickable in the menu if it is active)

Details

Article ID: 91755
Created
Mon 12/23/19 1:05 PM
Modified
Thu 6/4/20 4:35 PM