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)
Custom PT tags or embedded Perl?
System
The project I am currently on has a disturbing amount of Perl copied and pasted into multiple presentation templates. I would like to factor this out into modules. I am wondering what some of the pros and cons of using custom presentation template tags vs. just embeeding <iw_perl> blocks and calling subroutines in modules. I have written custom presentation template tags in the past, other than all the crazy escaping it seems pretty slick. Any input on this issue out there?
Find more posts tagged with
Comments
james1
Conceptually, I am a strong advocate of custom PT tags. It's a great way to encapsulate a repeated piece of PT code.
However, I've been warned against writing extra PT tags, due to a performance cost. I think the PT compiler does something goofy, like running a regex for each PT tag in existence against the entire text of the PT. Obviously, the more PT tags on your system, the longer it would take to compile any one PT.
Food for thought. If you're talking about a very few tags that will be heavily used, maybe it's not so bad. If you're talking about lotsa lotsa specific-use tags, maybe it won't be a good idea.
-- James
--
James H Koh
Interwoven Engineering
gzevin
On the contrary, I almost never use any other tags but iw_perl
And I found the code is much shorter and more consise then other iw_ tags.
(say, 'for' loops in perl are much more compact than iw_iterate, and this is exactly what is iw_iterate get compiled into)
Also, I try to avoid iw_ tags for the performance reason...
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU