Hello,
I would like to know how I can center the images in the slideshow. I tried different solution with css files and also with the tpl files of the matric theme but I was not successful.
I would like to know how to center an image when you display a single image in an album.
Thanks for your help
P.S. : I'm using G2 of course. The version is the beta 2 "Holy hand grenade".
OD
Posts: 11
Hello there,
Has somebody a clue how to do this! I am also interested in the solutions!
Thanks...
NewBie
Posts: 8601
Slideshow: make a local Slideshow.tpl that changes:
<div class="gbItemImage">
to:
<div class="gbItemImage" style="text-align: center">
matrix or classic layout, singleBody.tpl:
<div class="gbBlock">
to:
<div class="gbBlock" style="text-align: center">
The 2nd only works w/o imageframes.. let me know if you'd like to center with imageframes.. i'll make a little change so you can do this with css.
Posts: 11
Thx mindless...
Cool it works perfect for me..
The answer to your questions! It would be cool if that is possible..
Regards,
NewBie
Posts: 8601
Get tomorrow's nightly snapshot and you can center images in matrix/classic with a local layout.css that adds this:
Posts: 9
Thanks mindless for your answer.
I have to add a few things. My G2 installation was done first with the "holy hand grenade" and after that I upgraded to the "bingo" version and to your CVS version. After this different upgrades, your css modification didn't work. However your first suggestion was working. For other reasons I decide to do a clean install from scratch and then your css file started to work. I must also say that although I was using a fresh install I wanted to reuse the different personalized files that I had previously created in "local" directories. Each time that I tried to use this older files (tpl, css files) the gallery installation started to behave not normally. So, I had to re-create all my personalized files from the orignal files in the gallery CVS version.
Thanks again.
O.D.
Posts: 24
when you say that you should place a local folder do you mean in the same directory as the file you edit of do you mean in one single file within gallery named local? Thanks Sparkey.
Posts: 8601
there are instructions in every tpl file.. make a directory called local in the same directory as the file.
Posts: 1
It took me a while to find this, so I thought I'd share. I was trying to center images with a drop shadow http://www.alistapart.com/articles/cssdropshadows/, but because the drop shadow requires the <div> to be float:left it just wouldn't work (neither of the solutions above worked for me). But I eventually found the answer. If you place the image <div> inside another <div> with CSS like this:
#middle {
display: table;
padding: 0;
margin: 0 auto;
white-space: nowrap;
}
It will centre the float:left element contained within it. My template now looks like this:
<div id="middle">
<div id="gallery-photo">
<img id="slide" alt="" src="" name="slide">
</div>
</div>
Hope that helps.
Posts: 1
this is really great tip, thanks guys!
Posts: 1
Hi,
I am also trying to center my photos in the slideshow. But i couldn't understand what is said here (its my fault only, please bear with me as i don't know anything about CSS and i am pretty new to webhosting).
Do i need to create a file called Slideshow.tpl and place it in "themes/carbon/templates" folder as the templates folder is having the .tpl files. Please explain.
Thanks
Posts: 4
I'm not sure if this tip is deprecated in favour of css by now, but I just tried it as mindless originally posted it and it works perfectly on my Gallery installation. The only thing that I would like to change is to have the image centered vertically as well. Can someone indicate how I should go about doing this?
Posts: 3
Posts: 26
I did what mindless recommended in his first scetion which is
Slideshow: make a local Slideshow.tpl that changes:
<div class="gbItemImage">
to:
<div class="gbItemImage" style="text-align: center">
It did not change anything. Can you please be very specific as to what else I may need to change? I use the carbon theme.
Thank you so much for your prompt reply
Posts: 3
Just add below code in theme.css