cancel
Showing results for 
Search instead for 
Did you mean: 

Remove leading '/' in path

junderwood
Champ in-the-making
Champ in-the-making
Just had a hopefully quick question.  I have a webform with anyURI to select an image.  When the html is rendered the path looks like "/images/products/image.gif" but I need it to look like "images/products/image.gif".

How do you get rid of that leading slash?
4 REPLIES 4

tvaughan77
Champ in-the-making
Champ in-the-making
Are you using a freemarker template to render the HTML?

If so, try looking at the "get a char" or "sequence" section of the freemarker manual:
http://freemarker.sourceforge.net/docs/dgui_template_exp.html#dgui_template_exp_get_character

scottf
Champ on-the-rise
Champ on-the-rise
Or you could simply edit the
\Alfresco\tomcat\webapps\alfresco\scripts\ajax\file_picker_widget.js
file to edit the path as soon as it is selected in the anyURI file picker.

tvaughan77
Champ in-the-making
Champ in-the-making
Ahh…yeah…Scott's is a better solution.  Prefer to have the data right than for the presentation layer to accommodate bad data.

Of course, I guess (?) Scott's is a global solution for all filepickers, so make sure you consider that.

junderwood
Champ in-the-making
Champ in-the-making
Thanks for the replies, I was impatient.  I went back and read the freemarker documentation and there it is - ?substring(1)