[xwiki-users] Using a Variable in the WindowsPath Macro
Hi all, I made a form that a user uses to manually list files stored on the local network drive, that are then displayed in a table. It works fine but to get the link to be clickable you have to copy/paste the windowsPath macro into the inline form field. I am wondering how I can put the variable for the file into the windowsPath macro so its clickable in the table, like this (only it doesn't work): ... <td>{{windowsPath share="$formObj.file" name="Link"/}}</td> ... I've tried a few things out but I'm not really sure on how to get it working. Do I have to create an entirely new macro? Thanks, Lockie -- View this message in context: http://xwiki.475771.n2.nabble.com/Using-a-Variable-in-the-WindowsPath-Macro-... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Lockie, On 10/11/2010 06:32 AM, Lockie wrote:
Hi all,
I made a form that a user uses to manually list files stored on the local network drive, that are then displayed in a table. It works fine but to get the link to be clickable you have to copy/paste the windowsPath macro into the inline form field.
I am wondering how I can put the variable for the file into the windowsPath macro so its clickable in the table, like this (only it doesn't work): ... <td>{{windowsPath share="$formObj.file" name="Link"/}}</td> ...
This works for me: ----------8<---------- {{velocity}} #set($path = "C:\path\to\file.txt") |=Path |{{windowsPath share="$path" name="file.txt"/}} {{/velocity}} ---------->8---------- Make sure you save the page that holds the definition of the Windows Path Macro (XWiki.Windows Path Macro) with a user that has programming rights. Hope this helps, Marius
I've tried a few things out but I'm not really sure on how to get it working. Do I have to create an entirely new macro?
Thanks,
Lockie
Hi Marius, thanks for the reply. That way doesn't really work for my situation, I probably should have mentioned that the macro needed to be used in a filterable table (my script is based off the http://www.theserverside.com/news/1363830/XWiki-A-Platform-for-Collaborative... TODO tutorial , I think the variable/object is somehow breaking the html tags of my table and therefore breaking the page. I decided to just change the field of the object to wysiwyg so that the users can just use the macro directly (that won't happen too often anyway) so its not a big issue. On a slightly related note: I don't suppose anyone could point me in the direction of a script that automatically lists paths to all files in a folder to display in a table on a page? So far my searches have come up a blank so I'm assuming there isn't anything. Cheers, Lockie -- View this message in context: http://xwiki.475771.n2.nabble.com/Using-a-Variable-in-the-WindowsPath-Macro-... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
Lockie -
Marius Dumitru Florea