[Pkg-owncloud-commits] [owncloud-doc] 07/12: add documentation on how to add stylesheets and javascript files

David Prévot taffit at alioth.debian.org
Fri Sep 6 22:57:35 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch dfsg_clean
in repository owncloud-doc.

commit 4cee3cf1cbf2ed2e34a78a9526828786fe8261b7
Author: Bernhard Posselt <nukeawhale at gmail.com>
Date:   Fri Sep 6 15:48:22 2013 +0200

    add documentation on how to add stylesheets and javascript files
---
 developer_manual/app/app/css.rst    |    2 ++
 developer_manual/app/app/static.rst |    5 +++++
 2 files changed, 7 insertions(+)

diff --git a/developer_manual/app/app/css.rst b/developer_manual/app/app/css.rst
index d2d1df3..09790bb 100644
--- a/developer_manual/app/app/css.rst
+++ b/developer_manual/app/app/css.rst
@@ -3,6 +3,8 @@ CSS
 
 .. sectionauthor:: Bernhard Posselt <nukeawhale at gmail.com>
 
+Stylesheets have to be included in your templates, see :doc:`static`
+
 If you have to include an image or css file in your CSS, prepend the following to your path: 
 
 * **%appswebroot%**: gets the absolute path to your app
diff --git a/developer_manual/app/app/static.rst b/developer_manual/app/app/static.rst
index 31790bf..5dce5a1 100644
--- a/developer_manual/app/app/static.rst
+++ b/developer_manual/app/app/static.rst
@@ -9,5 +9,10 @@ Static content consists of:
 * **js/**: all JavaScript files
 * **css/**: all CSS files
 
+Because ownCloud templates do not support template inheritance it is not possible to add your own script tags. Therefore ownCloud provides the methods **\\OCP\Util::addScript('your_app_id', 'script')** and **\\OCP\Util::addStyle('your_app_id', 'style')**. The first parameter is the app's id, the second one is the path relative to the **js/** respectively the **css/** folder without the file extension.
+
+If you use Twig Templates, there is the **script** and **style** function, see :doc:`../appframework/templates`.
+
+
 CSS and JavaScript are compressed by ownCloud so if the CSS or JavaScript do not seem to get updated, check if the debug mode is enabled. To enable it see :doc:`../intro/gettingstarted`
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-doc.git



More information about the Pkg-owncloud-commits mailing list