Skip to content

Commit b4c7329

Browse files
committed
improve template slots section
1 parent 98eba79 commit b4c7329

File tree

1 file changed

+58
-18
lines changed

1 file changed

+58
-18
lines changed

docs/classic-ui/views.md

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -238,32 +238,72 @@ http://localhost:8080/Plone/news/@@my-view
238238

239239
(classic-ui-content-slots-label)=
240240

241-
### Content slots
241+
### Template slots
242242

243-
```{todo}
244-
Fix the following link to "slot".
243+
In the generated template above, we have a fill-slot attribute, which will fill the slot with the name `content-core`, which is defined in Plone's [main_template](https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/browser/templates/main_template.pt).
244+
The following list shows the available options for `<metal fill-slot="">` in your template.
245+
246+
```{note}
247+
Please note that our template above inherits from `<html metal:use-macro="context/main_template/macros/master">`.
248+
```
249+
250+
#### Metadata in HEAD
251+
252+
- `top_slot`
253+
: Used to set parameters on the request, for example to deactivate the left and right columns or caching.
254+
```
255+
<metal:block
256+
fill-slot="top_slot"
257+
tal:define="dummy python:request.set('disable_border',1);
258+
disable_column_one python:request.set('disable_plone.leftcolumn',1);
259+
disable_column_two python:request.set('disable_plone.rightcolumn',1);" />
260+
```
261+
- `head_slot`
262+
: Used to define HTML headers like link tags for RSS and CSS.
263+
- `style_slot`
264+
: Used to define style tags to load CSS files.
265+
- `javascript_head_slot`
266+
: Used to define script tags to load JavaScript in the header.
267+
268+
```{note}
269+
Keep in mind that even though you can include CSS and JavaScript this way, most of the time you want to register it in the {rev}`Resource Registry <classic-ui-static-resources-label>`.
245270
```
246271

247-
The following list are the available {doc}`slot </adapt-and-extend/theming/templates_css/template_basics>`
248-
options for `<metal fill-slot="">` in your template.
249-
It inherits from `<html metal:use-macro="context/main_template/macros/master">`.
272+
#### Global status message
273+
274+
- `global_statusmessage`
275+
: Used to fill in global status messages.
276+
277+
#### Content slots
278+
279+
- `content`
280+
: The content area, including the title, description, content-core and viewlets around them.
281+
282+
- `body`
283+
: A slot inside the content macro.
284+
285+
- `main`
286+
: Overrides the `main` slot in the main template.
287+
You must render `title` and `description` yourself.
288+
289+
- `content-title`
290+
: `title` and `description` prerendered for Plone version 4.x or greater.
291+
292+
- `content-description`
293+
294+
- `content-core`
295+
: content body specific to your view for Plone version 4.x or greater.
296+
250297

251-
`content`
252-
: Render edit border yourself
298+
#### Asides / Portlets
253299

254-
`main`
255-
: Overrides the `main` slot in the main template.
256-
You must render `title` and `description` yourself.
300+
- `column_one_slot`
257301

258-
`content-title`
259-
: `title` and `description` prerendered for Plone version 4.x or greater.
302+
- `portlets_one_slot`
260303

261-
`content-core`
262-
: content body specific to your view for Plone version 4.x or greater.
304+
- `column_two_slot`
263305

264-
`header`
265-
: A slot for inserting content above the title.
266-
This may be useful in conjunction with the `content-core` slot if you wish to use the stock `content-title` provided by the main template.
306+
- `portlets_two_slot`
267307

268308

269309
(classic-ui-relationship-between-views-and-templates-label)=

0 commit comments

Comments
 (0)