Gantry/RT + boxplus detail misalign solved

Phoca Gallery - image gallery extension
MaximS
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Jan 2012, 21:46

Gantry/RT + boxplus detail misalign solved

Post by MaximS »

After trying to fix off-center images in boxplus I've found a problem and a solution.

The problem is the gantry css. It states that
body {
min-width: 960px
}
and content inside it
div .rt-container {
width:960px
}
Thats why in a iframe box of about 900px or less the iframe body and rt-container div is wider (960px) than the iframe itself.
The code that generates detail popup fortunately inserts local style. So it's easy to override Gantry/RT parameters:

It's com_phocagallery\views\detail\view.html.php line 118

Code: Select all

		// No Scrollbar in Detail View
		if ($this->tmpl['detailwindow'] == 7) {
	
		} else {
			$document->addCustomTag( "<style type=\"text/css\"> \n" 
				." html,body, .contentpane{overflow:hidden;background:".$this->tmpl['detailwindowbackgroundcolor'].";} \n" 
				." center, table {background:".$this->tmpl['detailwindowbackgroundcolor'].";} \n" 
				." #sbox-window {background-color:#fff;padding:5px} \n" 
				// gantry-fix-begin
				."body {min-width:100%} \n"
				.".rt-container {width:100%} \n"
				// gantry-fix-end
				." </style> \n");
		}
The lines added between gantry-fix comments solves the problem.

But in future versions it would be great to extract this style generation from the source to some external file for easier adjustment.

Maxim
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Gantry/RT + boxplus detail misalign solved

Post by Jan »

Hi, thank you very much for the code, I will take a look at it to add this to some new version. But I think this cannot be in external CSS as template CSS follows external Phoca Gallery CSS so then the template CSS will overwrite it to back (like Gantry does)

Thank you, Jan
If you find Phoca extensions useful, please support the project
MaximS
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Jan 2012, 21:46

Re: Gantry/RT + boxplus detail misalign solved

Post by MaximS »

Hi.
No need to place it in a true css file. Some sort of include is enough. Say, iframe-template-override.css which could be read by php code and placed in an html inline.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Gantry/RT + boxplus detail misalign solved

Post by Jan »

Hi, in Joomla!, all specific CSS includes will be set before template CSS. :-(

Jan
If you find Phoca extensions useful, please support the project
Post Reply