You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref="#content-blocks">Content Blocks</a><ul></ul></li><li><ahref="#creating-a-custom-content-block">Creating A Custom Content Block</a><ul></ul></li><li><ahref="#creating-a-custom-portlet">Creating A Custom Portlet</a><ul></ul></li><li><ahref="#page-routes">Page Routes</a><ul></ul></li></ol></div>
130
+
<li><ahref="#content-blocks">Content Blocks</a><ul></ul></li><li><ahref="#creating-a-custom-content-block">Creating A Custom Content Block</a><ul></ul></li><li><ahref="#creating-a-custom-portlet">Creating A Custom Portlet</a><ul><li><ahref="#rendering-portlets-views-from-the-file-system">Rendering Portlets views from the file system</a></li><li><ahref="#choosing-a-handler-ahead-of-time">Choosing a handler ahead of time</a></li></ul></li><li><ahref="#page-routes">Page Routes</a><ul></ul></li></ol></div>
131
131
</td>
132
132
<tdclass="guides">
133
133
<h2>BrowserCMS Developer Guide</h2>
@@ -217,7 +217,8 @@ <h3 id="creating-a-custom-portlet">3 Creating A Custom Portlet</h3>
217
217
<p>If you look back at the form partial that was generated, you’ll see:</p>
<p>What this does is preload the template with whatever you entered into the render template. The user is free to change it as they see fit and even have different values from one portlet instance to the next.</p>
220
-
<p>If you do not want to have the portlet’s render template entered in the <spanclass="caps">CMS</span> and would rather have it just render the file from the file system, simply add this to your portlet code:</p>
220
+
<h4id="rendering-portlets-views-from-the-file-system">3.1 Rendering Portlets views from the file system
221
+
If you do not want to have the portlet’s render template entered in the <spanclass="caps">CMS</span> and would rather have it just render the file from the file system, simply add this to your portlet code:</h4>
<p>This generates a drop-down menu for the user creating the portlet to select from the various portlet handlers installed in your Rails app. The default is erb, but you could install haml and use haml instead, for example.</p>
233
-
<p>If you would rather not have the user select the handler type, or maybe you are using the file system instead of entering the template into the <spanclass="caps">CMS</span>, you can set the handler to a different value like this:</p>
233
+
<p>This generates a drop-down menu for the user creating the portlet to select from the various portlet handlers installed in your Rails app.
234
+
The default handler for portlet views is erb, but you could use alternative ones, like Haml. To do that, install the <spanclass="caps">HAML</span> gem and set the default_value to ‘haml’ like so:</p>
<h4id="choosing-a-handler-ahead-of-time">3.2 Choosing a handler ahead of time
237
+
If you would rather not have the user select the handler type, or if you are using the file system instead of storing the template code in the <spanclass="caps">CMS</span>, you can set the handler to a different value like this:</h4>
Copy file name to clipboardExpand all lines: doc/guides/source/developer_guide.textile
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,7 @@ If you look back at the form partial that was generated, you'll see:
148
148
149
149
What this does is preload the template with whatever you entered into the render template. The user is free to change it as they see fit and even have different values from one portlet instance to the next.
150
150
151
+
h4. Rendering Portlets views from the file system
151
152
If you do not want to have the portlet's render template entered in the CMS and would rather have it just render the file from the file system, simply add this to your portlet code:
152
153
153
154
<ruby>
@@ -168,9 +169,15 @@ The key line being the <code>render_line false</code>. Also, you will probably
This generates a drop-down menu for the user creating the portlet to select from the various portlet handlers installed in your Rails app. The default is erb, but you could install haml and use haml instead, for example.
172
+
This generates a drop-down menu for the user creating the portlet to select from the various portlet handlers installed in your Rails app.
173
+
The default handler for portlet views is erb, but you could use alternative ones, like Haml. To do that, install the HAML gem and set the default_value to 'haml' like so:
172
174
173
-
If you would rather not have the user select the handler type, or maybe you are using the file system instead of entering the template into the CMS, you can set the handler to a different value like this:
If you would rather not have the user select the handler type, or if you are using the file system instead of storing the template code in the CMS, you can set the handler to a different value like this:
0 commit comments