Need to center random image module

Phoca Gallery modules - modules for Phoca Gallery extension
havenswift-hosting
Phoca Member
Phoca Member
Posts: 11
Joined: 10 Jun 2009, 01:01
Contact:

Need to center random image module

Post 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
Owner of web hosting and design business based in the UK
Specialists in E-Commerce and CMS Systems
Havenswift Hosting
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Need to center random image module

Post 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
If you find Phoca extensions useful, please support the project
havenswift-hosting
Phoca Member
Phoca Member
Posts: 11
Joined: 10 Jun 2009, 01:01
Contact:

Re: Need to center random image module

Post 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
Owner of web hosting and design business based in the UK
Specialists in E-Commerce and CMS Systems
Havenswift Hosting
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Need to center random image module

Post 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
If you find Phoca extensions useful, please support the project
martyv
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 01 Oct 2009, 09:51

Re: Need to center random image module

Post 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. :?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Need to center random image module

Post 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
If you find Phoca extensions useful, please support the project
omojesu
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 31 Oct 2009, 17:11

Re: Need to center random image module

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Need to center random image module

Post 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
If you find Phoca extensions useful, please support the project
rudimann
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 03 Jan 2010, 19:10

Re: Need to center random image module

Post 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!
Ronny
Phoca Professional
Phoca Professional
Posts: 211
Joined: 03 Nov 2009, 20:31
Location: Germany
Contact:

Re: Need to center random image module

Post 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
Post Reply