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)
remove linefeeds
System
I haven't spent a lot of time on templating recently so this may be an easy one. This project has a lot of Perl embedded in presentation templates. It is broken up into small <iw_perl> blocks. They find that there are a tremendous amount of linefeeds and other whitespace in the generated page which seems to be a result of this. Is there a flag that can be set or some other way to remove excess whitespace from the generated page? How are other companies dealing with this issue?
TeamSite 5.5.2
Find more posts tagged with
Comments
Migrateduser
my ${data} = iwpt_get_ostream_data( "default" );
${data} =~ s#^\s+$##mgi;
iwpt_set_ostream_data( "default", ${data} );
Is this the right way?
One of my coworkers contacted Interwoven about the stream/buffer manipulation facilities and was told not to use them.
gzevin
as far as I understand, you either have a readable code (with linefeed in the resulting HTML) or compressed code and no linefeeds
I ususally trry to compress a presentation template after it's debugged and is in production.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Johnny
you can use the ostream attributes filter and filter_all. They take a regex as their argument.
I believe you can insert an ostream tag at the start of your tpl with no file attribute and it will be treated as the main/default output which would be the ofile.
If you have a filter_all on the default ostream (which apparently is defined implicitly if it doesnt explicitly appear in the tpl) you should be able to clean up the mess
John Cuiuli
Johnny
on the use of stream buffer functions,
I would like to hear why we shouldnt use them.
I do use them when needed in complicated situations. They are a documented and supported feature, so it makes me concerned to hear that IWOV say not to use them.
John Cuiuli
gzevin
I thought there was a bug so the buffers have not been flushed out properly. However, I might be mistaken
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Johnny
I havent seen anything like that, but maybe im not looking hard enough
John Cuiuli
Migrateduser
TST was designed to meet the needs of users with
different levels of expertise (from beginner to advanced).
The <iw_ostream> tag and its associated buffers are
an advanced feature. If *you* are an advanced user,
then you'll find them incredibly useful now and then.
Think of it this way: If you were not supposed to
use them, they would not have been so lovingly
documented!
-Jon
Johnny
>Think of it this way: If you were not supposed to
>use them, they would not have been so lovingly
>documented!
Exactly, Im glad to hear it from yourself Jon, I got spooked for a second.
They are a life saver when working on the funky stuff.
John Cuiuli