Announcement

Collapse
No announcement yet.

removing white space when no attributes assigned

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

    removing white space when no attributes assigned

    On my product templates a row of white space displays when product attributes are not assigned to a given product. I'd like for that row of white space to not render when a product has no attributes assigned.

    The white space renders because the attribute display is nested in HTML tags like so...

    Code:
    <tr><td>
      <mvt:item name="product_attributes" param="product:id" />
    </td></tr>
    Can you wrap the above code in a conditional so the <tr> and <td> don't display unless attributes are assigned? Something like...

    Code:
    <mvt:if attributes are assigned to this product display the following>
    <tr><td>
    <mvt:item name="product_attributes" param="product:id" />
    </td></tr>
    </mvt:if>
    Guy Turck
    The Glass Baby Bottle - Toxin Free Essentials for Babies & Toddlers

    #2
    Re: removing white space when no attributes assigned

    What happens if you do something like:

    Code:
    <mvt:if expr="g.Product_Attribute_Count">
    <tr><td>
    <mvt:item name="product_attributes" param="product:id" />
    </td></tr>
    </mvt:if>

    Comment


      #3
      Re: removing white space when no attributes assigned

      The attributes don't display at all, even if assigned, though the white space is removed.

      This is the sort of thing I was thinking could be done though, thanks Leanne.
      Guy Turck
      The Glass Baby Bottle - Toxin Free Essentials for Babies & Toddlers

      Comment


        #4
        Re: removing white space when no attributes assigned

        Take two. Try this:

        Code:
        <mvt:if expr="l.settings:attr_count GE 1">
        <tr><td>
        <mvt:item name="product_attributes" param="product:id" />
        </td></tr>
        </mvt:if>

        Comment


          #5
          Re: removing white space when no attributes assigned

          The attribute count is not determined until this line of code runs.
          <mvt:item name="product_attributes" param="product:id" />

          Hence, catch-22. If you have the Emporium Plus Tool Kit there is a function in there that determines if a product has any attributes. You can see how I use it on this page.
          http://www.pinemporium.com/mm5/merch...fset=&master=1 If there are attributes, you get a Details link. If not, you can fill in the quantity and do a bulk add from that page.

          Then again, maybe Leanne's take two will work. ;-)
          Last edited by wcw; 08-14-09, 04:07 PM.
          Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
          Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
          Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
          Facebook http://www.facebook.com/EmporiumPlus
          Twitter http://twitter.com/emporiumplus

          Comment


            #6
            Re: removing white space when no attributes assigned

            It's working in my test store. Guess we'll see!

            Comment


              #7
              Re: removing white space when no attributes assigned

              Leanne, that works perfectly. Thanks again to you and Bill!
              Guy Turck
              The Glass Baby Bottle - Toxin Free Essentials for Babies & Toddlers

              Comment

              Working...
              X