Home
Web CMS (TeamSite)
Need help on iw_ifcase
KTR
Hi,
I am trying to use iw_ifcase as follows:
<iw_ifcase name='dcr.code'>
<iw_case value='code1'><title>Development </title></iw_case>
<iw_case value='code2'><title>Qa</title></iw_case>
<iw_case value='code3'><title>Prod</title></iw_case>
</iw_ifcase>
All that code in within CDATA. When I preview, I can see Title in browser is only Development. Even though, my dct value is code2/code3.
Can any one suggest me, if I am using the tag in wrong way. I also don't like to use title again and again, Wanted to store that in var and use that var in title tag. If any one is done like this, pls reply me ASAP.
Cheers,
Find more posts tagged with
Comments
Migrateduser
Hi,
This code may help u.
<![CDATA[
<title><iw_value name='dcr.code'/></title>
</head>
]]>
like above way u can directly call right ?? I don't may be u have any specific reason doing below way. I didn't see any wroing in your code. I have similar code like u it is working for me. Pls. check below code
<iw_ifcase name='dcr.category'>
<iw_case value = 'Small business & workgroup'>
<!-- BEGIN Small Business Category LEFT NAVIGATION -->
<!--#include virtual="/servers/include/navbars/eserver/<iw_value name='$series'/>/hardware/small.ssi"-->
<!-- END LEFT NAVIGATION -->
</iw_case>
<iw_case value = 'Small business & workgroups'>
<!-- BEGIN Small Business Category LEFT NAVIGATION -->
<!--#include virtual="/servers/include/navbars/eserver/<iw_value name='$series'/>/hardware/small.ssi"-->
<!-- END LEFT NAVIGATION -->
</iw_case>
<iw_case value = 'Medium business'>
<!-- BEGIN Medium Business Category LEFT NAVIGATION -->
<!--#include virtual="/servers/include/navbars/eserver/<iw_value name='$series'/>/hardware/medium.ssi"-->
<!-- END LEFT NAVIGATION -->
</iw_case>
<iw_case value ='Large business'>
<!-- BEGIN Large Business Category LEFT NAVIGATION -->
<!--#include virtual="/servers/include/navbars/eserver/<iw_value name='$series'/>/hardware/large.ssi"-->
<!-- END LEFT NAVIGATION -->
</iw_case>
<iw_case value ='Earlier models'>
<!-- BEGIN Earlier models Category LEFT NAVIGATION -->
<!--#include virtual="/servers/include/navbars/eserver/iseries/hardware/homepage.ssi"-->
<!-- END LEFT NAVIGATION -->
</iw_case>
<iw_case value ='Small to medium businesses'>
<!-- BEGIN Smallmed Category LEFT NAVIGATION -->
<!--#include virtual="/servers/include/navbars/eserver/<iw_value name='$series'/>/hardware/smallmedium.ssi"-->
<!-- END LEFT NAVIGATION -->
</iw_case>
<iw_case value ='Medium to large businesses'>
<!-- BEGIN Medlarge Category LEFT NAVIGATION -->
<!--#include virtual="/servers/include/navbars/eserver/<iw_value name='$series'/>/hardware/mediumlarge.ssi"-->
<!-- END LEFT NAVIGATION -->
</iw_case>
</iw_ifcase>
MattP
Are you using 5.5.2? No need for the cdata if so.
So you have an item in your dcr called "code", correct? That item can ONLY have the values "code1", "code2" or "code3". If it contains anything else (case sensitive for arg sake), the case fails. Hopefully a required dropdown. If all this is true, then your case statement is fine. You could pull the title tags out so you don't repeat them. I also added a defualt case in the event none of the matches are met. Otherwise it seems valid. Lots-o-documentation
http://<iwservername>/iw/help/tst/pt/TeamSite__PT__iw_ifcase.html
<iw_ifcase name='dcr.code'>
<title>
<iw_case value='code1'>
Development
</iw_case>
<iw_case value='code2'>
Qa
</iw_case>
<iw_case value='code3'>
Prod
</iw_case>
<iw_case'>
Default
</iw_case>
</title>
</iw_ifcase>
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
KTR
Hi Matt,
You guessed correct every thing. I used the code which you sent, but, still I can see only first one.
Here is code:
<iw_ifcase name='dcr.code'>
<title><iw_case value='code1'>Development </iw_case>
<iw_case value='code2'>Qa</iw_case>
<iw_case value='code3'>Prod</iw_case>
</title>
</iw_ifcase>
Output is <iw_case value='code1'>Delopment
I checked case sensitive and every thing.
Strange thing is only first value with tag, even, I select code2 in dct.
KTR again,
Friends,
Following code worked for me:
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="content">
<![CDATA[
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>]]><iw_ifcase name="dcr.code"><iw_case value="code1"> Development </iw_case> <iw_case value="code2">QA</iw_case> <iw_case value="code3">Prod</iw_case>
</iw_ifcase>
<![CDATA[</title>
</head>
<body>Hello We r testing iw_ifcase function.
</body>
</html>
]]> <!-- End of CDATA Tag -->
</iw_pt>
Edited by KTR on 04/17/03 11:41 AM (server time).
MattP
can I see the DCT that is used with this?
The rest of the TPL would be helpful as well.
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
EMAIL.docx