Skip to content

Instantly share code, notes, and snippets.

@mcrider
Created March 11, 2014 19:57
Show Gist options
  • Save mcrider/9493766 to your computer and use it in GitHub Desktop.
Save mcrider/9493766 to your computer and use it in GitHub Desktop.
A rough overview of how custom modules would be implemented in the project side of an rCMS site.
# This is essentially the same file as the block (cell) descriptor file.
# Its purpose is to define custom content types and the fields they contain.
# This file would live in the project's app/custom_modules/rcms/directory
# Actual implementation may vary.
custom_modules:
- name: Doctor
action: doctor
description: A doctor custom content type
settings:
cover_image: image
name: string
bio: html
publications: block_container
- name: Portfolio
action: portfolio
description: A portfolio custom content type
settings:
thumbnail: image
name: string
description: html
tags: tag_list
photos: block_container
/ Index view for a custom module
/ This would be web-accessible at e.g. http://foo.com/doctors
/ If following the same pattern as existing modules, we'd also need
/ a _doctors.html.slim which the 'render' function uses as the template for an item on the index page.
#content
section.portfolio
.container
.portfolio-items
== render doctors
== paginate doctors
/ Detail view for a custom module item.
/ This would be web-accessible at e.g. http://foo.com/doctors/john_smith (this template would
/ be integrated into the main application layout like a page template would).
#content
article.container
#main-content
header
h1 = doctor.name
p.body = doctor.bio
.publications
- render_blocks_for(doctor.publications)
.sidebar
= render partial: 'sidebar'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment