Add "customize" tab to change layout static text and images

33 views
Skip to first unread message

Luis González

unread,
Apr 10, 2014, 3:24:18 PM4/10/14
to refine...@googlegroups.com
Hi,

First of all I'm new to RoR and Refinery.

I'm trying to add a new tab in the backend so the admin can change some text and images that appear in the layout, that is, in every page.

So creating a new engine I think it doesn't make any sense for this situation. Instead I'm thinking about creating a model. The thing is I have no idea of how to create this new tab and associate it to this model...

Any Idea?

Thanks in advance

Using Refinerycms 2.1.2 and Rails 3.2.17

Andreas Wenk

unread,
Apr 14, 2014, 8:49:52 AM4/14/14
to refine...@googlegroups.com
Hi Luis,

I guess this is what you are looking for:


Cheers

Andy

Luis González

unread,
Apr 22, 2014, 12:47:10 PM4/22/14
to refine...@googlegroups.com
Thanks,

That is not exactly what I meant. With this, you can add a section to every page and personalize it. But what I want to do is to personalize the layout.
In my case, that is the Main title of the page, a description (below the title) and a Photo. These three elements appear in every view, that is, belongs to the layout.

Haven't found a good way to do it yet. Just a workaround that works, but for sure is no the right way to do it:

I created a new Engine (customization), and create only one element in it. I get this element from the layout view and print the parts.
To edit from the backend, I changed the index view and just print the form (as with the show action), as I only need one element (I disabled the remove option, as it would break the layout).

As said,at least it works...

If anyone find a better solution please, let me know.

bdixon

unread,
Apr 22, 2014, 5:32:17 PM4/22/14
to refine...@googlegroups.com
That's basically what I would have done, especially if there are fixed number of elements. You could go a step further and assign them to various layout files... but if it isn't in scope, don't bother.

BD

Luis González

unread,
Apr 24, 2014, 6:14:15 AM4/24/14
to refine...@googlegroups.com
Thanks for your anwser ;)
Reply all
Reply to author
Forward
0 new messages