[Rt-commit] rt branch, 4.0/writing-rt-extensions-doc, updated. rt-4.0.6-257-ge6c5c35

Jim Brandt jbrandt at bestpractical.com
Wed Sep 25 11:45:41 EDT 2013


The branch, 4.0/writing-rt-extensions-doc has been updated
       via  e6c5c35226bffc9320218c51656408605c442e08 (commit)
      from  76b0cde651e9e0df1f1589bad42ce8adc09442bc (commit)

Summary of changes:
 docs/writing-extensions.pod | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

- Log -----------------------------------------------------------------
commit e6c5c35226bffc9320218c51656408605c442e08
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 20 16:09:56 2013 -0400

    Add details on setting up the static directory.

diff --git a/docs/writing-extensions.pod b/docs/writing-extensions.pod
index 5bf968c..25fbe80 100644
--- a/docs/writing-extensions.pod
+++ b/docs/writing-extensions.pod
@@ -84,6 +84,20 @@ that will use these callbacks. See L</Callbacks> for more information.
 Your Mason templates should go in an C<html> directory with the appropriate
 directory structure to make sure the callbacks are executed.
 
+=head2 CSS and Javascript
+
+If you have style sheets or Javascript, create a C<static> directory at the
+top level under your extension, and under that a C<css> directory and a
+C<js> directory. You can put your files in those two directories.
+
+To add files to RT's include paths, you can use the L<RT/AddStyleSheets> and
+L<RT/AddJavascript> methods available in the L<RT> module. You can put the
+lines near the top of your module code (in your "Demo.pm" file). If you set up
+the paths correctly, you should only need to set the file names like this:
+
+    RT->AddStyleSheets('myextension.css');
+    RT->AddJavaScript('myextension.js');
+
 =head2 Creating Objects in RT
 
 If you need to have users create a group, scrip, template, or some other

-----------------------------------------------------------------------


More information about the Rt-commit mailing list