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)
aligning text and images
ngrove
I have a DCT which allows users to enter a paragraph of text and select an image to be associated with the paragraph. (these are replicants, treated as a unit by the way). My TPL then displays the paragraph and image. I am having trouble getting the image and text to align properly (I am using an external style sheet). I think this problem may be due to extra <p> tags being inserted when the final page is generated. I have tried to amend the code given in another thread to strip the <p> tags out, but whenever I try to create a new DCR, I get a message stating that my template could not be processed.
The relevant code from my TPL follows:
<!-- Iteration -->
<iw_iterate list = 'dcr.Main body text.body' var ='info'>
<h2><iw_value name='info.Sub heading'/></h2>
<p>
<iw_if expn='{iw_value name="info.want image"/} eq "N"'>
<iw_then>
<iw_value name='info.Body text'/>
</iw_then>
<iw_else>
<iw_perl>
<![CDATA[
$textvar=iw_value name='info.Body text');
$textvar=~s/<p>//g;
$textvar=~s/<\/p>//g;
$imgvar=iw_value name='info.choose image');
$imgvar=~s/<p>//g;
$imgvar=~s/<\/p>//g;
]]>
</iw_perl>
<iw_if expn='{iw_value name="info.align image"/} eq "LPic"'>
<iw_then>
<![CDATA[
<img src="{iw_value name='$imgvar'/}" class="leftBodyImage"> <iw_value name="$textvar"/>
]]>
</iw_then>
</iw_if>
<iw_if expn='{iw_value name="info.align image"/} eq "RPic"'>
<iw_then>
<![CDATA[
<img src="{iw_value name='$imgvar'/}" class="rightBodyImage"> <iw_value name="$textvar"/>
]]>
</iw_then>
</iw_if>
</iw_else>
</iw_if>
</p>
</iw_iterate> <!-- End iteration -->
Any advice would be gratefully received! (BTW I am a complete Perl newbie and not much more advanced with TeamSite itself, so forgive me for any obvious errors I've made!)
Thanks
Nicola
Find more posts tagged with
Comments
akshathp
Hi Nicola,
It would be easy for me and others to test this script if you could attach the datacapture and tpl with the post.
I looked at the tpl code you provided and it seems some parenthesis are missing. Also, there could be some other points when one starts testing it.
Thanks.
Akshat Pramod Sharma
Interwoven Inc.
ngrove
Hi Akshat
Thanks for answering! I have attached my DCT and TPL code (in one text file).
Thanks again
Nicola