Simple question regarding the building of an image gallery using these great extensions, together with the Imgsizer plugin.
Basically I am looking for the best way to parse the rows from an FF Matrix containing the nGen File Field, so that the first image can be styled or handled differently from any additional images. An obvious thing to want to do, with a probably obvious solution that I can’t puzzle out.
I’ve wrestled with several ideas and solutions, but none of them seem to stick. If an offset tag was available to {my-ffmatrix-gallery-field} it would be easier, but as it is I can’t find a good method for applying a different image size to the first image from the FF matrix.
I was inclined to use an if/else with row_count, but I’m not getting the result I want. Can anyone give me a hint?
This is by the way something close to what I’d like to do, which obviously doesn’t work for lack of an offset param…and perhaps many other reasons.
{exp:weblog:entries weblog="{my_weblog}" limit="1" category="{my_category}" orderby="date" sort="desc" disable="member_data|trackbacks" status="open|featured"}
{if images}
{images limit="1"}
{exp:imgsizer:size src="{image_path}" width="500"}
<a href="http://{sized}" title="{title}" class="gallery-image">{exp:imgsizer:size src="{image_path}" width="550" alt="{title}" id="image_{entry_id}" class="entry_img"}</a><br>
{/exp:imgsizer:size}
{/images}
{if images:total_rows > 1}
{images offset="1"}
{exp:imgsizer:size src="{image_path}" width="50" height="50"}
<a href="http://{sized}" title="{title}" class="gallery-image">{exp:imgsizer:size src="{image_path}" height="150" alt="{title}" id="image_{entry_id}" class="entry_img"}</a>
{/exp:imgsizer:size}
{/images}
{/if}
{/if}
{/exp:weblog:entries}
Can you please explain why {row_count} didn’t work ? The simplest solution for me seems to use that. If {row_count} == 1, dispay the large image and otherwise, display the small images.
{exp:weblog:entries weblog="{my_weblog}" limit="1" category="{my_category}" orderby="date" sort="desc" disable="member_data|trackbacks" status="open|featured"}
{images}
{if {row_count} == 1}
{exp:imgsizer:size src="{image_path}" width="500" alt=""}
{if:else}
{exp:imgsizer:size src="{image_path}" width="50" height="50" alt=""}
{/if}
{/images}
{/exp:weblog:entries}
Have not tested it but I think it should work.
Hi,
I’m also trying to build an image gallery using Ngen File field and FFmatrix. I can see how you could easily generate your table of thumbnails using the FFmatrix tag pair. What I can seem to figure out is how to do a prev/next button once you are on the photo detail page. So if you clicked on a thumbnail and it took you to the full size image how would you then be taken to the next or previous image in the loop? Could this be done with the {row_count} also?
Like {if {row_count} == +1} Next {/if}
Any ideas?
Thanks so much.
@fdoney
Here is how I did previous and next links with another setup for picture galleries (still using the same plugins/extensions. You could certainly make it work your way. See the code I posted in this thread.
HTH
Hi g-rom,
I’m having the same problem as Steve Hurst here:
http://ellislab.com/forums/viewthread/108082/P36/#562110
The {row_count} seems to equal the individual cell count and the {total_rows} variable seems to indicate just the total number of rows and not all the individual cells.
So I’m using FF matrix with two columns and my {row_count} goes up to 8 on one entry but my {total_rows} is only 4. This is making my previous/next buttons not work because my activepicture row count is indicated as more than my total rows so the next button doesn’t show when it should in the conditional statement.
Have you run into this?
Thanks
Sorry to keep bugging you g-rom. I upgraded to fieldframe 1.1.2 and that fixed the {row_count} issue.
One more issue I’m having:
The photo in my fourth ffmatrix row is not displaying. Every other photo shows up fine. Do you think this might have to do with:
fetch_uri_segment(‘4’);
in the PHP? Could there be some kind of conflict happening with the 4’s?
Thanks again.
Hello fdoney,
Had the {row_count} issue as well. Quickly fixed though.
As for the secondissue you describe, I have not run into this myself. I cannot see how the PHP could impact that. It’s parsed before the rest of the code and only fetches a URL segment … strange …
Have you tried to display / echo the various values to see what happens when the fourth image should be displayed ?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.