Pages

Pages in fragmenta are containers for one or more fragments. If a folder inside the root Content folder has listable fragments in it, a corresponding folder will be produced in output with an HTML version of the fragments. If it contains no listable fragments, it will be ignored.

Fragmenta Pages

Each page in Fragmenta has a corresponding folder in the Content directory. Normally the folder will be recreated at the same place in the hierarchy of folders in the Website directory as it had in the Content directory. The only exception to this is folders in Content which end with .page – these are interpreted as pages inside their parent folder, rather than actual folders in the output. So if a page was at Content/gallery.page, the output website folder would contain gallery.html at the root level, rather than a gallery folder containing an index. This is useful if you prefer to have lots of named pages inside each folder, rather than a single index per folder.

Page templates

Normally pages will be constructed using the default page template at

/Style/views/page.rb

if there is a template at

/Style/views/your_page_name/page.rb

then that template will be used instead. You can also set the ‘view’ field in your page to set the template used (the same can be done for fragments).

Page.info files

Each page may contain a page.info file, which is a special fragment containing details about that page, such as title, sort order, and any other attributes you’d like your pages to have. You can add as many fields as you like, however the following fields may come in handy. All of these fields have sensible defaults, so you don’t have to have a page.info file at all if you have nothing which needs customising.

  • title :: The page title available using page_title in templates
  • short_title :: The page title shown in navigation lists and breadcrumbs
  • id :: The page ID
  • order :: The sort order – navigation will sort by this field if available
  • list :: Should this page be listed in navigation? If set to no, this field stops the page showing up in navigation lists
  • view :: The name of the template file used (can include path in views folder, e.g. site/search )
  • html_name :: The name of the html file generated (by default index.html)
  • rss_name :: The name of the rss file generated (by default index.rss)
  • order :: The sort order – can be used to sort order in navigation

Fragmenta manual

© Kenny Grant
and Mechanism Design

Hosted by Slicehost

Built with Fragmenta