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)
Problem displaying replicant item
cliffhanger
Hi,
I am having trouble displaying replicant items. this is how my datacapture.cfg code looks like for the replicant:
<item name = "Story">
<description>
Enter a brief story, up to 1000 words
</description>
<replicant min ="1" max= "6">
<item name = "paragraph">
<textarea cols ="75" rows ="15"
wrap ="virtual" external-editor = "visualformat"/>
</item>
</replicant>
</item>
This is what my .tpl (presentation template) code looks like:
<iw_iterate list='dcr.Story' var = 'story'>
<p>
<iw_value name='story.paragraph'/>
</p>
</iw_iterate>
Could anyone please tell what I am doing wrong here?
Thanks
-Cliffhanger
Find more posts tagged with
Comments
Dwayne
I don't see anything immediately obvious. What sort of symptoms are you seeing?
Some wild guesses:
Your TPM code is making the assumption that the 'Story' item is at the root of the DCR. Is it inside of another container?
Is there something else in the TPL that's preventing this section of the page from being executed? An <iw_if>, for instance?
--
Current project: TS 5.5.2/6.1 W2K
cliffhanger
Hi Dwayne,
Your TPM code is making the assumption that the 'Story' item is at the root of the DCR. Is it inside of another container? Nope, it's not inside another container. It's bound by a "ruleset" tag only.
Is there something else in the TPL that's preventing this section of the page from being executed? An <iw_if>, for instance? This is also a NO, there's no conditional statement in the TPL that could prevent this section from being executed.
This is how my entire TPL file looks, hope this would give you any clue:
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="Press Release"><![CDATA[
<HTML>
<!-- Begin CDATA Tag -->
<!-- HTML stuff is enclosed in CDATA tag -->
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
</head>
<body bgcolor ="#FFFFFF"
link ="#0033CC"
vlink ="#0033CC"
alink ="0000FF"
text ="#000000">
<center>
<table width='600' cellspacing='0' border='0' bgcolor='#00AA99'>
<tr>
<td colspan='2'>
<center><font size='+1'><b>Safari Zoo News</b></font></center>
</td>
</tr>
<tr>
<td>
<b><iw_value name='dcr.Date'/></b>
</td>
</tr>
<tr>
<td valign = 'top'>
<b><iw_value name='dcr.Title'/> </b>
</td>
<td>
<img src="<iw_value name='dcr.Picture'/>">
</td>
</tr>
<tr>
<td>
<iw_iterate list='dcr.Story' var = 'story'>
<p>
<iw_value name='story.paragraph'/>
</p>
</iw_iterate>
</td>
</tr>
</table>
</center>
</body>
</HTML>
]]> <!-- End CDATA tag -->
</iw_pt>
Thanks,
Cliffhanger
nipper
I made a DCR with what you posted and then used this for a TPL:
<html>
<!-- start content area -->
<body>
<iw_iterate list='dcr.Story' var = 'story'>
<iw_value name='story.paragraph'/>
</iw_iterate>
</body>
</html>
It works
You had extra paragraph tags since the paragraph already has tags I removed them,
but it should work either way.
So it is not in the code you originally posted, will need to debug the other portions
Andy
cliffhanger
Hi Andy,
Do you think it might have something to do with how I am enclosing the code into CDATA? I enclosed the entire TPL file in one CDATA, should I rather use different CDATA tags for different parts of the code?
Thanks,
Cliffhanger
Dwayne
You beat me to it.
It was the CDATA that was causing the problem. That's one of the things that's a bit confusing about TPL tags vs "real" XML. CDATA, in XML terminology, means to send the data exactly as is - no parsing. But to make things easier on TPL developers, Interwoven has "broken" that rule, and parses <iw_value> tags found inside CDATA blocks.
That's all well and good, but it tends to give people the mistaken impression that
all
<iw_...> tags are parsed in CDATA blocks. This is not true.
My guess is that, if you look at the generated HTML, you'll see your actual <iw_iterate> tags.
You can either make your CDATA blocks more restrictive, or remove them completely. If you use the "condensed" form of the <iw_pt> tag, then the rest of the TPL doesn't need to be valid XML (although the <iw_...> tags still need to be properly formed).
So, instead of
<iw_pt>
Some PT code here
</iw_pt>
use this:
<iw_pt />
Some PT conde here
--
Current project: TS 5.5.2/6.1 W2K
cliffhanger
Hi Dwayne,
You're right! It works that way, although I still don't quite understand why having a condensed <iw_pt> should make a difference since I am using the CDATA as before. Could you please explain?
Thank you
Cliffhanger
nipper
Yea CDATA often is part of the problem. The use of CDATA is typically unneeded, but since early
TST, a lot of templating writers (including myself) include it when you really do not need to.
I would be willing to bet you do not need any of the CDATA tags.
Andy
Dwayne
I still don't quite understand why having a condensed <iw_pt> should make a difference since I am using the CDATA as before.
The TeamSite presentation template compiler has two distinct sets of behavior. You can think of them as "XML mode" and "non-XML mode." You choose between these two "modes" based on the style of your <iw_pt> tag. If it's self contained (that is, the <iw_pt /> form), then non-XML mode is used.
In XML mode, all normal XML rules related to well-formedness (is that a word?) apply. That includes, among others, that anything inside of a CDATA block is passed on un-modified (with the special case exception of <iw_value> tags). In non-XML mode, those rules do not apply. Only the <iw_...> tags are processed. The compiler treats everything else as if it had CDATA tags around it. That includes any CDATA blocks you might have defined.
Does that make more sense now?
--
Current project: TS 5.5.2/6.1 W2K
cliffhanger
Hi,
yes it does makes sense now!! you're a good teacher
-cliffhanger