Announcement

Collapse
No announcement yet.

Toolkit and Category Codes / Names

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Toolkit and Category Codes / Names

    I have a script to only work on particular category codes / names

    I need to call to function on CTGY screen

    Example

    If category code is My-Page
    then display script.js
    else nothing

    I have gone through toolkit and do not see a call a category code / name to call to use if/ else statement

    #2
    Re: Toolkit and Category Codes / Names

    Hi,

    Why not use the default tokens available for the category code. A quick scan of token list gave me l.settings:category:code and g.category_code tokens that contain category code on a CTGY page. I'm not sure about the difference between the two, so I'd recommend using g.category_code as toolkit itself gives examples of this token when loading a category in Miva.
    Rajnish Sinha
    ---------------------
    https://twitter.com/rajnishsi

    Comment


      #3
      Re: Toolkit and Category Codes / Names

      Still If I want to call out a particular category code in an if then else statement?
      <mvt:if expr="g.category_code">
      <js>
      <mvt:else>
      </mvt:if>

      Comment


        #4
        Re: Toolkit and Category Codes / Names

        No need for then else part.

        Comment


          #5
          Re: Toolkit and Category Codes / Names

          <mvt:if expr="l.settings:category:code EQ 'The_Category_Code'">
          do this
          <mvt:else>
          do something else
          </mvt:if>

          if you need several categories

          <mvt:if expr="'|'$l.settings:category:code$'|' IN '|one-category-code|another-category-code|yet-another|and-so-on|">

          do this
          <mvt:else>
          do something else
          </mvt:if>
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment

          Working...
          X