<link rel="stylesheet" href="[[++ce.assets_url]]css/base.css"> <link rel="stylesheet" href="[[++ce.assets_url]]css/gazoobie.css">
So I have this in the head. Do I put the code in the gazoobie.config file and do one for each css and js file?
OK an additional question only because I don't know php.
On a clean install I have a few resources installed but when I update I don't want to update or add the resources. What is the best way to handle this?
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UPDATE_OBJECT => false,
If you do it that way, the user either won't have the ce.assets_url System Setting, or they will and it will be wrong for their machine (because they don't have the files in the development location). That's why I do it with regClient*() in the snippet or plugin code.
$cssFile = $this->modx->getOption('ce.assets_url', null,
MODX_ASSETS_URL . 'components/classextender/') . 'css/classextender.css?v=' . $this->version;
$this->modx->regClientCSS($cssFile);$cssFile = $modx->getOption('gz.asset_url',null, MODX_ASSETS_URL . 'components/gazoobie/');
return $cssFile;<link rel="stylesheet" href="[[getasset_url]]css/base.css"> <script src="[[getasset_url]]js/modernizr.js"></script>
$assetsPath = $modx->getOption('gz.asset_url',null, MODX_ASSETS_URL . 'components/gazoobie/');
$cssFile = $assetsPath . 'css.base.css';
$jsFile = $assetsPath . 'js/modernizr.js';
$modx->regClientCSS($cssFile);
$modx->regClientStartupScript($jsFile);
return '';
$cssFile = $assetsPath . 'css/base.css'; $cssFile2 = $assetsPath . 'css/something.css'; $jsFile = $assetsPath . 'js/modernizr.js'; $jsFile2 = $assetsPath . 'js/something.js'; $modx->regClientCSS($cssFile); $modx->regClientCSS($cssFile2); $modx->regClientStartupScript($jsFile); $modx->regClientStartupScript($jsFile2); return '';
$vehicle = $builder->createVehicle($category,$attr);
$vehicle->resolve('file',array(
'source' => $sources['source_core'],
'target' => "return MODX_CORE_PATH . 'components/';",
));
$vehicle->resolve('file',array(
'source' => $sources['source_assets'],
'target' => "return MODX_ASSETS_PATH . 'components/';",
));
$builder->putVehicle($vehicle);$vehicle = $builder->createVehicle($category,$attr);
$vehicle->resolve('file',array(
'source' => $sources['source_core'],
'target' => "return MODX_CORE_PATH . 'components/';",
xPDOTransport::PRESERVE_PREEXISTING => true; // Adding this should preserve pre-existing files
));
$vehicle->resolve('file',array(
'source' => $sources['source_assets'],
'target' => "return MODX_ASSETS_PATH . 'components/';",
));
$builder->putVehicle($vehicle);[2015-03-27 21:15:31] (ERROR @ /index.php)
Error HY000 executing query: SELECT `modSnippet`.`id` AS `modSnippet_id`, `modSnippet`.`source` AS `modSnippet_source`, `modSnippet`.`property_preprocess` AS `modSnippet_property_preprocess`, `modSnippet`.`name` AS `modSnippet_name`, `modSnippet`.`description` AS `modSnippet_description`, `modSnippet`.`editor_type` AS `modSnippet_editor_type`, `modSnippet`.`category` AS `modSnippet_category`, `modSnippet`.`cache_type` AS `modSnippet_cache_type`, `modSnippet`.`snippet` AS `modSnippet_snippet`, `modSnippet`.`locked` AS `modSnippet_locked`, `modSnippet`.`properties` AS `modSnippet_properties`, `modSnippet`.`moduleguid` AS `modSnippet_moduleguid`, `modSnippet`.`static` AS `modSnippet_static`, `modSnippet`.`static_file` AS `modSnippet_static_file`, `Source`.`id` AS `Source_id`, `Source`.`name` AS `Source_name`, `Source`.`description` AS `Source_description`, `Source`.`class_key` AS `Source_class_key`, `Source`.`properties` AS `Source_properties`, `Source`.`is_stream` AS `Source_is_stream` FROM `modx_site_snippets` AS `modSnippet` LEFT JOIN `modx_media_sources` `Source` ON `modSnippet`.`source` = `Source`.`id` WHERE `modSnippet`.`name` = ? ORDER BY `modSnippet`.`id` ASC - Array
(
[0] => HY000
[1] => 2006
[2] => MySQL server has gone away
)