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)
Where can I get presentation template examples?
TomDell
Hi there,
I'm currently working on some DCTs and trying to build my presentation templates. We had training at Interwoven downtown, and were told there were examples on Devnet, but I am unable to locate anything. Can someone point the way?
Thanks
Tom
Find more posts tagged with
Comments
nipper
check your install, iw-home/examples
You can also search the tech library for more up to date stuff
jbonifaci
I believe they were probably referring to either examples in posts, which you would have to search for. Or examples in the technical library, which you would have to search for. There should also be sample DCTs and TPLs on your TeamSite server under <iw-home>/examples.
You can also be able to download TeamSite manuals from the support site and also access the help provided on your TeamSite server at
http://<serverName>/iw/help
. You can access formapi help at
http://<serverName>/iw/help/tst/formapi
and presentation template help at
http://<serverName>/iw/help/tst/pt
.
That should get you started.
~Jeff
nipper
you can also read
this
. It is old (2002 - note to Heather, someone should update).
Some of the examples are even older, though still valid. Just not showing new technology.
Andy
DisplayAveragesUnderCrosstabOfTotals.rptdesign
jbonifaci
One other thing to note. It has become a best practice for most experienced TeamSite developers to write all of their presentation templates completely within iw_perl tags:
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt />
<iw_perl>
# perl presentation template logic goes here.
</iw_perl>
You would be better off learning this way, as it makes writing and maintaining presentation templates easier.
~Jeff
TomDell
Thanks for the tips everyone. Jeff, could you possibly elaborate? I'm brand new to this other than the training I took at Interwoven. I'm not a perl guy at all, although I do know various server-side and client-side tech and am an experienced front end developer. Also, might you have any examples you could post?
Right now my test template I'm working on looks like so:
<div class="landing-page">
<h1><iw_value name="dcr.landing-page.offer" /></h1>
<p><iw_value name="dcr.landing-page.offer-detail" /></p>
<iw_iterate list="dcr.landing-page.para" var="paranum">
<p><iw_value name="paranum.para" /></p>
</iw_iterate>
<!-- more specials -->
<a href="/specials.dsp"><img src="/images/shared/button_more_specials.gif" width="92" height="15" alt="More Specials" border="0" /></a>
<!-- order now - supply promo code -->
<a href='/Get<iw_value name="dcr.landing-page.offer-type" />.dsp?product_sku=<iw_value name="dcr.landing-page.sku" />&promocode=<%= request.getParameter("promocode") %>'><img src="/images/shared/button_ordernow.gif" width="85" height="15" alt="Order Now" border="0" /></a>
<h5>Terms and Conditions</h5>
<p class="landing-terms"><iw_value name="dcr.landing-page.terms" /></p>
</div>
<div class="landing-photo">
<!-- special photo -->
<img src="/images/landing/landing_special_pest.jpg" alt="Pest Free Home" border="0" />
</div>
</div>
Adam Stoller
Maybe I'm wrong - but it looks like you have an extra end-div tag in there.
If you don't know Perl - there are a couple of options:
1. Keep writing PTs in the XML-style
2. Learn Perl.
I'm biased - I'd say take option '2' (if you search the forums you'll see numerous posts with recommended readings for learning Perl).
Once you know Perl - you can familiarize yourself with modules like TeamSite::XMLnode / TeamSite:
CRnode - and you'll see how you can fit them into your PT code.
For the example you posted - the code might look something like this:
<iw_perl>
iwpt_output(get_landing_page());
sub get_landing_page{
#------------------------------------------------------------
# Get non-replicant information to make it handy
#------------------------------------------------------------
my $offer = iwpt_dcr_value('dcr.landing-page.offer');
my $detail = iwpt_dcr_value('dcr.landing-page.offer-detail');
my $otype = iwpt_dcr_value('dcr.landing-page.offer-type');
my $sku = iwpt_dcr_value('dcr.landing-page.sku');
my $terms = iwpt_dcr_value('dcr.landing-page.terms');
#------------------------------------------------------------
# Get replicant information to make it handy
#------------------------------------------------------------
my $paragraphs = get_paragraphs();
#------------------------------------------------------------
# Build up HTML code
#------------------------------------------------------------
my $html = qq{
<div class="landing-page">
<h1>$offer</h1>
<p>$detail</p>\n$paragraphs
<!-- more specials -->
<a href="/specials.dsp"><img src="/images/shared/button_more_specials.gif" width="92" height="15" alt="More Specials" border="0" /></a>
<!-- order now - supply promo code -->
<a href='/Get$otype.dsp?product_sku=$sku&promocode=<%= request.getParameter("promocode") %>'>
<img src="/images/shared/button_ordernow.gif" width="85" height="15" alt="Order Now" border="0" /></a>
<h5>Terms and Conditions</h5>
<p class="landing-terms">$terms</p>
<!-- </div> -->
<div class="landing-photo">
<!-- special photo -->
<img src="/images/landing/landing_special_pest.jpg" alt="Pest Free Home" border="0" />
</div>
</div>
};
return $html;
}
sub get_paragraphs{
my $html = q{};
foreach my $paranum (iwpt_dcr_list('dcr.landing-page.para')){
$html .= " <p>".iwpt_dcr_value('$paranum.para')."</p>\n";
}
return $html;
}
</iw_perl>
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
jbonifaci
Well, you can read up on <iw_perl> at
http://<yourTeamSiteServer/iw/help/tst/pt/TeamSite__PT__iw_perl.html
.
As far as what you have so far, if you were to translate it to the iw_perl equivalent, it would look something like this (untested):
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt />
<iw_perl>
######################################################################
# Retrieve DCR information.
######################################################################
my $landingPageOffer = iwpt_dcr_value('dcr.landing-page.offer');
my $landingPageOfferDetail = iwpt_dcr_value('dcr.landing-page.offer-detail');
my $landingPageOfferType = iwpt_dcr_value('dcr.landing-page.offer-type');
my $landingPageSku = iwpt_dcr_value('dcr.landing-page.sku');
my $landingPageTerms = iwpt_dcr_value('dcr.landing-page.terms');
my $landingPageParagraphs = '';
foreach my $paragraphItem (iwpt_dcr_list('dcr.landing-page.para'))
{
my $paragraphValue = iwpt_dcr_value('paragraphItem.para');
$landingPageParagraphs .= qq|<p>$paragraphValue</p>\n|;
}
######################################################################
# Build the html output.
######################################################################
my $outputHtml = <<HTML;
<div class="landing-page">
<h1>$landingPageOffer</h1>
<p>$landingPageOfferDetail</p>
$landingPageParagraphs
<!-- more specials -->
<a href="/specials.dsp"><img src="/images/shared/button_more_specials.gif" width="92" height="15" alt="More Specials" border="0" /></a>
<!-- order now - supply promo code -->
<a href='/Get$landingPageOfferType.dsp?product_sku=$landingPageSku&promocode=<%= request.getParameter("promocode") %>'><img src="/images/shared/button_ordernow.gif" width="85" height="15" alt="Order Now" border="0" /></a>
<h5>Terms and Conditions</h5>
<p class="landing-terms">$landingPageTerms</p>
</div>
<div class="landing-photo">
<!-- special photo -->
<img src="/images/landing/landing_special_pest.jpg" alt="Pest Free Home" border="0" />
</div>
</div>
HTML
######################################################################
# Output the html.
######################################################################
iwpt_output($outputHtml);
</iw_perl>
Let me know if you have any other questions.
~Jeff
IwovHeather
Hi Andy:
Thank you for letting me know about the KB article - I'll work on getting a replacement updated document available as soon as possible.
Thanks,
Heather
gzevin
oh yes.. this is an old document. I and Powell Trussler wrote it in 2001....Don't expect anything new in it
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU