--- myst: html_meta: "description": "" "property=og:description": "" "property=og:title": "" "keywords": "" --- (plone5-views1-label)= # Views I ````{sidebar} Get the code! Code for the beginning of this chapter: ```shell git checkout export_code ``` Code for the end of this chapter: ```shell git checkout views_1 ``` {doc}`code` ```` In this part you will: - Register a view that can be opened in the browser - Create and use a template for the view Topics covered: - ZCML (plone5-views1-simple-label)= ## A simple browser view Before writing the talk view itself we step back and have a brief look at views and templates. A view in Plone is usually a {py:class}`BrowserView`. It can hold a lot of cool Python code but we will first focus on the template. Edit the file `browser/configure.zcml` and register a new view called _training_: ```{code-block} xml :emphasize-lines: 20-25 :linenos: ``` Add a file `browser/templates/training.pt` ```html

Hello World

``` - Restart Plone and open . - You should now see "Hello World". You now have everything in place to learn about page templates. ```{note} The view `training` has no Python class registered for it but only a template. It acts as if it had an empty Python class inheriting from `Products.Five.browser.BrowserView` but the way that happens is actually quite a bit of magic... ```