Exercise 9: Overriding a pattern TTW¶
This exercise requires a working buildout using a fork of the collective.jstraining package.
In this exercise, we’ll be overriding a pattern through the web.
We will be working in the
exercise9 directory of the collective.jstraining package.
Overriding resources through the web is limited to resources using the ++plone++ namespace. For more information read https://docs.plone.org/adapt-and-extend/theming/resourceregistry.html#the-plone-traversal-namespace
In this exercise, we will first run the installation
- Start up your Plone instance
- Install the
Try current pattern¶
Add a new page, and using the source code editor add a
<p> element with the
After saving, you should see
test Exercise 9 was here
Choose the pattern to override¶
Go to the Site Setup, then to the Resource Registries.
Overrides tab, pick ++plone++exercise9/pattern.js
Now modify the line
that.$el.append(' <span>Exercise 9 was here</span>');
that.$el.append(' <span>Exercise 9 has been overridden</span>');
Go back to the
Registry tab, and find the
Build button. Finally, click
Now, if you go back to the page you added before, you should now see
test Exercise 9 has been overridden