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 page Storing date/time fields Admin…
Common markup in admin templates.
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 particular if you need to differentiate…
Admin cookbook Creating a custom widget on the edit page Customizing the layout of the admin edit page Customizing the style of an admin page Storing date/time…
Zotonic comes with a large collection controllers that cover many use cases, so you’ll probably have to resort to custom controllers less often than you may be…
Create custom template filters to change the way variables are rendered in your templates. By following some simple rules, Zotonic will automatically find the…
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 executed in templates.
Why For an imaginary webshop edit page, we want to add 2 more data fields: the affiliate URL and a note about free shipping.
Why After having created a custom widget (see Creating a custom widget on the edit page), we want to hide widgets that we don’t need.
You want to change parts of the form, or change its appearance.
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 serialized form. This allows you to very…
Implement a custom search by observing the search_query notification in your module. Imagine you want to search cookies in your database that either have…
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.
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 action to use the selected value when…
Using growl outside admin requires some magic to make it work.
Get quicker access to Zotonic code on the shell.
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 requests were made, etc.) called Exometer.
Applying Erlang Binary syntax to get fast character manipulation.
These cookbook entries contain valuable nuggets of information regarding the frontend development of a site.
Zotonic comes with a number of standard page blocks: Header, Text and Embed page. Additional page blocks are provided by modules, for example mod_survey uses…
Specific error pages Zotonic’s controller_http_error first tries to find an error page template that is specific for the HTTP status code, named templates…
Zotonic provides a couple of ways to show icons in templates:
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 related technologies in general.
Zotonic source code have you scratching your head? Learn Rebar first.
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.
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 to Logstash over UDP. As mentioned in the…
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 custom tag Custom search Pivot Templates…
This chapter describes how to override the templates, styling and logic provided by Zotonic.
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.
Contributed by: Scott Finnie
Getting the category from a URL is somewhat involved, but not impossible. This is an example of what you can do with filters.
Ensuring that you don't fall victim to cross site scripting and other injection attacks takes vigilance, eye for details and especially some good naming habits.
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 user’s password Restore/upgrade content db…
Performing additional, project-specific actions when a user signs up
Some interesting tidbits about saving/updating a date/time field of a resource.
Ever wanted to update a form field from a dialog, possibly giving the user some list to choose from? Here’s how to do it.