Page 1 of 1

Is it possible to use 3,2,1 for Grid layout, but have only a single folder that's centre-justified?

Posted: 28 Jul 2023, 07:15
by JMM
Hello again, Karl,

This question pertains to galleries (folders) that are set to use Grid layout.  And I am also aware of how to use the Columns Amount numbers for large/medium/small screens  :slight_smile:.

At present (and possibly for the foreseeable future), I have a small number of folders that currently have only 1 gallery (folder) in them.  I wish to use Grid layout for these folders, in order to display the gallery name above and folders/amounts below the preview images.

Selecting just 1 for Columns Amount, be it 1,1,1 (or just 1), the preview image is much too large for my liking, even when I have Folders Layout Width set to Narrowest.  Same thing for a Columns amount of 2.  I find that a column amount of 3 for single-folder galleries is much-more to my liking.

I have created a Slider HERE, to illustrate what I am talking about.  On the right side of the slider, the preview image shows that preview image much too large for what I want, with the folders/amounts below the bottom of the screen (requiring scrolling).  The left side of the slider shows the preview image with a size that I like, using the default settings of 3,2,1 and a Column Width of Default.  However, because I have at present only 1 folder, that folder is showing left-justified, instead of centred which is what I wish.

So my question is: is there a way that I can trick X3 into displaying that single folder centre-justified?  The other option would be to use just 1 for the folder amount, but somehow limit the height of the preview image.  I would assume, though, that the easiest method would be to centre-justify the single folder?

Thank you in advance & have yourself a great day.

Regards,
John

Re: Is it possible to use 3,2,1 for Grid layout, but have only a single folder that's centre-justified?

Posted: 29 Jul 2023, 06:18
by mjau-mjau
I understand why it may look strange with only one folder. It would be similar in any file viewer or online album of course. It's always going to be a grid, and you can of course change to a single column, although as you mention, it may look too large. "Centering" single items and keeping them small isn't really a logical operation from a grids perspective ... A grid will have columns, and if you choose 1 column, that column spans the width.

In your case, you are basically asking for a non-grid view with a single item limited to a custom width. To achieve that, you would just select 1 grid element, and then reduce the size and center it via CSS (I would have to test to provide actual example).

Optionally, since you want a custom layout, you could hide the folders layout, and simply add a thumbnail-link manually to the content section. More clumsy to maintain, but easier when creating a custom layout.
JMM wrote:So my question is: is there a way that I can trick X3 into displaying that single folder centre-justified? The other option would be to use just 1 for the folder amount, but somehow limit the height of the preview image. I would assume, though, that the easiest method would be to centre-justify the single folder?
The solution would be to use 1 for folder amount and limit the width.

You can't really 'centre-justify' grid items. If the grid has 3 items, then they are aligned 1-2-3. If you only have one grid item, then it's not aligned.

Re: Is it possible to use 3,2,1 for Grid layout, but have only a single folder that's centre-justified?

Posted: 31 Jul 2023, 09:26
by JMM
Thanks for your reply.

As this layout would be used so very rarely, and on some of my X3 sites never, my work-around is to just use simple Content page to display the single folder:
Code
<div>
     <center>
          <b>Test folder name</b>
               <br>
          <a href="https://galleries.fusionwings.com/test_area/test_folder/">
               <img src="{{path}}13452_emoji.png" width="300">
          </a>
     </center>
</div>
With the above test, I've hidden the actual folder, and just relying on the code in Content to display the single folder, centred hortizontally.

This method doesn't have your nice little icons for amount and folders_amount, but I can live without them when using this method.

Thanks again for your reply, and have a grewat day.

Regards,
John

Re: Is it possible to use 3,2,1 for Grid layout, but have only a single folder that's centre-justified?

Posted: 31 Jul 2023, 10:14
by mjau-mjau
Looks good.

PS! You might want to make a habit of using root-relative HREF links. This way, if you ever change the domain name or migrate the website, the url's will still work.
Code
<a href="/test_area/test_folder/">
Paths that start with /slash means the link is relative to the domain root.