Files
components-wrapper/README.md
2025-08-18 14:36:34 +02:00

39 lines
1.2 KiB
Markdown

# Components Wrapper #
Use this approach when you need to start a wrapper element in one component, and close it in another one.
### How to use ###
1. Copy and paste example code from first-component.xslt
```
<iaixsl:if test="count(commercial_banner/link) > 0 and count(commercial_button2/link) > 0">
<iaixsl:text disable-output-escaping="yes">&lt;div id="commercial_section_wrapper" iai:class="mb-4|commercial_section_bottom_space" &gt;
</iaixsl:text>
</iaixsl:if>
```
2. Rewrite condition, and data inside
3. Do the same with second "closing" component
```
<iaixsl:if test="count(commercial_banner/link) > 0 and count(commercial_button2/link)">
<iaixsl:text disable-output-escaping="yes">&lt;/div&gt;</iaixsl:text>
</iaixsl:if>
```
The example was given with buttons2 zone, but you can use this approach with any task that you have.
When we do such a thing, please write at the end of the component name like this:
1. Główne skrypty strefy banerowej - #IdoMods **<commercial_section_wrapper>**
2. Buttony strefy 2 - #IdoMods **<commercial_section_wrapper>**
Which will mean start and end of the tag.
---
Created by • **[IdoMods](https://idomods.pl/)** • 2025