Page 1 of 2

Need to center random image module

Posted: 10 Jun 2009, 01:13
by havenswift-hosting
Hi

I have inherited a Joomla site that has been put together by somebody else but there were some outstanding issues. I have sorted out most of these but have one outstanding one and would be grateful for some help please :

The site uses the phoca_gallery_random_image module in the right hand column and is displaying a single image. I would like to make the thumbnail image slightly bigger and also centre it. I cant see how to do either of these via the admin so am guessing I would need to amend the template but can somebody point me in the right direction please

Thanks
Ian

Re: Need to center random image module

Posted: 11 Jun 2009, 00:20
by Jan
Hi, in parameters of module, try to set some fixed width of the module, e.g. 120px so then it can be centered.

Jan

Re: Need to center random image module

Posted: 11 Jun 2009, 02:44
by havenswift-hosting
Hi Jan

Thanks for your response - but not sure I undertand where you mean. Do you mean if I edit the random gallery Images under module manager. If so, the only parameter that I can see is the Phoca gallery module width which is set to 300 currently.

Thanks
Ian

Re: Need to center random image module

Posted: 18 Jun 2009, 22:37
by Jan
Yes, this I mean, try to set some smaller value of size, e.g. 140, you need to set smaller or the same value than the size of module box is set in template

Re: Need to center random image module

Posted: 01 Oct 2009, 10:14
by martyv
I tried this and it actually works! Both in IE and FF anyway. Don't understand why, but it does. :shock:

Before trying this I did some research myself and found out that in line #496 of mod_phocagallery_random_image.php there's a hardcoded CSS statement which overrules the regular CSS-file.

Code: Select all

$output[$i] .= '<div class="phocagallery-box-file" style="height:'.$imageHeight['boxsize'].'px; width:'.$imageWidth['boxsize'].'px;float:left">' . "\n";
It says: 'float:left', but why? Even more, it puzzles me why changing the module width from 200 to 140 suddenly makes it center correctly. The 'float:left'-statement is still in the generated html if I check with firebug. :?

Re: Need to center random image module

Posted: 05 Oct 2009, 17:31
by Jan
Hi, images are displayed in float boxes, the module can display more images in the row, so there is float left (tabeless design)

Jan

Re: Need to center random image module

Posted: 31 Oct 2009, 17:18
by omojesu
I am experiencing the same issues with centering the images in the phoca module. The size of the module in the joomla location is 388 and I set the phoca module width to 300 but it is still left aligned. There are two pictures per row and it looks awkward having it floating left and leaving a wide space the right...which appears as a wide space in the template.

I have attempted different phoca module width from the module backend with no luck...if I set it lower than 150, the columns become single from two columns. I f I set it closer to 350 > I see no changes in the alignment.

Any ideas?

Re: Need to center random image module

Posted: 03 Nov 2009, 11:23
by Jan
Hi, the images are in floatboxes, so there must be a e.g. div tag with fixed width which will be centered, on most module positions (in different templates) the width should be set cca 160px - 170px

Jan

Re: Need to center random image module

Posted: 03 Jan 2010, 19:20
by rudimann
Hallo,

ich habe bei mir die Phoca Gallery sowie das Modul mod_phocagallery_image jeweils Vers. 2.6.0 installiert. Leider bekomme ich es nicht hin, dass dieses Modul das Vorschaubild mit Rahmen zentriert unter dem Menü anzeigt.

Link: www.fc-elbflorenz.de ("Bild des Tages")

Ich habe hier schon diverse Themen dazu gelesen und auch die Tipps ausprobiert. Leider führte alles bisher nicht zum gewünschten Erfolg. Selbst mit Web Developer komme ich nicht auf die Spur...

Kann mir jemand dabei helfen?

Vielen Dank!

Re: Need to center random image module

Posted: 03 Jan 2010, 19:30
by Ronny
Hallo rudimann,

schau mal in die Moduleinstellungen vom Random Image Module - dort gibt es einen Eintrag "Phoca Gallery Modulbreite". Mit dessen Hilfe kannst Du das Bild zentrieren - der genaue Wert hängt vom gesamten Layout der Website ab, probiere mal Werte zwischen 120 und 150.

Gruß Ronny