|
|
Introduction
OpenSocialHelper is intended to ease the sfOpenSocialPlugin use. With this helper you can include the gadget content's, Javascript and CSS. Usually the symfony framework allows to include css and Javascript from the file "view.yml", in the head HTML section. Or application don't use the default html layout, but an gadget layout( look at HowToConfigure for more information) and so we need to include them in the content. This should be fixed in a future version, but for now to include a custom stylesheet or external Javascript file you should use our method's in the OpenSocialHelper.
Include Stylesheet
To include an custom stylesheet called 'PalcoPrincipal.css' that is located under "/web/css" you should put in the view the following code:
<?php use_helper('OpenSocial'); ?>
...
<?php echo include_css('PalcoPrincipal.css') ?>
...If you want to include and stylesheet that is located in any other location, you should do this:
<?php use_helper('OpenSocial'); ?>
...
<?php echo include_remote_css('http://sghdc.no-ip.org/opensocial/css/css.css') ?>
...Include Javascript
To include an custom javascript called 'PalcoPrincipal.js' that is located under "/web/js" you should put in the view the following code:
<?php use_helper('OpenSocial'); ?>
...
<?php echo include_js('PalcoPrincipal.js') ?>
...If you want to include and stylesheet that is located in any other location, you should do this:
<?php use_helper('OpenSocial'); ?>
...
<?php echo include_remote_js('http://sghdc.no-ip.org/opensocial/js/scripts.js') ?>
...
Sign in to add a comment
