Announcement

Collapse
No announcement yet.

Fragment isn't working

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

    Fragment isn't working

    I have created a couple of Fragments now, most of them work, but the ones that have Custom Product Fields in them don't seem to want to work. I need to include YouTube videos or Audio in one of the tabs in the Page Builder Product Details Component Product Tabs. I've used the Legacy coding in the Fragment, but neither of these works:

    Code:
     <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :YOUTUBE">
    <h2>Video</h2>
    
    <div style="padding-top:8px;text-align:left;"><iframe width="480" height="360" src="https://www.youtube.com/embed/&mvt:product:customfield_values:customfields:YOUTUBE;" frameborder="0" allowfullscreen></iframe></div>
    </mvt:if>
    or

    Code:
    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :AUDIO">
    <div class="custom-field" id="customfields-AUDIO"><span class="bold"><audio id="audioplayer" controls=""><source src="&mvt:product:customfield_values:customfields: AUDIO;" type="audio/mpeg">Your browser does not support the audio element. </audio></span></div>
    </mvt:if>

    What am I doing wrong?
    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

    #2
    Hey Leslie,

    Do you have the custom field set to "Public"?
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Originally posted by Matt Zimmermann View Post
      Hey Leslie,

      Do you have the custom field set to "Public"?
      Hey Matt Zimmermann! Yes and yes. Both are set to Public.
      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
        lesliekirk make sure the fragment has the customfields item assigned and use the read customfield function to pull in the value.
        Nicholas Adkins
        Technical Training Specialist / Miva, Inc.
        [email protected]
        https://www.miva.com/mivalearn

        Comment


          #5
          Originally posted by Nick View Post
          lesliekirk make sure the fragment has the customfields item assigned and use the read customfield function to pull in the value.
          The customfields item was assigned, but the read customfield function was not in use. (Old Legacy coding was). Now to figure out two different custom fields for videos
          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

          Working...
          X