Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
browse htdocs in path issue
nico
I'm trying to incorporate the fix to the htdocs showing up in the path ie an href or img src when someone does a browse from a dct. I've included my code below, keep in mind i'm not a perl whiz so any help is welcome.
]]> <iw_iterate var='Links' list='Productofferings.Links'> <![CDATA[
<span class="bracket">></span>
<!-- strips htdocs from path -->
]]> <iw_perl> <![CDATA[
($path = iwpt_dcr_value(Links.Link URL)) =~ s|^/?htdocs||;
]]> </iw_perl> <![CDATA[
<a href='{iw_value name="$path"/}'><iw_value name='Links.Link Text'/></a><br>
]]> </iw_iterate> <![CDATA[
Can you find the problem? Any help is welcome
Thanks,
Nico
Find more posts tagged with
Comments
Adam Stoller
PT's (as of at least 5.0.1) do not *need* to be well-formed XML any more - this helps to remove the need for CDATA tags all over the place and makes it easier to read/write/maintain them. See the on-line information in
http://TSserver/iw/help/tst/PT/iwpt_compile.html
for more information.
<iw_iterate var='Links' list='Productofferings.Links'>
<span class="bracket">></span>
<!-- strips htdocs from path -->
<iw_perl>
($path = iwpt_dcr_value("Links.Link URL")) =~ s|^/?htdocs||;
</iw_perl>
<a href='{iw_value name="$path"/}'><iw_value name='Links.Link Text'/></a><br>
</iw_iterate>
Note: the major change to the above is to quote the argument to iwpt_dcr_value() because you have a space in the element name ("Link URL"). In practice, it would be better to use the label element to make readable names for the elements and use simpler element names:
<!-- simple item name -->
<item name="linkurl">
<!-- nice label -->
<label>Link URL</label>
<description>Select a picture file to display</description>
<browser initial-dir="/htdocs/images"
cieling-dir="/htdocs/images"/>
</item>