I want to control the output of {TAGS_RESULT_ROW_TAGS}
aiwass |
|
---|---|
This became the result: <a href="tags/waifs-and-strays">Waifs And rel="taglink"><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>. 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 |
|
Dit bericht is bewerkt door aiwass (2016-05-10 00:03, 8 jaren ago) |