<![CDATA[ Modified "useCss" Parameter for gallery snippet call. - My Forums]]> https://forums.modx.com/thread/?thread=50652 <![CDATA[Modified &quot;useCss&quot; Parameter for gallery snippet call.]]> https://forums.modx.com/thread/50652/modified-usecss-parameter-for-gallery-snippet-call#dis-post-296474
As far as I understand, there is a fixed css path for the galleriffic plugin inside. Using useCss, you can switch that one completely off, but you can’t tell the snippet to use a different css file instead. My modification will change that.

Open the gallery snippet and have a look at line 12

else {
    if ($modx->getOption('useCss',$scriptProperties,true)) {
        $modx->regClientCSS($gallery->config['cssUrl'].'web.css');
    }


Use this one instead:

else {

		$useCss = $modx->getOption('useCss',$scriptProperties,true);
		switch($useCss) {
			case 'true':
				/* true, because it was either set or we use the default value. Add default css to document head */
				$modx->regClientCSS($gallery->config['cssUrl'].'web.css');
				break;
			case 'false':
				/* false, because it was set to false inside snippet. Don't add any css to document head */
				break;
			case '':
				/* false, because it was set to zero inside snippet. Don't add any css to document head */
				break;
			default:
				/* add specified css to document head */
				$modx->regClientCSS($useCss);
				break;
		}
	}


Usage:
[[!Gallery? &album=`emotions` &useCss=`false` ]] Add &useCSS=`false` or &useCSS=`` to your snippet call to remove the gallery css link from the head
[[!Gallery? &album=`emotions` &useCss=`assets/templates/yourproject/gallery.css` ]] Add &useCSS=`add/path/to/css/here/gallery.css` to add a link to this css file inside the documents head
[[!Gallery? &album=`emotions` ]] Don’t add &useCss to your snippet call and you will get a link to the default css (/assets/components/gallery/css/web.css).

Regards,

pepebe]]>
pepebe Mar 15, 2011, 11:57 AM https://forums.modx.com/thread/50652/modified-usecss-parameter-for-gallery-snippet-call#dis-post-296474