Location Based Substitutions

Substitutions have been upgraded further with being able to refine where content is rendered based off location. Specifically based off URL. Check out the details below!

First up is a new operator has been added to the IF substitutions. They are as follows.

contains

!contains

These operators allow checking if a string contains another string. So it's very useful for doing partial matches! Some example as follows.

[cb:if url contains "&listid=123"]The URL I am on has listid of 123 in it.[/cb:if]

[cb:if url !contains "&listid=123"]The URL I am on DOES NOT have listid of 123 in it.[/cb:if]

The above also showcases 2 new internal IF substitution fields. "url" and "menu_id" (or "itemid"). "url" will always be the current URL you are viewing when the substitution is processed. This allows you to check against the current URL and have content display based off that. "menu_id" (or "itemid") will always check against the current active menu items id allowing menu specific content rendering!

In addition to this the location substitution now has a "current" value for rendering the currently viewed URL. Its usage is as follows.

Our substitution documentation below has been updated with these new usages as well.

https://www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

Facebook Twitter LinkedIn