//register css and javascript from snippet parameters
if ($this->mgconfig['css'] != "") {
if ($modx->getChunk($this->mgconfig['css']) != "") {
$modx->regClientCSS($modx->getChunk($this->mgconfig['css']));
} else if (file_exists($modx->config['base_path'].$this->mgconfig['css'])) {
$modx->regClientCSS($modx->config['base_url'].$this->mgconfig['css']);
} else {
$modx->regClientCSS($this->mgconfig['css']);
}
}
if ($this->mgconfig['js'] != "") {
if ($modx->getChunk($his->mgconfig['js']) != "") {
$modx->regClientStartupScript($modx->getChunk($his->mgconfig['js']));
} else if (file_exists($modx->config['base_path'].$this->mgconfig['js'])) {
$modx->regClientStartupScript($modx->config['base_url'].$this->mgconfig['js']);
} else {
$modx->regClientStartupScript($this->mgconfig['js']);
}
}
if ($this->mgconfig['css'] != "") {
if ($modx->getChunk($this->mgconfig['css']) != "") {
$modx->regClientCSS($modx->getChunk($this->mgconfig['css']));
} else if (file_exists($modx->config['base_path'].$this->mgconfig['css'])) {
$modx->regClientCSS($modx->config['base_url'].$this->mgconfig['css']);
} else {
$modx->regClientCSS($this->mgconfig['css']);
}
} if ($this->mgconfig['css'] != "") {
if ($modx->getChunk($this->mgconfig['css']) != "") {
$modx->regClientCSS($modx->getChunk($this->mgconfig['css']));
} else if (file_exists($modx->config['base_path'].$this->mgconfig['css'])) {
$modx->regClientCSS('<link rel="stylesheet" href="' . $modx->config['base_url'].$this->mgconfig['css'] . '" type="text/css" media="screen" />');
} else {
$modx->regClientCSS($this->mgconfig['css']);
}
}
Yes, thank you very much
Also, whilst looking at this section of code I think I may have spotted a separate error, in the second section related to JS it has the following in two places $modx->getChunk($his->mgconfig[’js’], is that supposed to be $this instead of $his ? I’m not sure if there is a $his array, but thought I’d mention anyway.
It’s a typo, should be $this indeed. So it was linking the css file, but it just did not work for you in your browser? What browser are you using? It seems that modx is including css by using the @import method.. I can change it to <link> if there’s some problems with that. But I guess @import should work ok too.
Looking into this further it was outputting the stylesheet include in the following way :
<style type=’text/css’>@import url(/assets/snippets/maxigallery/css/default.css)</style>
and for some reason that method of including the stylesheet is not working for me
No, but possible.
Also, I’m not sure why the last "else" is there, I can see that it adds the base_url to the "regClientCSS" above it, does that mean as a last resort it will assume the link given is relative?
First it tries to search for a chunk that is set in &css parameter. If there is no chunk by that name, it checks if there is a file with that path that is set to &css parameter. If there’s not a file either, it calls regClientCSS just with the contents of &css parameter. So in the last case, the &css could contain css in <style></style> tags, or a link to a file in <link> tag etc.. that last case is mostly meant for snippet developers that use MaxiGallery in their own snippets..Thanks! when you get it working, could you post a link here?
Great update doze! I’m playing with it to create a demo.

What’s the problem exactly? Do you get the css link also with @import in your HTML source, but it’s not working? Hmm.. I think I need to change it to the "forced" <link> then, that’s how I have done with the slidebox css too anyways..
But have the same problem using &css parameter
Oh yea.. haven’t checked maxigallerysolo at all.. Try this and please report back if it works or not! Thanks.
and an issue with maxigallerysolo (after update to 0.5 beta lightboxv2 does not work in MGSolo).
Great that more people are reporting! Ok, here’s some comments about the raised issues:
.....
Quote from: banzai at Nov 13, 2006, 06:23 AMThanks! when you get it working, could you post a link here?
Great update doze! I’m playing with it to create a demo.
Quote from: banzai at Nov 13, 2006, 06:23 AMWhat’s the problem exactly? Do you get the css link also with @import in your HTML source, but it’s not working? Hmm.. I think I need to change it to the "forced" <link> then, that’s how I have done with the slidebox css too anyways..
But have the same problem using &css parameter
Quote from: banzai at Nov 13, 2006, 06:23 AMOh yea.. haven’t checked maxigallerysolo at all.. Try this and please report back if it works or not! Thanks.
and an issue with maxigallerysolo (after update to 0.5 beta lightboxv2 does not work in MGSolo).
but i noticied &pics_to_show=`1` seems not working (MGsolo still display next button), but I dont know if it’is a 0.5 issue or 0.4x issue.What do you have in your &css parameter?
Css work only added in the template, not calling from MaxiGallery &css parameter.
SlideBox works great with your latest MaxiGallerySolo releasebut i noticied &pics_to_show=`1` seems not working (MGsolo still display next button), but I dont know if it’is a 0.5 issue or 0.4x issue.
if($open=="lightbox"){
$forcount = count($pics);
}else{
$forcount = $pics_to_show+1;
}
$forcount = $pics_to_show+1;
Quote from: banzai at Nov 13, 2006, 12:24 PMWhat do you have in your &css parameter?
Css work only added in the template, not calling from MaxiGallery &css parameter.
SlideBox works great with your latest MaxiGallerySolo releasebut i noticied &pics_to_show=`1` seems not working (MGsolo still display next button), but I dont know if it’is a 0.5 issue or 0.4x issue.
The &pics_to_show parameter in MaxiGallerySolo just defines how many pictures it shows in the page, it still retrieves all pictures to the lightboxv2 pictureset. To make it only get the &pic_to_show amount of pictures in to the pictureset,
change:
if($open=="lightbox"){ $forcount = count($pics); }else{ $forcount = $pics_to_show+1; }
to
$forcount = $pics_to_show+1;
That has to be &css=`GalleryStyle` and the chunk has to contain the css in <style...> .. </style> tags. Have you tried that?
What do you have in your &css parameter?
The name of the chunk wich contains the style code ( &css=GalleryStyle) or I mistaken something?
.....and the chunk has to contain the css in <style...> .. </style> tags. Have you tried that?
this is my mistaken! now works very nice 
[[MaxiGallery? &view_gallery=`[+id+]` &pics_per_page='1' ]]
This discussion is closed to further replies. Keep calm and carry on.