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)
extract DCR node value without <p> tag
cliffhanger
Hello,
When you use <iw_value name = 'x.y'/> tag to extract a value from a DCR node, it outputs the value inside <p> tag. For instance the expression mentioned in the earlier sentence will produce something like <p>some value</p>
Is there any way where I can extract just the value without the <p> tag?
I tried using iwpt_dcr_value(), didn't help...
Any idea?
Thanks,
Cliffhanger
Find more posts tagged with
Comments
Migrateduser
I haven't experienced that -- what type of field is x.y? It sounds like a VFE field and there's several things you can do to prevent this, if this is the case.
Please provide more detail.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
cliffhanger
Hi Dave,
You're right! X is the container name, and Y is a VFE item. How could I prevent the <p> tag in this case?
Thanks
-cliffhanger
Migrateduser
You could have a FormAPI remove the heading <p> and trailing </p> of your field when the DCR is saved (
onSaveValid
) or you could do the same thing in Perl when your presentation template opens up. Also, depending on what version you're using, you could customize your VFE by classifying <p> and </p> as dirty HTML, i.e. marking it for "cleaning" when instructing the VFE to "clean the HTML."
Either of the first two is better than the third. Besides, the third is a more manual process and would strip out
all
paragraph tags.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
cliffhanger
Thanks Dave! I was aware of the first two options, was looking forward for some solution that's more straight forward, which doesn't seem like a possibility now
-cliffhanger
cliffhanger
Hi Dave,
In my DCT I am using a customized VFE that doesn't provide bolding or italizing facilities, however users who know keyboard shortcuts will still be capable of bolding text, underlining, etc.
From my experience I've seen VFE putting <span/> tag for such actions, so one way to avoid that would be stripping out the <span/> tags.
Do you have any better way in mind that would achieve the same goal?
Thanks
-cliffhanger
Migrateduser
Well, you could call the HTMLClean function (the usage escapes me right now but I know there's information on DevNet about it) as you're saving the DCR, including the <span> tag and its variants in the list of HTML to be scoured.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
cliffhanger
hmmm...that's where the problem begins, I don't want to clean up all the span tags, only the ones introduced by the usage of keyboard shortcuts....
Migrateduser
Aaah, I see. I haven't ever tried this so I can't guarantee this would work, but what if you were to declare an onKeyPress event that would check for this?
Of course, the bottom line is that they'll put the span tag in there whether you want them to or not. For instance, they COULD just type it in the HTML. You shouldn't have to go through hoops for this though -- I think at this point, the solution gets into "user education".
Thoughts?
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
cliffhanger
thanks for your suggestion! as you know, "user education" is usually the last option
gzevin
I never rely on 'user education'. In a TPL I use a cleanup code that strips off whatever I need to.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Migrateduser
But then, how does he (presumably a "he") accomplish stripping off only *some* of the <span> tags, for instance? No algorithm can be defined here, but he might be able to associate it with onKeyPress (or something similar) in VFE.
Again, I've never attempted events this granular, so it's just my idea at this point... not proven.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
cliffhanger
dave,
although onKeyPress sounds reasonable, there'll be a tremendous overhead, because their every key press will trigger that event. Where one out of every1000 key press might be the one of our concern.....
However, I found some work around, specific to my scenario. It turns out that the "Style" is defined so that there shouldn't be any <span> tag for the particular section of text that I was concerned about, so I can strip off the tags without any second thought
Thanks to all of you
-cliffhanger