Page 1 of 1

Gantry/RT + boxplus detail misalign solved

Posted: 20 Jan 2012, 22:06
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

Re: Gantry/RT + boxplus detail misalign solved

Posted: 27 Jan 2012, 19:40
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

Re: Gantry/RT + boxplus detail misalign solved

Posted: 30 Jan 2012, 06:45
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.

Re: Gantry/RT + boxplus detail misalign solved

Posted: 30 Jan 2012, 23:26
by Jan
Hi, in Joomla!, all specific CSS includes will be set before template CSS. :-(

Jan