Custom Fields in Refinery Cms

Custom fields in Refinery CMS

Have a look at the (excellent) Getting Started with Refinery guide. In Section 6 the guide lays out how to add extra fields - in the example date, picture and blurb - using engines:

http://refinerycms.com/guides/getting-started-with-refinery#extending-refinery-with-your-first-engine

Refinery CMS: Adding custom field to custom engine index page

Our preference however is to create custom page parts in the normal pages section, rather than to use the copywriting engine.

Under the pages admin section you should see that a page has been added for pianos.
If you add a new page part (or even use an existing one), you can then retrieve and render it from the engine's index page like this:

<%= raw @page.content_for(:new_page_part) %>

How do you loop through a field on a custom engine in refinery cms

To the best of my knowledge there isn't a built-in Refinery process for this. has_many would be the way I would approach the problem.

how to add custom routes to refinerycms

@manosagent, i can add routes like that:

Refinery::Core::Engine.routes.prepend do
get 'news/more' => 'news::items#view_more', as: :news_view_more
get 'notices/more' => 'notices::notices#view_more', as: :notices_view_more
end

but i don't understand why new/more appears twice in rake routes, i need to dig deeper ...

What is the currently accepted way to embed forms in Refinery CMS sites?

The refinerycms-generators extension was merged into Refinery itself and there exists a form generator in there. To get the syntax, just run:

rails generate refinery:form

It will present you with the help for the generator.

This is currently your best bet for spending the least amount of effort to get forms like refinerycms-inquiries.



Related Topics



Leave a reply



Submit