Hi
I want to create a custom TV that is like a URL but instead just displaying it on the page, a bit of processing is done on the url before dislaying. Is this possible?
-
☆ A M B ☆
- 3,141 Posts
Put something like this in the template?
<a href="[+linktv+]">[+linktvtext+]</a>
There is a custom TV plugin also (haven’t used it myself yet though):
http://modxcms.com/forums/index.php/topic,49153.html
-
☆ A M B ☆
- 3,141 Posts
Quote from: thiswayup at Jun 30, 2010, 05:53 PM
that would just display it?
Yeah.
I was thinking of embedding the TV into a snippet like :
[!processUrl?&url=`urlTv`!]
You can do that.
You should be able to use the API to get to the value of the TV on a specific resource from within your snippet:
http://wiki.modxcms.com/index.php/API:getTemplateVar
But I wondered could I achieve the same result of creating a custom TV and doing some kind of preprocessing specific to that TV before rendering the page.
Now that I understand what you want to do, it’ll probably be easier to just use a snippet to parse the tv. :p
Quote from: thiswayup at Jun 30, 2010, 05:53 PM
that would just display it?
I was thinking of embedding the TV into a snippet like :
[!processUrl?&url=`urlTv`!]
But I wondered could I achieve the same result of creating a custom TV and doing some kind of preprocessing specific to that TV before rendering the page.
You could definitely do it that way, but this way the snippet doesn’t have to make the API call because it receives the processed content of the TV as a string:
[!processUrl?&url=`[*urlTv*]`!]