1 | ====================== |
---|
2 | qplone3 theme template |
---|
3 | ====================== |
---|
4 | |
---|
5 | This theme allow you to create plone3 theme python package |
---|
6 | with nested namespace. |
---|
7 | |
---|
8 | For create such theme use `paster create` command:: |
---|
9 | |
---|
10 | >>> paster('create -t qplone3_theme plone.example --no-interactive') |
---|
11 | paster create -t qplone3_theme plone.example --no-interactive |
---|
12 | ... |
---|
13 | |
---|
14 | Let's check the content of created plone.example package:: |
---|
15 | |
---|
16 | >>> package_dir = 'plone.example' |
---|
17 | >>> ls(package_dir) |
---|
18 | MANIFEST.in |
---|
19 | README.txt |
---|
20 | docs |
---|
21 | plone.example-configure.zcml |
---|
22 | plone.example.egg-info |
---|
23 | quintagroup |
---|
24 | setup.cfg |
---|
25 | setup.py |
---|
26 | |
---|
27 | So you have python package with *quintagroup* upper level namespace. |
---|
28 | |
---|
29 | Now check namespaces:: |
---|
30 | >>> cd(package_dir) |
---|
31 | >>> ls('quintagroup') |
---|
32 | __init__.py |
---|
33 | __init__.pyc |
---|
34 | theme |
---|
35 | |
---|
36 | >>> cd('quintagroup') |
---|
37 | >>> ls('theme') |
---|
38 | __init__.py |
---|
39 | __init__.pyc |
---|
40 | ploneexample |
---|
41 | |
---|
42 | So we receave quitagroup.theme namespace with ploneexample python package. |
---|
43 | |
---|
44 | Package holds 3 subdirectory (browser, profiles, skins) and |
---|
45 | initialization files:: |
---|
46 | >>> cd('theme') |
---|
47 | >>> ls('ploneexample') |
---|
48 | __init__.py |
---|
49 | browser |
---|
50 | configure.zcml |
---|
51 | profiles |
---|
52 | profiles.zcml |
---|
53 | setuphandlers.py |
---|
54 | skins |
---|
55 | skins.zcml |
---|
56 | tests.py |
---|
57 | version.txt |
---|
58 | |
---|
59 | ========================= |
---|
60 | Test localcommnands |
---|
61 | ========================= |
---|
62 | This theme support ZopeSkel local command 'addcontent'. |
---|
63 | |
---|
64 | >>> paster('addcontent -a') |
---|
65 | paster addcontent -a |
---|
66 | ... |
---|
67 | |
---|
68 | So you can extend your theme with following subtemplates: |
---|
69 | - portlet |
---|
70 | - layer |
---|
71 | - sublayer |
---|
72 | - css resource |
---|
73 | - js resource |
---|
74 | |
---|
75 | Check portlet |
---|
76 | >>> paster('addcontent -l') |
---|
77 | paster addcontent -l |
---|
78 | Available templates: |
---|
79 | css_resource: A Plone 3 CSS resource template |
---|
80 | js_resource: A Plone 3 JS resource template |
---|
81 | skin_layer: A Plone 3 Skin Layer |
---|
82 | skin_sublayer: A Plone 3 Skin SubLayer registration in GS' skins.xml |
---|
83 | |
---|
84 | Test of portlet adding |
---|
85 | >>> paster('addcontent --no-interactive portlet') |
---|
86 | paster addcontent --no-interactive portlet |
---|
87 | Recursing into portlets |
---|
88 | ... |
---|
89 | |
---|
90 | Test of skin_layer adding |
---|
91 | >>> paster('addcontent --no-interactive skin_layer') |
---|
92 | paster addcontent --no-interactive skin_layer |
---|
93 | Recursing into profiles |
---|
94 | ... |
---|
95 | |
---|
96 | Test of skin_sublayer adding |
---|
97 | >>> paster('addcontent --no-interactive skin_sublayer') |
---|
98 | paster addcontent --no-interactive skin_sublayer |
---|
99 | Recursing into profiles |
---|
100 | ... |
---|
101 | |
---|
102 | Test of css_resource |
---|
103 | >>> paster("addcontent --no-interactive css_resource") |
---|
104 | Traceback (most recent call last): |
---|
105 | ... |
---|
106 | ValueError: - wrong file path for css resource |
---|
107 | |
---|
108 | Test of js_resource |
---|
109 | >>> paster('addcontent --no-interactive js_resource') |
---|
110 | Traceback (most recent call last): |
---|
111 | ... |
---|
112 | ValueError: - wrong file path for js resource |
---|
113 | |
---|
114 | |
---|
115 | Exceptions for last two templates raised because of both templates |
---|
116 | expect for path to file object with data with appropriate content |
---|
117 | for that resource. |
---|