Hello,
I’ve created a weblink that has a URL with a TV such as: [(base_url)][*GetFileName*].
The TV GetfileName return for instance: "assets/files/test.pdf" however the weblink doesn’t get updated. I’ve read in the forum that Weblink and TV works for 9.6.3. Am I missing something?
Thank you.
What do you have in the Weblink Field?
AFAIK TV’s don’t have a purpose for weblinks documents.
I only use Weblinks with TVs when I need to build for example a custom search for weblinks documents
Hi Cipa,
In the Weblink field I sinply have the TV [*GetFileName*] and I was hoping to get the file path but it doesn’t work. I need it to allow the client to change his own path file name.
Thanks
-
☆ A M B ☆
- 24,524 Posts
One use for TVs in weblinks would be for additonal fields used in Ditto listings, for custom filtering.
If the weblink is supposed to link to a file or an image, it might be useful to use a TV in the URL field, and have the TV for that document be a "file" or "image" input type, so the editor can simply use the resource browser to upload or locate an existing file to link to. I’m not sure if TVs are processed for weblinks, though, so that may not work. I need to go dig through the parser again to check that out.
Yes sottwell, that’s exactly what I’m doing but unfortunately TVs don’t seem to be processed for weblinks...
Thanks dev_cw,
Could you please elaborate on how I should use TVs and snippet to simulate weblink behavior?
Thanks
Snippets have access to any of the template variables of the current page using $modx->getTemplateVar()
http://wiki.modxcms.com/index.php/API:getTemplateVar
Of course, you might have to write your own snippet or modify an existing one if it doesn’t have this built in.