Skip to main content

The base content object model (v2)

Content objects

Tuskfish is designed to allow you to publish common forms of web content - articles, audio, video, images, downloadable files, GPS tracks and static pages - and to organise them with subject tags and collections. The different types of content are managed via a single data entry form and co-exist in a common database table.

This works because Tuskfish content objects are designed around the Dublin Core Metadata Element Set, a vocabulary of fifteen general properties for describing resources. It doesn't matter whether you are posting an article, photo or video - they all have (or can have) a title, author, description, publication date, format, type and so on.

Tuskfish uses a subset of the Dublin Core plus a few "web staples" (view counters, submission times etc) to define a single content class, \Tfish\Content\Entity\Content. Content objects have a 'type' property that specifies what kind of content they represent, and what kind of templates are appropriate to display them.

Every online content object in the system can be accessed from the home page by passing in its ID as a parameter in the query string, for example: https://yoursite.com/?id=42.

Content objects are treated as entities, ie. they are dumb data stores that offer accessor methods and a few utilities. As per the MVVM architecture, methods for filtering, retrieving and handling content objects are contained in the relevant model class for a route, which are usually called via method calls on the relevant viewmodel class. The viewmodel is injected into the templates, allowing content objects to be pulled into the templates for display, allowing their properties to be accessed directly.

Copyright, all rights reserved.