Announcement

Collapse
No announcement yet.

Toolkit cxp - need help with replacement

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

    Toolkit cxp - need help with replacement

    Getting closer to removing toolkit on my category pages and have one last piece I needed help with.

    <mvt:item name="toolkit" param="cxp|pcount|l.all_settings:subcat:id" />

    Any suggestions?

    Thanks,
    Mike

    #2
    Here is a link to a number of toolkit replacement snippets: https://docs.miva.com/template-langu...ement-examples

    Here is a link to the CXP replacement: https://snippets.cacher.io/snippet/0577b1f844dddc4070ab


    Code:
    <mvt:comment>load all prodcts assigned to a spcific category </mvt:comment>
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( l.settings:subcat:id, l.settings:current_category )" />
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Runtime_ProductList_Load_Offset_Category( l.settings:current_category:id, g.Offset, 100, g.NextOffset, l.settings:products )" />
    
    <mvt:foreach iterator="product" array="products">
    &mvt:product:code;<br>
    </mvt:foreach>
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      Thanks Nick, tried that and still no luck. This is what I am trying to finish below, the script (in red) isn't working using that. Once I replace the cxp function with that my script stops working.

      I tried to cleanup my page a little so it isn't so confusing below.

      Code:
      <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( l.settings:category:code, l.settings:current_category )" />
      <mvt:do name="l.result" file="g.Module_Library_DB" value="Runtime_CategoryList_Load_Parent( l.settings:current_category:id, l.settings:sub_cats )" />
      
      <mvt:if expr="l.settings:sub_cats">
      
      <table border="0" cellpadding="10" cellspacing="0">
      <!--Begin New Row-->
      <tr>
      <mvt:assign name="g.catcounter" value="'1'" />
      <mvt:foreach iterator="subcat" array="sub_cats">
      <mvt:assign name="g.2dcatcounter" value="padl(g.catcounter,2,'0')" />
      <mvt:item name="toolkit" param="cxp|pcount|l.all_settings:subcat:id" />
      
      <td valign="top" align="left">
      <!--Begin-->
      <table width="175" cellspacing="0" cellpadding="0" border="0">
      <tbody><tr class="item">
      <td class="item" valign="top"><img width="12" height="25" src="images/tble_top_lft3.gif"><br></td>
      <td class="item" valign="top">&mvt:subcat:name;<br></td>
      <td class="item" valign="top"><img width="12" height="25" src="images/tble_top_rgt3.gif"><br></td>
      </tr>
      <tr class="item2">
      <td class="item2"><img width="1" height="130" src="images/spbl.gif"><br></td>
      <td class="item3">
      <mvt:foreach iterator="sub_product" array="sub_products">
      <mvt:if expr="pos2 EQ 1">
      <img width="130" height="130" name="&mvt:subcat:code;" src="//www.url.com/&mvt:sub_product:thumbnail;"><br>
      </mvt:if>
      </mvt:foreach>
      </td>
      <td class="item2"><img width="1" height="130" src="images/spbl.gif"><br></td>
      </tr>
      <tr class="item2">
      <td class="item3" colspan="3">
      <!-- images -->
      <mvt:assign name="g.prodcounter" value="'1'" />
      <scr!pt >
      var prodlinks = '';
      <mvt:foreach iterator="sub_product" array="sub_products">
      <mvt:assign name="g.2dprodcounter" value="padl(g.prodcounter,2,'0')" />
      &mvt:global:prodcounter;
      <mvt:if expr="g.prodcounter LT 25">
      prodlinks += '<a href="/&mvt:sub_product:image;" class="modal-image" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage(\'&mvt:subcat:code;\',\ '\',\'//www.url.com/&mvt:sub_product:thumbnail;\',0),MM_swapImage(\'nu m&mvt:global:2dprodcounter;_&mvt:subcat:code;\',\' \',\'images/&mvt:global:2dprodcounter;_r.gif\',0),link(\'Cl ick Here to Enlarge\');return true\"><img src=\"images/&mvt:global:2dprodcounter;.gif\" alt=\"Click Here to Enlarge\" name=\"num&mvt:global:2dprodcounter;_&mvt:subcat:c ode;\" border=\"0\" width=\"18\" height=\"18\"></a>';
      <mvt:if expr="(g.prodcounter LT 24) AND (g.prodcounter MOD 8 EQ 0)">
      prodlinks += '<br>';
      prodlinks += '<img src=\"images/spbl.gif\" width=\"175\" height=\"2\">';
      <mvt:else>
      prodlinks += '<img src=\"images/spbl.gif\" width=\"2\" height=\"18\" alt=\"\">';
      </mvt:if>
      <mvt:assign name="g.prodcounter" value="prodcounter+1" />
      </mvt:if>
      </mvt:foreach>
      document.write(prodlinks);
      </scr!pt>
      </td>
      </tr>
      <tr>
      <td colspan="3">
      <a onmouseover="MM_swapImage('tble_view_&mvt:subcat:c ode;&mvt:global:2dcatcounter;','','../images/tble_view3_r.gif',0),link('&mvt:subcat:name;');ret urn true" onmouseout="MM_swapImgRestore()" target="_top" href="&mvt:global:sessionurl;Screen=CTGY&Category_ Code=&mvt:subcat:code;"><img width="87" height="24" border="0" alt="View All &mvt:subcat:name;" src="../images/tble_view3.gif" name="tble_view_&mvt:subcat:code;&mvt:global:2dcat counter;"></a><img width="1" height="24" alt="" src="images/sp.gif"><a onmouseover="MM_swapImage('tble_pricing_&mvt:subca t:code;&mvt:global:2dcatcounter;','','../images/tble_pricing3_r.gif',0),link('Pricing');return true" onmouseout="MM_swapImgRestore()" href="../images/products/pricing/POS_pricing.jpg" class="modal-image"><img width="87" height="24" border="0" alt="Pricing" src="../images/tble_pricing3.gif" name="tble_pricing_&mvt:subcat:code;&mvt:global:2d catcounter;"></a><br>
      </td>
      </tr>
      </tbody></table>
      <!--End-->
      </td>
      <mvt:if expr = "(pos1 MOD 4 ) EQ 0">
      </tr><tr>
      </mvt:if>
      <mvt:assign name="g.catcounter" value="catcounter+1" />
      </mvt:foreach>
      </tr>
      <!--End Row-->
      </table>
      </mvt:if>

      Comment


        #4
        In the code snippet that I sent it is adding the products to the l.settings:products array structure. In your template code you are looping through the l.settings:sub_products array structure.

        Make sure that you either update the value in my code to be sub_products or you change your code to loop through the products array.
        Nicholas Adkins
        Technical Training Specialist / Miva, Inc.
        [email protected]
        https://www.miva.com/mivalearn

        Comment

        Working...
        X