Short Question: Is there a way to dynamically insert the site's url in views as part of the setting for a field's "link path:"?
I'd like to do something like this: "http://[site-url]/sites/default/files/myfoldername/[myfield_fid]" or "http://$base_url/sites/default/files/myfoldername/[myfield_fid]" but neither the token or the global variable is replaced.
Context:
What I'm doing is creating a download link as part of a view. I just want the word "download" to display and be a link to the file. So I re-write the content of the field as "download" and then enter the appropriate path in the link path:. It works fine as long as I hard code the url, so "http://www.mysite.com/sites/default/files/myfoldername/[myfield_fid]" works great.
Problem is that of course now I've hardcoded the site's url. I clone my site from time to time for testing purposes and the real site's URL hard coded in the view and need to manually update it.
Any suggestions? Is there an easier way to do this?
Thanks so much
Comments
You should be able to theme
You should be able to theme your view template to output the proper link. Use the "Theme: Information" from your view to help find the appropriate template to use. Then copy this view theme into your site's theme and modify it to output your link, using $base_url etc. Make sure you clear your site's cache after copying the template file.