On this page block and anchors in the WMS


OVERVIEW

Target audience: Site Administrators, Site Managers

The On This Page block in the Web Management System (WMS) automatically creates a set of links to anchors that have been defined within a page. In 'smart mode', it creates links to any h2 or h3 headings on the page.

An example of an On This Page block

Note: The On This Page block will appear in the same region, with the same settings, for all pages on which it is configured to display. The block can be positioned in any of the block regions (i.e. right Sidebar, Top of page, Top of content, Bottom of page, Bottom of content) but is typically placed in the Top of content region.

In this article:

Configure the On This Page block

  1. From the administrative toolbar, click Structure > Blocks

    If the On This Page block has not yet been assigned to any page region, it will be found towards the bottom of the list of blocks, in the Disabled section of the page. Otherwise, locate it within one of the other block regions (usually Top of Content).

    Blocks window

  2. Click Configure to bring up the block settings.
  3. Under Enable smart mode? select Yes if the block should automatically detect content headings and use the heading text for each link in the block.

    enable smart mode

    note

    Note:

    • If 'smart mode' is not being used, it will be necessary to set up anchors within the page (see Create defined anchors if not using 'smart mode', below). The anchors can be set up or changed at any time and the block will automatically refresh itself with the new information.
    • An alternate way to reach the configuration screen when the On This Page block is enabled
      • Navigate to any page that contains the block and click the gear icon in the top right corner to access the Configure settings.

    The On This Page configuration screen

  4. Under Visibility settings, choose the Pages on which to display the block.
    note

    Note about pages:

    If the block should not appear on certain pages, make sure to adjust the Pages settings appropriately.

  5. Click Save block to return to the Blocks page.
  6. If the block is still Disabled, choose the region where it should appear, usually Top of content.
  7. Click Save blocks at the bottom of the page and verify the results on the pages where the block is set to display.

    On this page results

    If there are any links at the top of the page should not be there, go to the HTML code view of the page and remove any extraneous anchors from the page.

    If the On This Page block is set to display on any pages that previously contained hyperlinks at the top, remember to remove any custom-made hyperlinks.


Create defined anchors if not using 'smart mode'

  1. Once logged in, navigate to the page where anchors need to be added and click on the New Draft tab.
  2. Set up anchors next to the headings within the page(s) either using HTML code tags, e.g.,:
    <h3><a name="my_heading"></a>My Heading</h3>

    or by using the WYSIWYG anchor tool:

    Blocks window

    Note: The name of the anchor cannot contain any spaces (e.g., "my_heading"). Also, using the HTML code tags instead of the WYSIWYG anchor tool will allow for the code to be placed more precisely on the page.

  3. Click Save at the bottom of the page and Publish the page.

If there are any links in the block that should not be there, go back to the HTML code view of the page and remove any extraneous <a name="old_anchor"></a> anchors from the page. 

note

NOTE:

If ‘smart mode’ is enabled, and anchors have also been configured on the page:

  • The Anchor name will not display (the block will only show the Heading text) if the anchor is inside the <h2> or <h3> tags
  • e.g., <h2>Botany<a id="Plants" name="Plants"></a></h2> 
  • The Anchor name will display (in addition to the Headings) if the anchor has been set up outside of the h2 or h3 tags e.g., <h2>Entomology</h2><p><a id="Insects" name="Insects"></a></p>


references

ADDITIONAL REFERENCES: