Querystrings and Widget Properties - Querystrings and Widget Properties - Community forums - Akumina Community

Community forums

Forum Navigation
Please or Register to create posts and topics.

Querystrings and Widget Properties

Is it possible to pass a query string value to a widget property? For example, I have a text or number field in the widget properties and I want to pass the ID value from the current URL's query string into that property value.

Jermaine, you do have a few options -

 

At runtime

If it is a custom widget, then you can set the properties in the setdefaultsproperties function - you cna fectht the current URL. If it is not a custom widget, then your options are more limited, but if you just need it to be in the marku you can use a handlebars helper to output to the view, look for "registerHelper" here: https://handlebarsjs.com/guide/expressions.html#helpers

At widget package time - package up using a token that is replaced:

https://github.com/akumina/AkuminaDev/wiki/Akumina-Widget-Builder:-Token-replacement-for-widget-properties

//]]>