You are not logged in.
Pages: 1
There is a way to parse with custom php function an article before show on frontend without modify the code saved into database?
I’m serching a way to transform url into hyperurl and youtube url into embed video like a classical forum function,
or a way to transform smily code into image.
Any ideas?
Offline
Maybe smd_macro can help you.
With it you can build your own txp functions like “<txp:video id=“youtube-video-url”/>, in some way it is like using txp:output_form in articles but more simplex and powerfull.
<txp:rocks/>
Offline
For simple replacements (smileys, and so on), an7_filter works well. For more elaborated ones, you could try etc_query, though it may be tricky:
<txp:etc_query data='<txp:body />' replace="//a[contains(@href,'youtube')]@@src={[@]href}@href@#=iframe" />
will work for embedded videos, like in <a href="http://www.youtube-nocookie.com/embed/oNvb2SjVjjI?html5=1">AdBlock Plus</a>, if you put it instead of <txp:body /> in article form.
Last edited by etc (2012-07-06 09:30:22)
Online
Pages: 1