Search
Other Snippets questions
Forum

<div class="aaa bbb ccc">xxx</div>

Jonathan Asbell's Avatar Jonathan Asbell
Consider <div class="aaa bbb ccc">xxx</div>
How do I create a snippet that can pass "aaa" "bbb" and "ccc" and I can wrap around "xxx" so that its like this:
[%snippet mysnippet class="aaa bbb ccc"]xxx[%/snippet mysnippet]
Peter van Westen's Avatar Peter van Westen ADMIN
You can't. Snippets doesn't have wrapping tags.

You could make your own custom wrapping tag (with whatever syntax you want) with ReReplacer.
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
Can I make a feature request for it?
Peter van Westen's Avatar Peter van Westen ADMIN
You can make the request, but I won't implement it.
This is outside the scope of Snippets.

Use ReReplacer for what you want.

Or just use something like this:
[snippet alias="mysnippet" content="xxx" class="aaa bbb ccc"]
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
The problem is that when the content has a lot of HTML it doesnt work well. The reason I am doing it this way is because I want to templatize the layout/presentation of a part to keep it consistent across the website. That would allow me to do that. Why is that outide the scope?
Peter van Westen's Avatar Peter van Westen ADMIN
What you are asking can be done with ReReplacer.
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
Yes but I risk screwing some things up in a big way if I make a mistake, or if there is a difference of even a space
Jonathan Asbell's Avatar Jonathan Asbell
This is what I am trying to template that would go within a gallery item


<button class="uk-button uk-width-expand " type="button" uk-toggle="cls: uk-hidden;target: #toggle-selections;mode: click;" style="line-height: 1.2;padding:5px 20px 5px 20px;">Details</button>

<div id="toggle-selections" class="uk-hidden uk-card uk-card-small"><br>
<div style="border-style:dotted;padding:5px 5px 5px 5px;" class="uk-text-left uk-section">
CONTENT HERE
</div></div>
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, you can do that with ReReplacer Pro, using some Regular Expressions.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription