Announcement

Collapse
No announcement yet.

Custom Code on SFNT

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

    Custom Code on SFNT

    I am trying load a list of brand icons based on the custom field brandIconLinked on SFNT. I am still getting my feet we here with Miva . If anyone can help with this it would be appreciated. It compiles but loads blank with this if statement
    Code:
    <mvt:if expr="l.settings:category:customfield_values:customfields:brandIconLinked EQ 'Yes'">
    and loads a blank block without it.
    Thanks

    Code:
    <mvt:if expr="ISNULL g.categories_offset"><mvt:assign name="g.categories_offset" value="0" /></mvt:if>
    <mvt:assign name="l.search" value="1" />
    <mvt:assign name="l.searchable_fields" value="'active'" />
    <mvt:do file="g.Module_Library_DB" name="l.loadcats" value="CategoryList_Load_Offset(g.categories_offset, l.search, l.searchable_fields, g.categories_max, g.categories_next_offset, l.settings:categories)" /> 
    <section class="o-layout u-grids-2 u-grids-8--l x-product-list">
        <mvt:foreach iterator="category" array="categories">
              <mvt:if expr="l.settings:category:customfield_values:customfields:brandIconLinked EQ 'Yes'">
                <mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Category_Canonical(l.settings:category:id, l.settings:uri_info)" />
                <div class="o-layout__item u-text-center x-product-list__item">
                <a class="u-block x-product-list__link" href="&mvte:category:link;">
                <figure class="x-product-list__figure">
                    <mvt:if expr="l.settings:category:image">
                        <center><img class="x-product-list__image" src="&mvt:category:image;"></center>
                    </mvt:if>
                <figcaption>
                    <!-- Start  MOD to use shortCatName -->
                    <mvt:item name="customfields" param="Read_Category_Code(l.settings:category:code,'shortCatName',g.Custom_Fields)" />
                        <mvt:if expr="NOT ISNULL trim(g.Custom_Fields)">
                            <strong class="x-product-list__name u-text-uppercase">&mvte:global:Custom_Fields;</strong>
                        <mvt:else>
                               <strong class="x-product-list__name u-text-uppercase">&mvte:subcategory:name;</strong>
                        </mvt:if>
                    <!-- End  MOD to use shortCatName -->
                </figcaption>
                </figure>
                </a>
                </div>
              </mvt:if>
        </mvt:foreach>
    </section>

    #2
    So I have this working now but now for the life of me I cannot figure out why the images will not display?
    This little snippit
    Code:
    <center><img class="x-product-list__image" src="&mvte:category:image;"></center>
    works for me on my CTGY but not on the SFNT. That is the last thing. Any ideas let me know. Thanks

    Code:
    <mvt:if expr="ISNULL g.categories_offset"><mvt:assign name="g.categories_offset" value="0" /></mvt:if>
    <mvt:if expr="ISNULL g.categories_offset"><mvt:assign name="g.categories_offset" value="0" /></mvt:if>
    <mvt:assign name="l.search" value="1" />
    <mvt:assign name="l.searchable_fields" value="'active'" />
    <mvt:do file="g.Module_Library_DB" name="l.loadcats" value="CategoryList_Load_Offset(g.categories_offset, l.search, l.searchable_fields, g.categories_max, g.categories_next_offset, l.settings:categories)" /> 
    <section class="o-layout u-grids-2 u-grids-8--l x-product-list">
        <mvt:foreach array="categories" iterator="category">
            <mvt:item name="customfields" param="Read_Category_Code(l.settings:category:code,'brandIconLinked',g.Custom_Fields)" />
            <mvt:if expr="NOT ISNULL trim(g.Custom_Fields)">  
                <mvt:do file="g.Module_Feature_URI_DB" name="l.success" value="URI_Load_Category_Canonical(l.settings:category:id, l.settings:uri_info)" />
                <div class="o-layout__item u-text-center x-product-list__item">
                <a class="u-block x-product-list__link" href="&mvt:uri_info:uri;">
                <figure class="x-product-list__figure">
    
                        <center><img class="x-product-list__image" src="&mvte:category:image;"></center>
    
                <figcaption>
                    <!-- Start  MOD to use shortCatName -->
                    <mvt:item name="customfields" param="Read_Category_Code(l.settings:category:code,'shortCatName',g.Custom_Fields)" />
                        <mvt:if expr="NOT ISNULL trim(g.Custom_Fields)">
                            <strong class="x-product-list__name u-text-uppercase">&mvte:global:Custom_Fields;</strong>
                        <mvt:else>
                               <strong class="x-product-list__name u-text-uppercase">&mvte:category:name;</strong>
                        </mvt:if>
                    <!-- End  MOD to use shortCatName -->
                </figcaption>
                </figure>
                </a>
                </div>
              </mvt:if>
        </mvt:foreach>
    </section>

    Comment


      #3
      Check to make sure the storefront has all page items (items tab) that the category page does. Sometimes the same code will work on one page but not the other if it doesn't have all the page items the other page has.
      M.A.D.* since 1997

      http://www.scotsscripts.com

      *miva application developers

      Comment


        #4
        Thanks I was able to resolve

        Comment

        Working...
        X