Forums / Cotonti / Support / I want to control {TAGS_RESULT_ROW_TAGS}

I want to control the output of {TAGS_RESULT_ROW_TAGS}

aiwass
#41667 2016-05-07 17:11

This became the result:

<a href="tags/waifs-and-strays">Waifs And  rel="taglink"&gt;<span itemprops="keywords">Strays</span></a>

after using :

{TAGS_RESULT_ROW_TAGS|preg_replace('>(\w+?)</a>',' rel="taglink"><span itemprops="keywords">$1</span></a>',$this)}

 

Im not a programmer, so I'm not so good at this. Also tags that are 2 words or more will not function

either since the "$1" seems to only pick the last word in a 2 word phrase, as you can see in the above result.

Added 2 days later:

This string of code works, sort off not 100%:

{TAGS_RESULT_ROW_TAGS|preg_replace('>(\w*[a-z-0-9_])</a>',' <a href="tags/$1" rel="tag"><span itemprop="keywords">$1</span',$this)} 

Sine the output looks like this

<a href="tags/tesla"> </a>
<a href="tags/Tesla" rel="tag"><span itemprop="keywords">Tesla</span>
</a>

As you can see it produces the link 2 times, one without the tag in visible text form and one with all the added things but it also makes the tag Uppercase for some unknown reason. The trailing > after </span is deleted becuase it produces an extra > after the </a>.

Either I'm a complete idiot or there is a but in how the output is being made for the {TAGS_RESULT_ROW_TAGS} since its seeminly impossible to control it in order to have the output that one wants. Mainly because someone decided that this is not something that one should control, which was a really bad choice, since one can control all the other things related to Tags.

I desperatly need a solution for this.

Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com
This post was edited by aiwass (2016-05-10 00:03, 7 years ago)