Templating
Please be aware that this functionality only works while the lazy loading setting is active.
You can use DXP ToolKit in your html templates with the aid of html data attributes. The following data attributes are available, as seen in the example below:
data-condition
- One or more persona rule IDs (these are post ids)data-conditionvisibility
- If the content should be shown or hidden when persona rules apply. Yes or 1 will show the content, anything else will hide the content.data-conditionmatch
- How should the persona rules be parsed. Any will trigger the content on any persona rule trigger, all will trigger the content only if all persona rules are triggered.
Additionally, the personalized element must have a class of dxptk-has-condition
and be hidden by default (ie: have a display value of none) in order for it to be recognized by DXP ToolKit.
Example
<div class="dxptk-has-condition" data-condition="1,2,3" data-conditionvisibility="0" data-conditionmatch="any">
This is a piece of personalized content that has the persona rules 1,2,3 (post ids) attached to it and will be hidden if any persona rule is triggered.
</div>
<p class="dxptk-has-condition" data-condition="4,5" data-conditionvisibility="yes" data-conditionmatch="all">
This is a piece of personalized content that has the persona rules 4 and 5 (post ids) attached to it and will be shown if all persona rules are triggered.
</p>