Avatar of LelloLello
LelloLello
 asked on

How you write an <XSL:if test="1" and /or "test="

Hello Expert,

 
I have two checkbox menu, could you please advice how i'm able to write the TEST statment.

 

 

<xsl:param name="IsHideFieldName" select="'Hide Menu'" />
<xsl:param name="IsHideFieldNameActivity" select="'Activity Menu'" />

<xsl:variable name="IsShow" select="boolean(sc:fld($IsHideFieldName,.)!=1)" />
<xsl:variable name="IsShowActivity" select="boolean(sc:fld($IsHideFieldNameActivity,.)!=1)" />

 

<xsl:if test="$IsShowActivity" or test="$IsShow">

Could you please correct my <XSL:if test...

Thank you very much.

 

XMLASP.NETWeb Languages and Standards

Avatar of undefined
Last Comment
Gertone (Geert Bormans)

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Gertone (Geert Bormans)

Note that your other questions might be more succesfull if you could indicate some XML source and parameter settings.
I have not found many SiteCore XSLT experts here,
but there are some very good general XSLT experts here,
so you might need to give them some more details
Gertone (Geert Bormans)

by the way, my first comment assumes both variables are castable as boolean in a way you would expect
LelloLello

ASKER
I have a question for you what this command do :
  <xsl:param name="MenuRootPath" select="''" />

        <xsl:when test="$MenuRootPath!=''">
          <xsl:call-template name="rootmenu">
            <xsl:with-param name="root" select="sc:item($MenuRootPath,.)" />
          </xsl:call-template>
        </xsl:when>
<xsl:param name="IsHideFieldName" select="'Hide Menu'" />
<xsl:param name="IsHideFieldNameCommission" select="'Commission Menu'" />

<xsl:variable name="IsShow" select="boolean(sc:fld($IsHideFieldName,.)!=1)" />

<xsl:variable name="IsShowCommission" select="boolean(sc:fld($IsHideFieldNameCommission,.)!=1)" />

<xsl:if test="$IsShow">
 <xsl:if test="$IsShowCommission">

Open in new window

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Gertone (Geert Bormans)

Let's first concentrate on the actual question please
You asked a question, I gave an answer, so the first thing I would like to hear from you is feedback on that, not a new question

xsl:param can be used to pass a parameter from outside the template (or even the stylesheet)
the param has a default value set to the empty string
then you test wheither an actual value is passed in ,
if so you call a template "rootmenu" and pass in teh result of an extension function sc:item on this parameter and the context node
since I don't see enough of the stylesheet, I have no clue what the context here is and what the named template does,
I don't know enough about sitecore to know the extension functions,
but there are some good sitecore xslt reference books on the web for you to learn that from

But anyhow, 1 question at the time please
LelloLello

ASKER
Gertone (Geert Bormans)

welcome
why would I reference a registration limited site?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.