Forum
Trying to upload a large image and smaller version of that image to resources
I have a template content file which outputs thumbnails to the page and, when clicked, displays a larger version of the image. I've included these lines of code:
<li><a href="<perch:content id="main_image" type="image" width="800" height="800" />" class="p7mbx-trigger" data-mbx="1" data-mbx-slide="<perch:content id="perch_item_index" type="hidden" /> "> <img src="<perch:content id="main_image" type="image" width="200" height="200" />" alt="Image"></a></li>
The 800x800 max version of the image is created but not the second. The page source shows:
<li><a href="/perch/resources/silenceafterthesong-w800h800.jpg" class="p7mbx-trigger" data-mbx="1" data-mbx-slide="1"><img src="/perch/resources/silenceafterthesong.jpg" alt="Image"></a></li>
If this is possible, what and I doing wrong? John
Please can we see your Diagnostics Report?
Is this template the only template used for this content? You need to create all images used in the master template for the content.
The master template includes Perch layout elements plus two perch_content items. The content element for these images being one of them.
This is the whole of content template:
That all looks ok to me. To be clear, there's only one template involved currently?
I think it's pretty straightforward. I have a file 2015.php as follows:
and /templates/pages/work.php :
And you've re-saved your content since changing the image sizes?
Yes, by clicking Save Changes. And I've added a couple of new images.
And I've just added another image: there are three files in resources filename.jpeg [94KB]; filename-thumb@2x.jpeg [16KB] and filename-w800h800.jpeg [88KB] the last two files having been processed by Kraken.
Any help if I create a new page using the same templates?
That might be a good troubleshooting step. It has to be something simple!
Well, I've tried a new page; with fresh images: and the result is the same. Switched on Debug and, although the output is difficult for me to read, I can see
but nothing for the 200x200 image.
That's really odd. Are all your images
.jpeg
? That's a more unusual file extension - is it any different with.jpg
? (clutching at straws.)No, they are mostly .jpg. I will try creating another page with a really simple template to output, to the page, the same image in two or three different sizes and see what happens.
I might have found an explanation for this. Here is a simplified template based on what I was tryin showing some Perch Content items within an <li>. The content is not output in the example I have done. It does output within a <ul> and elsewhere.
Ok, there's a lot going on here. Are you intending to reuse the same repeater, or is it indented to be a different repeater?
It needs to be the same repeater. I repeated some of the code (this is just an example) to see what happens. In my working (live) page I need to output the description fields within the <li> pair. I can simplify my example if this helps.
I'll run this example up and see if I can reproduce what you're seeing. It's an usual situation.
Thank you. It would be good to resolve this.