Working with multiple bbcode tags in one post.

Cezz

Well-known member
Hey hoping someone can help with this,

I am trying to change the bbcode shown if there is more than 1 instance of the code in the same post...

For example, say I wanted to display one template the first time the bbcode is used but want to show a different template for each consecutive use of it... Or if you wanted to show one template if the bbcode is used between 1-5 times but if they use more than 5 you use a different template (maybe a smaller block)

Is there any way of doing this?

What I want in short is to be able to #1 check how many times a bbcode block is used in a post and #2 know which block we are currently processing either at plugin level or template...

Really appreciate help with this!
 
Thank you this is sort of what I want as it gives me the current count that I can then pass to the template, but any idea how I can the total count?

For example I want the first block that gets processed that there is 20 so it is 1/20... I can't see a way of doing that just using static variable... I guess I would need to count though them all before I render the tag, but I not sure if this would be possible... I do thank you for your help so far though this is amazing...
 
Top Bottom