Understand pages and connections

any_thing.jpg

See how resources, categories, predicates and collections fit together.

Almost everything you edit in Zotonic is a resource: an article, person, image, keyword or collection. Each resource has an ID, properties such as a title, and one category. A unique name gives developers and imports a stable way to find it even when its title changes.

A category describes what the resource is. Categories form a hierarchy: an image is also media. Categories affect the available fields and how a page is displayed.

A connection joins two resources in a direction. Its predicate describes the relationship. For example, an article can have an outgoing author connection to a person; a collection has outgoing haspart connections to its members. The order of those members is part of the collection's structure.

Use existing keywords through subject connections to make content discoverable. Add a relationship instead of copying the same information into several bodies. For these documentation guides, related tasks use relation, and reference material uses hasreference. Automatically discovered body references use refers and are maintained by admin.

Publishing and access are separate. A page may be marked published but be outside its publication period or restricted to a user group. Test it as the intended reader. Being allowed to edit a page does not imply permission to link every other resource.

Referred by

Developer guide

Use stable resource names

A resource has a numeric ID within its database. Give application-owned resources a stable name when code needs to find them across installations.

Models

rsc

The main resource model, which is the central part of the Zotonic data model. This model provides an interface to all resource ("page") information. It also…

Documentation

Glossary

Action An action is functionality that can be attached to a HTML element or event. Actions are wired to an element or event. Think of showing dialogs, posting…

Developer guide

Create a page layout

Use an existing site base template as your starting point. Put shared document structure in the base and page-specific markup in blocks.

Modules

mod_admin_predicate

Add support for editing predicates in the admin, by presenting a list of all defined predicates on http://yoursite.com/admin/predicate .