Main picture representing a gallery

boplive
@boplive
8 years ago
345 posts
Hi giys,

Is there a way that a member can have the option to be able to choose to have a main picture represent and directly relates to all the pitures of the gallery it just created.This to avoided having scatteredĀ  pictures all over the index gallery page or pages of the site...I prefer to have membersĀ  have the option to choose your 1 main picture to relate to all the pics of the gallery that has a title name..so if a member explores the sites gallery page and views a pic then clicks on that pic then of course the member get taken to the gallery page.this also minimizes to have 100s of pics scattered all over you then have a main picture to direct you to the gallery ..it's not cool at times being direct back and forth to a gallery that you view a day ago if a member added /updated a new pic in there gallery

Ed
updated by @boplive: 01/31/17 06:32:15PM
michael
@michael
8 years ago
7,718 posts
You can change it however you like.

These docs are related:

Docs: "Altering a modules template"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-developers-guide/1051/altering-a-modules-template

Docs: "Using the Form Designer"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-admin-handbook/1275/using-the-form-designer

Multiple ways to do it.

One way would be to add another IMAGE field to the gallery create form for the main image, then show that in the lists of things instead of the images in the gallery.

Another would be to add a checkbox to the individual images then search for those in the item_list.tpl module template so only images with a checkbox show.

Another way would be to show the first image only from the gallery in the item lists then drag+drop the image you want to represent the gallery into position 0.
boplive
@boplive
8 years ago
345 posts
Thnx Michael..I went with the second option...adding a checkbox to the individual images in the gallery_detail of the form designer...now working on finding the right search in the item_list.tpl for the slider to replace search="_item_id in `$_conf.n8ISkin4_list_2_ids`"
Or maybe i just need to add a search2
updated by @boplive: 10/31/16 06:38:12PM
michael
@michael
8 years ago
7,718 posts
its going to be search="(whatever you called the field) = on"
boplive
@boplive
8 years ago
345 posts
i just kept it simple and called it gallery_main
i tried the following ways below but nothing..not even an error

search="gallery_main = on"

search="gallery_main = `on`"

search="gallery_main = `$on`"
michael
@michael
8 years ago
7,718 posts
So set 3 images with that set to 'on', then make the simplest request you can make
{jrCore_list module="jrGallery" search="gallery_main = on"}

You should only get those 3 images back.
boplive
@boplive
8 years ago
345 posts
i tried that Michael..its coming out as the following..

thers like 3 pictures that i checked off in one profile and 2 othere pics in another profile..
http://www.spied.me/index3

i'll mess around with it again omorrow..its about 930pm here in NY..going to sleep soon. as i have to wake up at 6am tomorrow..thanks for your help earlier...if theress anything else i should do please let me know..thanks...enjoy your day Michael
updated by @boplive: 11/01/16 06:28:44PM
michael
@michael
8 years ago
7,718 posts
Need instructions/screenshot of how you've set it up then. Not understanding.
michael
@michael
8 years ago
7,718 posts
Think I understand. You're not getting why the whole gallery is being shown when you just want the images. The reason is the gallery modules item_list.tpl template is setup to show the full gallery.

You want just the single image, so you need a different row template. The correct results are being returned.

Try this:
{capture assign="row_template"}
{literal}
{if is_array($_items)}
 {foreach $_items as $item}
  {jrCore_module_function function="jrImage_display" module="jrGallery" type="gallery_image" item_id=$item._item_id size="large" alt=$item.gallery_alt_text}</a>
 {/foreach}
{/if}
{/literal}
{/capture}

{jrCore_list module="jrGallery" search="gallery_main = on" template=$row_template}
boplive
@boplive
8 years ago
345 posts
Hey Michael that did worked on my test page..thanks for your help on this..
you know I also tried to get this to work on the iskin4 home page index slider and it did not work...but I'm thinking the home page index is pulling from the config file..that is why is may not work and everything stays the same once I added the search="" function in the index_list.tpl file

Tags