solved Image Galleries - Suppress gallery name/length, order by

Clay Gordon
Clay Gordon
@claygordon
11 years ago
744 posts
When the length of the gallery name, image name, and member exceeds a certain length, the image flow gets interrupted, as can be seen in the attached screenshot.

I can go in to the data browser and edit instances that cause the problem but that's a level of data hygiene I don't want to go into.

I really don't need to see the gallery names and the presence of large numbers there (evidence of people posting single images) is duplicative in many cases.

How do I suppress the gallery name in the listing?

Secondly,

When I do go in and edit a gallery name, the image datestamp gets modified and it moves to the front position. I really don't want this to happen.
jpg
 •  261KB


updated by @claygordon: 02/02/15 01:24:58PM
douglas
@douglas
11 years ago
2,804 posts
One way to fix that is to use a truncate on the title variable.

For example change this:

<a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item.gallery_title_url}/all" class="media_title">{$item.gallery_title}</a><br>

to this:

<a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item.gallery_title_url}/all" class="media_title" title="{$item.gallery_title}">{$item.gallery_title|truncate:25:"...":false}</a><br>

Hope this helps! :)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
brian
@brian
11 years ago
10,149 posts
Looking at that screenshot there should be a clearing div below each row of 4 so the next row cannot get "hung" on the row above it - Douglas can you check that out?

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
douglas
@douglas
11 years ago
2,804 posts
A clearing div won't help. The problem is the title is too long and takes up space for the next image, so it gets pushed down.

I seen this before and the only solution was to shorten the title.

Thanks!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
brian
@brian
10 years ago
10,149 posts
douglas:
A clearing div won't help. The problem is the title is too long and takes up space for the next image, so it gets pushed down.

I seen this before and the only solution was to shorten the title.

Thanks!

Based on the screenshot above, the reason that first image in the second row is pushed down is because there is no clearing div. All the images in the first row should be the same height as the tallest div - which I can see they are not, so the clearing div will fix this.

I can check it out.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Clay Gordon
Clay Gordon
@claygordon
10 years ago
744 posts
douglas:
One way to fix that is to use a truncate on the title variable.

For example change this:

<a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item.gallery_title_url}/all" class="media_title">{$item.gallery_title}</a><br>

to this:

<a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item.gallery_title_url}/all" class="media_title" title="{$item.gallery_title}">{$item.gallery_title|truncate:25:"...":false}</a><br>

Hope this helps! :)

@Brian -

It would be helpful for me - and maybe others, too, if you included the file to edit and the line number(s) for the original code snippet. I am still learning where everything is. I did find it, in jrGallery_index.tpl near the top. And it does work.

@Douglas - As for the clearing div, that, or something similar, sounds like a more robust long-term solution.

Thanks,
:: Clay
updated by @claygordon: 01/01/15 02:15:15PM
douglas
@douglas
10 years ago
2,804 posts
Before trying to add in the clearing div, replace your skins/jrNingja/jrGallery_index.tpl file with this code:

{jrCore_include template="header.tpl"}

{capture name="template" assign="tpl"}
{literal}
{jrCore_module_url module="jrGallery" assign="murl"}
{if isset($_items)}
<div class="container">
        {foreach from=$_items item="item"}
{if $item@iteration == 1 || $item@iteration == 5 || $item@iteration == 9}
    <div class="row">{/if}
        <div class="col3{if $item@iteration == 4 || $item@iteration == 8 || $item@last} last{/if}">
            <div class="img-profile">
                <a href="{jrGallery_get_gallery_image_url item=$item}" title="{$item.gallery_alt_text}">{jrCore_module_function function="jrImage_display" module="jrGallery" type="gallery_image" item_id=$item._item_id size="large" crop="auto" class="iloutline img_scale" alt=$item.gallery_image_name title=$item.gallery_alt_text}</a><br>
            </div>
            <div class="center mb10">
                <a href="{jrGallery_get_gallery_image_url item=$item}" title="{$item.gallery_alt_text}" class="bold">{if isset($item.gallery_image_title)}{$item.gallery_image_title|truncate:30:"...":false}{else}{$item.gallery_image_name|truncate:30:"...":true}{/if}</a><br>
                <a href="{$jamroom_url}/{$item.profile_url}/{$murl}/{$item.gallery_title_url}/all" class="media_title">{$item.gallery_title}</a><br>
                <a href="{$jamroom_url}/{$item.profile_url}" style="margin-bottom:10px"><span class="capital">@{$item.profile_url}</span></a>
            </div>
        </div>
{if $item@iteration == 4 || $item@iteration == 8 || $item@last}
	</div>
{/if}
        {/foreach}
</div>
{/if}
{/literal}
{/capture}

<div class="block">

    <div class="title">
        {jrSearch_module_form fields="gallery_title,gallery_image_title,gallery_caption,gallery_description,gallery_image_name"}
        <h1>{jrCore_lang module="jrNingja" id=36 default="Images"}</h1>
    </div>

    <div class="block_content">
        <div class="item">
            <div class="container">
                <div class="row">
                    {jrCore_list module="jrGallery" order_by="_updated numerical_desc" require_image="gallery_image" pagebreak=12 page=$_post.p pager=true template=$tpl}
                </div>
            </div>
        </div>
    </div>

</div>

{jrCore_include template="footer.tpl"}

and let me know if that fixes it.

Thanks!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Clay Gordon
Clay Gordon
@claygordon
10 years ago
744 posts
@Douglas -

That *does* solve the problem and I will mark it so.

I'd have to run a DIFF to see where the change is, I'm not familiar enough with either the code or PHP to pick it out in a casual read.

:: Clay
douglas
@douglas
10 years ago
2,804 posts
Glad to hear it.

I'll get it added in for the next release.

Thanks! :)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

Tags