[Vtigercrm-developers] Still can't add remote javascript or CSS in Views - VT61
Stencel, Maciej
m.stencel at opensaas.pl
Mon Jul 7 06:05:33 GMT 2014
Hi Alan,
This is working for me.
Code snippets:
public function getHeaderScripts(Vtiger_Request $request) {
$headerScriptInstances = parent::getHeaderScripts($request);
$jsFileNames = array(
*"layouts.vlayout.modules.ModuleName.resources.jsFile1",*
* "layouts.vlayout.modules.ModuleName.resources.jsFile2",*
* "layouts.vlayout.modules.ModuleName.resources.jsFile3"*
);
$jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
$headerScriptInstances = array_merge($headerScriptInstances,
$jsScriptInstances);
return $headerScriptInstances;
}
public function getHeaderCss(Vtiger_Request $request) {
$headerCssInstances = parent::getHeaderCss($request);
$cssFileNames = array(
*"layouts.vlayout.modules.ModuleName.resources.cssFile"*
);
$cssInstances = $this->checkAndConvertCssStyles($cssFileNames);
$headerCssInstances = array_merge($headerCssInstances, $cssInstances);
return $headerCssInstances;
}
Try this. Add files without extension, and instead of directory separator
just use dots.
*Z poważaniem / Best regards*
*Maciej Stencel*
*Tel: +48 884-997-123*
*m.stencel at opensaas.pl <m.stencel at opensaas.pl>www.OpenSaaS.pl
<http://www.opensaas.pl/>*
2014-07-05 17:04 GMT+02:00 Alan Lord (News) <alanslists at gmail.com>:
> I raised this early on with vtiger 6.0 but it's still a problem in vtiger
> 6.1
>
> I can't use a CDN for Javascript or stylesheets in my View classes, e.g.
>
> public function getHeaderCss(Vtiger_Request $request) {
>> $headerCssInstances = parent::getHeaderCss($request);
>>
>> $cssFileNames = array(
>> '~/layouts/vlayout/modules/
>> GeoTools/resources/GeoTools.css',
>> 'http://cdn.leafletjs.com/
>> leaflet-0.7.3/leaflet.css',
>> );
>> $cssInstances = $this->checkAndConvertCssStyles($
>> cssFileNames);
>> $headerCssInstances = array_merge($headerCssInstances,
>> $cssInstances);
>>
>> return $headerCssInstances;
>> }
>>
>>
>
> This is rendered in the <head> as
>
> link media="screen" type="text/css" href="http://cdn.leafletjs.
>> com/leaflet-0.7.3/leaflet.css?&v=6.0.0" rel="stylesheet">
>>
>
> So it will not work.
>
> This *needs* fixing. Applies to both css and javascript functions.
>
> Al
>
>
> --
> Libertus Solutions
> http://www.libertus.co.uk
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140707/9c476919/attachment-0001.html>
More information about the vtigercrm-developers
mailing list