Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
include selected image in tpl
madmax
i tried this is but it's not working
<iw_perl>
<![CDATA[
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $iwmount = TeamSite::Config::iwgetmount();
# Get the Image file path
my $path = $iwmount . "/default/main/lab/WORKAREA/base";
my $imgpath = iwpt_dcr_value('dcr.mapImage');
# add the path up to the filepath
$fullpathimg =$path . $imagepath;
iwpt_output(qq~
<tr>
<td valign="top" align="right"><b>Map Image</b></td>
<td width="10"> </td>
<td valign="top" align="left"><nobr><img src="$fullpathimg"/></nobr></td>
</tr>
~);
]]>
</iw_perl>
Find more posts tagged with
Comments
nipper
What part is not working ?
Does the HTML not come out at all or is it incorrect ?
Post the generated code (or appreviated if you prefer)
Andy
madmax
my tpl gets
<td valign="top" align="left"><nobr><img src="/iwmnt/default/main/lab/WORKAREA/base"/>
which means
i am not getting /site/images/abc.gif which is iwpt_dcr_value('dcr.mapImage');
iwovGraduate
... i tried this is but it's not working ...
Tried where ? How ? Looks like this is a code from a Presentation Template. Would be nice if you describe the context in which you are having a problem. What is the problem you are having with this code ? What do you expect it do do ? What is it doing instead ? Not everybody here has a crystal ball to read your mind
What version of TeamSite ? SP/Patch level ?
Which OS ?
nipper
Can you post you DCT ? Is dcr.mapImage part of a replicant or jsut a top level object ?
madmax
ok so silly of me.
it;s a replicant. i fixed it. now i am getting the full path but i can't see any image in my presentation template. the code r below.
<iw_perl>
<![CDATA[
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $iwmount = TeamSite::Config::iwgetmount();
# Get the Image file path
my $path = $iwmount . "/default/main/lab/WORKAREA/base";
my $imgpath = iwpt_dcr_value('dcr.map.mapImage');
# add the path up to the filepath
$fullpathimg =$path . $imgpath;
iwpt_output(qq~
<tr>
<td valign="top" align="right"><b>Map Image</b></td>
<td width="10"> </td>
<td valign="top" align="left"><nobr><img src="$fullpathimg"/></nobr></td>
</tr>
~);
]]>
</iw_perl>
*************************************************************************************************************
<td valign="top" align="left"><nobr><img src="/iwmnt/default/main/lab/WORKAREA/base/site/images/snav_planning_n.gif"/></nobr></td>
iwovGraduate
... but i can't see any image in my presentation template ...
You mean in the generated page ?
Or this is resolved and you just posted the solution for the benifit of others ?
madmax
hi iwovGraduate,
it's code from my presentation template. i am tring to see my saved dct image in my presentation template. when i preview then i don't see any image.
Johnny
your image shouldn't reference the workarea.
Think of the workarea as your docroot (or a directory inside it if you have configured further docroots)
Your image reference should be "/site/images/snav_planning_n.gif"
If these images reside in another branch (hence the reason for initially hardcoding it), you should use proxy rewrite rules to remap the entries.
John Cuiuli
madmax
yeah i mean in the generated htm page.
iwovGraduate
Its probably because the path is not right. You have
<img src="/iwmnt/default/main/lab/WORKAREA/base/site/images/snav_planning_n.gif"/>
Typically the preview webserver is configured to treat the Workarea as docroot. So you might want to try "/site/images/snav_planning_n.gif" instead.
Do you have any proxy remaps in your iw.cfg ?
nipper
Yea, I answered your question, did not address your other bug (which you see now)
your image path sould not be /iwmnt/default/main/bramch/WORKAREA/workarea/images/aussies_are_strange.jpg
it should only be
/images/aussies_are_strange.jpg
The proxy will remap it correctly for your.
HTH
Andy
madmax
thanks jhonny and everybody.
it works.
Johnny
a few more replies and they'll get an answer in surround sound.
aussies_are_invading.jpg
John Cuiuli