Plugin-Image icon indicating copy to clipboard operation
Plugin-Image copied to clipboard

Image works on {{grid}}?

Open jolupa opened this issue 12 years ago • 16 comments

Hi!

I'm trying to use the image plugin to resize some images on a grid but it seems that the plug-in is not working.

jolupa avatar Jan 29 '13 22:01 jolupa

Can u post your template code?

On Jan 29, 2013, at 5:49 PM, jolupa [email protected] wrote:

Hi!

I'm trying to use the image plugin to resize some images on a grid but it seems that the plug-in is not working.

— Reply to this email directly or view it on GitHubhttps://github.com/statamic/Plugin-Image/issues/3.

jackmcdade avatar Jan 30 '13 00:01 jackmcdade

Here's the code. To pass the variable "imagen" to the image plug-in I try single and double braces with no results.

  <div class="row">
    <div class="twelve columns">
      <ul class="block-grid six-up">
        {{ entries:listing folder="videojuegos/galeria" limit="6" }}
          {{ galeria limit="1" sort_by="random" }}
            {{ image src="{{ imagen }}" dim="300x200#" }}
              <li><img src="{{ image_src }}" width="{{ widht }}" height="{{ height }}" /></li>
            {{ /image }}
          {{ /galeria }}
        {{ /entries:listing }}
      </ul>
    </div>
  </div>

jolupa avatar Jan 30 '13 01:01 jolupa

Make sure to use single braces on any variables used in parameters.

On Jan 29, 2013, at 8:10 PM, jolupa [email protected] wrote:

Here's the code. To pass the variable "imagen" to the image plug-in I try single and double braces with no results.

    {{ entries:listing folder="videojuegos/galeria" limit="6" }} {{ galeria limit="1" sort_by="random" }} {{ image src="{{ imagen }}" dim="300x200#" }}
  • {{ /image }} {{ /galeria }} {{ /entries:listing }}

— Reply to this email directly or view it on GitHubhttps://github.com/statamic/Plugin-Image/issues/3#issuecomment-12868538.

jackmcdade avatar Jan 30 '13 01:01 jackmcdade

Ok. Changed all the variables to single bracees... nothing happens.

  <div class="row">
    <div class="twelve columns">
      <ul class="block-grid six-up">
        {{ entries:listing folder="videojuegos/galeria" limit="6" }}
          {{ galeria limit="1" sort_by="ramdon" }}
            {{ image src="{ imagen }" dim="300x200#" }}
              <li><img src="{ image_url }" width="{ widht }" height="{ height }" /></li>
            {{ /image }}
          {{ /galeria }}
        {{ /entries:listing }}
      </ul>
    </div>
  </div>

jolupa avatar Jan 30 '13 01:01 jolupa

Just the ones inside parameters. e.g. {{ image src="{ imagen}" }}

On Jan 29, 2013, at 8:20 PM, jolupa [email protected] wrote:

Ok. Changed all the variables to single bracees... nothing happens.

    {{ entries:listing folder="videojuegos/galeria" limit="6" }} {{ galeria limit="1" sort_by="ramdon" }} {{ image src="{ imagen }" dim="300x200#" }}
  • {{ /image }} {{ /galeria }} {{ /entries:listing }}
— Reply to this email directly or view it on GitHub.

jackmcdade avatar Jan 30 '13 01:01 jackmcdade

Changed... still not working.

jolupa avatar Jan 30 '13 01:01 jolupa

does {{ imagen }} give you a valid image path?

On Jan 29, 2013, at 8:32 PM, jolupa [email protected] wrote:

Changed... still not working.

— Reply to this email directly or view it on GitHub.

jackmcdade avatar Jan 30 '13 01:01 jackmcdade

Yes, if I remove the call to the image plug-in the images shows on the page, but without the dimensions I want.

jolupa avatar Jan 30 '13 01:01 jolupa

Have you tried the Image plugin that ships with Statamic? I can't remember if this repo is ahead of that or not at this point.

On Jan 29, 2013, at 8:35 PM, jolupa [email protected] wrote:

Yes, if I remove the call to the image plug-in the images shows on the page, but without the dimensions I want.

— Reply to this email directly or view it on GitHub.

jackmcdade avatar Jan 30 '13 01:01 jackmcdade

I'm using the one coming with statamic. In the same page I'm using the plug-in to resize another image, from a file fieldtype not a grid, without a problem.

jolupa avatar Jan 30 '13 01:01 jolupa

I see a few typos (e.g. sort_by="ramdon") and {widht} -- can you make sure they're not affecting anything? On Jan 29, 2013, at 8:42 PM, jolupa [email protected] wrote:

I'm using the one coming with statamic. In the same page I'm using the plug-in to resize another image, from a file fieldtype not a grid, without a problem.

— Reply to this email directly or view it on GitHub.

jackmcdade avatar Jan 30 '13 06:01 jackmcdade

Ok. Fixed the typos. Not working.

Checking the HTML for the page is not rendering the

<li>...</li>

tags (or other tags I put inside the {{image}}...{{/image}}

jolupa avatar Jan 30 '13 10:01 jolupa

Uf! I can't find the problem...

If a put this code

´´´

Galería

{{ entries:listing folder="videojuegos/galeria" limit="6" }} {{ galeria limit="1" }}
{{ /galeria }} {{ /entries:listing }}
´´´ The images show normally but I put the image plugin code and there's no images on the page. The place in the font page is blank. ´´´

Galería

{{ entries:listing folder="videojuegos/galeria" limit="6" }} {{ galeria limit="1" }}
{{ image src="{ imagen }" dim="200x150#" }} {{ /image }}
{{ /galeria }} {{ /entries:listing }}
´´´

jolupa avatar Jan 30 '13 22:01 jolupa

I haven't had any luck with the image plugin either. I've tried everything. I'm sure there's something about it that I'm missing...

logangreer avatar Mar 15 '13 16:03 logangreer

It outputs the HTML with the tags around the img src so it can't find the image.

<img src="{/assets/img/news/new-site.jpg}" width="111" height="111">

Instead of using my variable { post_image } I tried the url where my images are uploaded and I get a Slim Application Error with the problem on line 58 of the plugin's php file.

lukepearce avatar Mar 30 '13 22:03 lukepearce

Had the same issue. First of all, make sure that there are images written in cache. I removed em and then added double brackets everywhere: worked. Here's the code that worked for me, sorry for the shitty indentation.

 {{ galerie_grid limit="200" }}
                    {{ image quality="80" src="{{ galerie_image }}" dim="400x200>" }}
                        <img src="{{ image_url }}" width="{{ width }}" height="{{ height }}"/>
                    {{ /image }}
                {{/galerie_grid}}

fspoettel avatar Jun 02 '13 15:06 fspoettel