Skip to content

Docs: Instance Variables

Morgan Aldridge edited this page Apr 22, 2022 · 3 revisions

Pages rendered by ComfyArchive have access to @cms_index, @year, @month, and @category instance variables.

The only ways that these are really accessible is if one were to set an Archive Index to force render page (see Archive Indices), then have the layout for the page render a partial. The instance variables are accessible within the partial.

Note: Prior to version 0.3.0, the @category instance variable was just the Comfy::Cms::Category label as a String, but it now contains the persisted Comfy::Cms::Category record. Additionally, if you have disabled the strict_categories configuration option and visit a path for a nonexistent category, the @category instance variable will contain a new, non-persisted Comfy::Cms::Category record with the label populated based on the category portion of the path.

Clone this wiki locally