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)
Force-feeding a .tpl
JeremyH
I am creating a new .tpl that will have the same basic output structure as a currently existing .tpl. The existing one is a fairly basic PT (DCR field A goes here, field B goes here, etc.), while the new template does a lot of processing. (DCR field A goes here, hardcoded value goes here, value obtained from another source goes here, etc.)
Option 1 would be to cut and paste a lot of the HTML from the first template in order to create the second template. Would be easy, but would require html tweakings to take place in two places. Seems easy... but -
Option 2 would be to create a template that does all of the processing, then builds a structure to look like the a first DCR, and then inject this in two the first PT. This could be a pain, but it would allow for the html to just be modified in one place for all pages.
Is this second approach reasonable? Are there any tricks to building up a raw DCR structure that can be handed off to an included template?
Find more posts tagged with
Comments
chuckles
I would prefer approach #2. It keeps all of your formatting in one TPL so you won't have to make changes in two places if the HTML design changes. As for tips on creating the DCR, all you need is this
https://support.interwoven.com/library/perldocs/DCRnode.asp#get_dcr__
. It should be pretty simple to gather all of your data and create a DCR then run it through iwpt_compile.
JeremyH
My intended approach is to bypass the actual creation of the DCR, and just feed the structure directly in to the template using iw_include... Could be alittle trickier.
Adam Stoller
Why are you trying to avoid the creation of a DCR?
What are you *really* trying to acheive?
Whatever it is - it *might* work - but getting support for it over the long-term will probably be difficult since the basic premise in TeamSite is DCT->DCR+PT->GenPage where GenPage refers back to DCT, DCR, and PT. Cutting out the DCR part breaks that reference pattern and also means that you have no "source" to version control - just output.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
JeremyH
In this case there would still be a source DCR.
The process would be :
DCT->DCR->PT1->included PT2->output page.
PT1 would map fields in the DCR to fields that could be used by PT2. PT2 controls the general look and feel of the site. Thus that PT can be the one PT to modify for the entire site. PT1 just takes the DCR that uses a different structure, and maps the fields to the appropriate ones in the second PT before including it.
Adam Stoller
I'm not sure I want to try bending my mind around all that. If you want all the structures to be the same so that PT2 can process all of them - why not just make all the structures the same in the DCTs in the first place?
All I can say at this point is: good luck.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
JeremyH
That would be the easy way. Alas, the DCRs have different purposes, and can't really be combined. However, my brain has been fried trying to go about the force-feeding approach, so I'll probably end up with a second semi-hardcoded template.