Tag Limit enables you to take html and show only certain tags. for example a <p>... </p>.
Parameters
tag - the tag you wish to show. (default p)
num - the number of tags to show. (default 1)
offset - offset the first result returned by given amount, if the offset os greater than the number of matching tags you will get nothing returned.
class - search for only tags with a certain class.
id - same as class but by id.
show_tags - ‘off’ will return the match without encasing tags, on will return them. (off or on, default is on)
word_limit - limits the word total of the returned data. This can be set to limit on each tag found, should you set ‘num’ to greater than 1, or on the output as a whole, using the below parameter.
limit_style - (each or all, default each)
Example usage
Imagine this is your content (please note duplicate id references are invalid in xhtml)
<p>paragraph 1</p>
<p class="foo">paragraph 1 with class foo</p>
<p id="bar">paragraph 1 with id bar</p>
<p>paragraph 2</p>
<p class="foo">paragraph 2 with class foo</p>
<p id="bar">paragraph 2 with id bar</p>
<p>paragraph 3</p>
<p class="foo">paragraph 3 with class foo</p>
<p id="bar">paragraph 3 with id bar</p>
<p>paragraph 4</p>
<p class="foo">paragraph 4 with class foo</p>
<p id="bar">paragraph 4 with id bar</p>
<p>paragraph 5</p>
<p class="foo">paragraph 5 with class foo</p>
<p id="bar">paragraph 5 with id bar</p>
Using these tag parameters
{exp:tag_limit tag="p" class="foo" num="2" offset="2"}
You will get
<p class="foo">paragraph 3 with class foo</p>
<p class="foo">paragraph 4 with class foo</p>
The word limiter functionality comes from EE’s built in word_limit function, so remains the same issues with leaving tags open as with the official word_limit plugin.
You can use class and id together if you so wish, there is no set order that the two parameters need to be (within the html tag).
Current version: 1.3.1
