Announcement

Collapse
No announcement yet.

A need for a thread about custom cat fields.

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

    A need for a thread about custom cat fields.

    We need this thread.

    I have this that works great for products but need it for categories.

    <mvt:if expr="l.settings:product:customfield_values:custom fields:magic EQ '1'">

    But for categories, this does not work....

    <mvt:item name="toolkit" param="customcategory|cattemp|l.all_settings:categ ory:id|cattemplate" />
    <mvt:if expr="NOT ISNULL g.cattemp">
    <mvt:if expr="l.settings:category:customfield_values:custo mfields:cattemp EQ '1'">
    1 does this
    <mvt:elseif expr="l.settings:category:customfield_values:custo mfields:cattemp EQ '2'">
    2 does this
    <mvt:elseif expr="l.settings:category:customfield_values:custo mfields:cattemp EQ '3'">
    3 does this
    <mvt:else>
    Default should do this
    </mvt:if>
    </mvt:if>

    #2
    Re: A need for a thread about custom cat fields.

    The logic you have above uses toolkit and the "old" method of custom category fields. I would recommend using the new custom field functions as there is much more docs/examples and they will be easier to maintain since it does not rely on toolkit.

    Code:
    <mvt:item name="customfields" param="Read_Category_Code( l.settings:category:code, 'cattemplate', g.cattemp )" />
    
    
    
    <mvt:if expr="NOT ISNULL g.cattemp">
    
    
        <mvt:if expr="g.cattemp EQ '1'"> 
            1 does this
        <mvt:elseif expr="g.cattemp EQ '2'">
            2 does this
        <mvt:elseif expr="g.cattemp EQ '3'">
            3 does this
        <mvt:else>
            Default should do this
        </mvt:if> 
        
    </mvt:if>
    Here are some docs/videos which should help:

    http://www.miva.com/videos/web_devel...-overview1/125
    http://www.miva.com/videos/web_devel...-overview1/125
    http://www.miva.com/videos/web_devel...functions1/125
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Along the same lines (yes I have looked at the docs more than one and they seem more complicated than it really used to be) how do I pull a value in.

      Code:
      <mvt:item name="customfields" param="Read_Category_Code( l.settings:category:code, 'altcattitle', g.act )" />
      
      <mvt:if expr="NOT ISNULL g.act">
      hmmmm
      </mvt:if>
      It displays my "hmmm" message, but I need to pull in the value of the custom field. I guess I'm missing the write function? I've looked at the examples but I'm just not getting it.
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


        #4
        Sometimes I should just wait until I've had my morning mocha, then go back and find my own answers to this

        Code:
        <mvt:item name="customfields" param="Read_Category_Code( g.Category_Code, 'altcattitle', g.altcattitle )" />
        &mvte:global:altcattitle;
        That get the data to display, I should now be able to wrap a conditional around it
        Leslie Kirk
        Miva Certified Developer
        Miva Merchant Specialist since 1997
        Previously of Webs Your Way
        (aka Leslie Nord leslienord)

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

        Comment


          #5
          One point of clarification that I see a lot of folks miss.

          Product Level custom fields are different from others. For product level fields, each template that uses them, and has a Product 'item' assigned, gives you a select box to choose which product custom fields are 'read' into the page. For Category custom fields you HAVE to do that manually using the Red_Category_xxxx() functions. (We sometimes just do this in the Head or Profile tag so we don't have to repeat it when multiple pages use the cat custom fields.
          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