Our Blog > Blog Detail

Web Content Viewer- Asponte Custom Skin

Actions

WCM Quick Hits: Setting Menu Parameter using Plugin Tag

  • Created By: Chris Knight
  • Updated: June 10, 2016
  • Tags: developer, plugin, wcm, menu, quickhits

Introduction

One of the use cases for WCM menu components is the ability to pass parameters to the menu.  Normally this is accomplished using query parameters on the URL, or adding to the parameter map of a WCM Rendering Context within a menu.

 

An example of that approach can be seen here:

https://developer.ibm.com/answers/questions/249309/sending-multiple-values-to-menu-component-from-jsp.html

 

An Additional Approach

In WCM version 8.5, the request attribute plugin has been provided:

https://www.ibm.com/support/knowledgecenter/SSHRKX_8.5.0/help/panel_help/plrf_rendr_plugin_request_attrbt.html

This can be used to set a request attribute right from within your design elements, which means you can use logic to build different menu results without manipulating or passing URL parameters.

 

So, if you have a menu named TestMenu that is looking for a query parameter name menuCategory looking for categories to be passed, you would put this into your presentation code:

[Plugin:RequestAttribute key="menuCategory" mode="set" value="LibraryName/Category"]

[Component name="TestMenu"]

The end result is that the menu would be presented, and the menuCategory would be used in the menu to retrieve content with the relevant category.

Contact Form- Asponte Custom Skin

Actions

Contact Us

*
*


Submit
Call Us 888-926-9434
Complementary Content
${loading}