Cook book
Rescuing a dysfunctional site from the Zotonic shell.
Creating a custom widget on the edit page Customizing the layout of the admin edit page Customizing the style of an…
Admin template specific things
Common markup in admin templates.
Automatically add new users to a user group
Why When you create a person, you usually need to add it to a user group as well. You may want to automate this, in…
Admin cookbook Creating a custom widget on the edit page Customizing the layout of the admin edit page Customizing the…
Zotonic comes with a large collection controllers that cover many use cases, so you’ll probably have to resort to…
Create custom template filters to change the way variables are rendered in your templates. By following some simple…
In this chapter we will look at how to implement a model around the The Open Movie Database (OMDB) API.
Custom tags, internally called scomps , are module-defined tags, which are used when the logic is too complex to be…
Creating a custom widget on the edit page
Why For an imaginary webshop edit page, we want to add 2 more data fields: the affiliate URL and a note about free…
Customizing the layout of the admin edit page
Why After having created a custom widget (see Creating a custom widget on the edit page), we want to hide widgets that…
Customizing the sign up and sign in form
You want to change parts of the form, or change its appearance.
Customizing the style of an admin page
How to make style customizations to admin pages.
Search can only sort and filter on resources that actually have a database column. Zotonic’s resources are stored in a…
Implement a custom search by observing the search_query notification in your module. Imagine you want to search cookies…
Techniques for finding root cause when queries are involved.
For the benefit of search engines and fans of tables of contents you can easily provide a site map.
Dynamic select options using a wired template
Why Suppose you want to wire a change event for a select box to update a another select box, i.e. you want to wire the…
Using growl outside admin requires some magic to make it work.
Get quicker access to Zotonic code on the shell.
Execute tasks asynchronously using the task queue
The Zotonic task queue lets applications perform tasks asynchronously.
Zotonic comes with a system for collecting and exporting metrics (such as how much memory is used, how many database…
Applying Erlang Binary syntax to get fast character manipulation.
These cookbook entries contain valuable nuggets of information regarding the frontend development of a site.
How to add a custom Content Block
Zotonic comes with a number of standard content blocks: Header, Text and Embed page. Additional content blocks are…
Specific error pages Zotonic’s controller_http_error first tries to find an error page template that is specific for…
Zotonic provides a couple of ways to show icons in templates:
Implementing a simple contact form
This tutorial teaches you to create a form, validate it, submit it over Ajax and e-mail the results back to you.
These Cookbook items each represent a stage in some Zotonic users’ journeys to understand the workings of Erlang and…
Just enough Erlang/OTP and rebar, part 1
Zotonic source code have you scratching your head? Learn Rebar first.
Just enough Erlang/OTP and rebar, part 2
Building a gen_server to front the library and generating documentation.
An indispensible tool for both learning and programming Erlang.
Understand the primary data-store of Zotonic.
Just Enough Regular Expressions (in Erlang)
Learn how to manipulate string data with the re module.
Logstash is often used for log centralization and analysis. This cookbook describes how to set up Zotonic for logging…
Managing redirection after login and signup
Configure mod_signup to redirect to something other than a member’s home page.
Create a custom action Create a custom filter Create a custom model Create a custom controller Custom pivots Create a…
This chapter describes how to override the templates, styling and logic provided by Zotonic.
Page-specific dynamic backgrounds
Use edges ( page connections ) to associate backgrounds with pages.
Search uses database indices on special pivot columns and full text fields.
Emergency password reset when you can’t get into the admin interface.
Restore/upgrade content db from backup
Contributed by: Scott Finnie
Retrieving the category of a page
Getting the category from a URL is somewhat involved, but not impossible. This is an example of what you can do with…
Security, templates and XSS prevention
Ensuring that you don't fall victim to cross site scripting and other injection attacks takes vigilance, eye for…
Share variable binding across blocks
How to avoid having to call the same query inside several blocks of the same page
Activate/deactivate modules Filter and convert characters Erlang tab completion Debugging db (query) issues Reset a…
Performing additional, project-specific actions when a user signs up
Some interesting tidbits about saving/updating a date/time field of a resource.
Updating form field from a dialog
Ever wanted to update a form field from a dialog, possibly giving the user some list to choose from? Here’s how to do…