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)
Keep V.F. from adding paragraph tags
Bowker
By default Visual Formatter is putting <p></p> in empty text areas. I want to prevent this, since the presentation wants the content of the VF window to be snug up against the header right above it.
Is it possible to have the default condition for VF text areas be empty?
Dan Bowker
Northern Trust Company
312-630-6587
Find more posts tagged with
Comments
JamJamT
You can always put some perl into the TPL file and strip them out with a regex replace. for instance
$var =~ s/<p>/<br>/g;
$var =~ s/<\/p>//g;
This would replace all <p> tags with a <br> and delete all </p> tags.
Migrateduser
I was looking around here for a solution silimar to the one you posted an answer to. I have a few questions for you about it. You included a perl script to strip <p> </p> tags from a tpl. Well I am using Visual Editor and it adds A's with a tilda on top anywhere I have a . (period) and a space or two. Any ideas how to eliminate this? I tried your perl script to get rid of p tags but didn't get it working. I tried it within and outside the CDATA tags and also withina dn outside <iw_perl> tags. Exactly how do you get this to work? I had it in the .tpl for a particular template and couldn't get it to work. Any suggestions would be greatly appreciated.
JamJamT
The "Â" character sounds like an encoding issue. Try the following meta tag in the <head> element of your TPL:
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'>
--Jeff
Migrateduser
That worked like a charm! Thank you SO much! Another, yet more complicated and invloved solution I found was to use Perl to strip the miscellaneous character out. It look something like this:
....................
]]>
<iw_if expr='{iw_value name="dcr.Opening Paragraph" /} ne ""'>
<iw_then>
<iw_perl>
<![CDATA[
$openvar=iwpt_dcr_value('dcr.Opening Paragraph');
$openvar =~ s/Â//g;
]]>
</iw_perl>
<![CDATA[
<p class="bodyText"> ]]> <iw_value name="$openvar" />
<!CDATA[ </p> ]]>
</iw_then>
<iw_else>
<![CDATA[ ]]>
</iw_else>
</iw_if>
<![CDATA[
.................
Drew_The_Goat
We had a similar issue of having to display VisualFormat content directly underneath a label in the output page, separated onyl by a line break. Our solution was to enbed the <p> tagged content into a <tr> and <td> tag in a table in the PT. This overrides the paragraph spacing.
Example:
<TABLE>
<TR>
<TD>Content Below is just a line break away</TD>
</TR>
<TR>
<TD>]]><iw_value name='Paragraph'/><![CDATA[</TD>
</TR>
</TABLE>