Announcement

Collapse
No announcement yet.

Ready Theme Image & Alt Text

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

    Ready Theme Image & Alt Text

    Is there a way to get more at the core of the ready theme image item? It would be great if I could "print" the alt text, so wherever a ready theme image appears, I can have text just below it, and wrap it all in an anchor tag. I have been able to use jquery to get the alt text to show below the image, but I'd like to use actual text instead. Any ideas?
    Ted Hust
    AarcMediaGroup.com

    Celebrating 13 Years of Outstanding Service & Support
    Miva Merchant Design

    #2
    Re: Ready Theme Image & Alt Text

    See the functions at the bottom of this page:

    http://www.miva.com/videos/articles/...-documentation

    This will allow you to load all the contents of the image item into variables:

    Code:
    <mvt:item name="readytheme" param="Load_Image('promo_1',g.promo)" />
    
     
    
    Sample Output:
    
     
    
    &mvt:global:promo:active;
    
    &mvt:global:promo:code;
    
    &mvt:global:promo:css_class;
    
    &mvt:global:promo:css_id;
    
    &mvt:global:promo:id;
    
    &mvt:global:promo:image_alt;
    
    &mvt:global:promo:image_hght;
    
    &mvt:global:promo:image_id;
    
    &mvt:global:promo:image_size;
    
    &mvt:global:promo:image_wdth;
    
    &mvt:global:promo:link_dest;
    
    &mvt:global:promo:link_targ;
    
    &mvt:global:promo:link_type;
    
    &mvt:global:promo:name;
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Ready Theme Image &amp; Alt Text

      I know this is going to be a dumb question, but what the heck is the image path variable? I've tried &mvt:global:promo_1:image; and a few others. I can get the Name, link target, alt and all that to show just fine. Just can't get the dang image path variable figured out.
      Ted Hust
      AarcMediaGroup.com

      Celebrating 13 Years of Outstanding Service & Support
      Miva Merchant Design

      Comment


        #4
        Re: Ready Theme Image &amp; Alt Text

        Here's what I was trying......

        Code:
                        <mvt:item name="readytheme" param="Load_Image('promo_1',g.promo_1)" />
                        <mvt:if expr="g.promo_1 GT 0">
                            <a href="&mvt:global:promo_1:link_dest;" class="promo-item">
                                <img src="&mvt:global:promo_1:image;" class="img-responsive" /><br />
                                &mvt:global:promo_1:image_alt;
                            </a>
                        </mvt:if>
        Code:
                        <mvt:item name="readytheme" param="Load_Image('promo_1',g.promo_1)" />
                        <mvt:if expr="g.promo_1 GT 0">
                            <a href="&mvt:global:promo_1:link_dest;" class="promo-item">
                                <img src="&mvt:global:promo_1:image_source;" class="img-responsive" /><br />
                                &mvt:global:promo_1:image_alt;
                            </a>
                        </mvt:if>
        Ted Hust
        AarcMediaGroup.com

        Celebrating 13 Years of Outstanding Service & Support
        Miva Merchant Design

        Comment


          #5
          Re: Ready Theme Image &amp; Alt Text

          in the Load_Image() function there are two parameters. The first one needs to be the code of the image you are trying to load. It should match the code you have defined for the image in ReadyThemes.

          The second parameter is the variable you want to load the data into. It can be anything you want. g.image, g,my_image, g.homepage_image, etc

          Depending on the name is how you will reference the data:

          If you name it g.homepage_image then the data will be accessed:

          g.homepage_image:image_alt; (&mvt:global:homepage_image:image_alt;)

          Edit: Re-read your post. I don't think the image path is included in the variables. Looks like it may have been on oversight on our end. I will file a bug on it.
          Last edited by Brennan; 02-12-15, 09:29 AM.
          Brennan Heyde
          VP Product
          Miva, Inc.
          [email protected]
          https://www.miva.com

          Comment


            #6
            Re: Ready Theme Image &amp; Alt Text

            Yeah, I got all of the others to work. I assumed it would have just ben &mvt:global:promo_1:image; and I tried others as well. Is this something that won't roll out for quite a bit? I'll use the jquery method for displaying the alt tag for now. It will do until this gets fixed up.
            Ted Hust
            AarcMediaGroup.com

            Celebrating 13 Years of Outstanding Service & Support
            Miva Merchant Design

            Comment


              #7
              Re: Ready Theme Image &amp; Alt Text

              This should be fixed in 9.0003
              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment


                #8
                Re: Ready Theme Image &amp; Alt Text

                Originally posted by aarcmedia View Post
                Yeah, I got all of the others to work. I assumed it would have just ben &mvt:global:promo_1:image; and I tried others as well. Is this something that won't roll out for quite a bit? I'll use the jquery method for displaying the alt tag for now. It will do until this gets fixed up.
                If you're using the 5.21 engine or higher, you could do the following in the mean time:

                Code:
                <mvt:item name="readytheme" param="Load_Image( 'code', g.RT_Image )" />
                <mvt:do name="l.null" file="g.Module_Library_DB" value="Image_Load_ID( g.RT_Image:image_id, g.MM_Image )" />
                    
                <mvt:if expr="NOT ISNULL g.MM_Image">
                      <img src="&mvt:global:MM_Image:image;" />
                </mvt:if>
                Last edited by dcarver; 02-12-15, 10:42 AM.
                David Carver
                Miva, Inc. | Software Developer

                Comment

                Working...
                X