Hi,
I just solved
(with a "devman", friend of man) some issues that could happen in some conditions using the snippet.
Sorry, it’s a little bit too long
This one has been added yesterday in the thread
http://modxcms.com/forums/index.php/topic,27922.0.html, it’s about dealing with ’ caracter in the title and description field and avoiding CR/LF too.
using the
http://wiki.modxcms.com/index.php/MaxiGallery#Picture_and_thumbnails_on_same_page the output formatting must use another modifer than :htmlentities
like Doze told me
This, is good. Name it "
phx:escslashandmore" or whatever.
<?php
//$out = addslashes(htmlentities($output)); not enought
// some addition by A.Castan for E.Lacomblez Nëo-tekk
//
$out = str_replace("'","\'",$output);
$out = str_replace('"',"\'",$out);
$out = str_replace("\r\n"," ",$out);
$out = str_replace("\n"," ",$out);
return $out;
?>
There’s another big issue still using the
mgJs call from thumb to display normal image on the same page AND using IE.
IE can’t deal with img till it’s not actually loaded, so, the statment :
var img = document.getElementById('maxImage');
can’t work with IE (maybe it could depending of circumstances)
here the suggested modification for mgJs script :
<script type="text/javascript">
function showPic(url,title,descr,width,height) {
//var img = document.getElementById('maxImage'); no good for IE
//-------- needed for IE ----------------
var img = new Image;
img.onload= function(){
document.getElementById('maxImage').src = img.src;
}
//---------------------------------------------
var titleHolder = document.getElementById('maxTitle');
var descrHolder = document.getElementById('maxDescr');
img.src = url;
img.width = width;
img.height = height;.....rest of the script
And the last one
It’s a CSS issue, I hit my head in the wall for 2 days because the little images
(contained into a <a> contained into a <li> were displaid with an
unwanted bottom "margin" (always 4px in my case) and the css told no margin nor padding for all concerned elements.
This is an issue normally regarding IE, but obviously FF3 too now.
Images element are actually inline elements, and they stuck to text’s baseline as any other letter. But, there is always some additional reserved space UNDER this baseline for p,q,g, etc.
The thumbs rows are done with ul/li/a/img, so img add this extra space under itself "pushing the height of li down ".
2 solutions: in the default.css coming with MG, you should add a line-height (0 or 1px) to the li
ul.thumbs li {
.......
line-height: 0px;
......
}
Or forcing the img to be block type.
ul.thumbs li img {
display: block;
hope this will useful
Thanks.