footer menu - setting "show_in_footer to true"

209 views
Skip to first unread message

Anks

unread,
Sep 24, 2013, 6:57:47 AM9/24/13
to refine...@googlegroups.com
Hi....
I was trying guide related to footer, provided within refinerycms website (http://refinerycms.com/guides/menu-presenter).
I was able to perform all settings provided within this guide except for setting "show_in_footer to true".

Please suggest where can I set this parameter. 

Thanks,
Anks

Philip Arndt

unread,
Sep 24, 2013, 5:27:10 PM9/24/13
to refine...@googlegroups.com
You have to invent that, it's not provided by default. Read again:

1 Background

I have added show_in_footer boolean attribute to pages (this is just a matter of creating and running a migration) and now I want to display these pages in the footer section of my site.

Anks

unread,
Sep 25, 2013, 2:01:21 AM9/25/13
to refine...@googlegroups.com
Hi Phillip
Thank you for your quick reply.

As suggested, I tried below migration:

--------------------
class AddShowInFooterToRefineryPages < 

ActiveRecord::Migration
  def change
    add_column :refinery_pages, :show_in_footer, :boolean
  end
end
--------------------

It successfully added column to refinery_pages table.
Also followed all steps provided within guide.
Then, I tried to find "show_in_footer" attribute in Refinerycms admin pages.. but could not find such option ...
I am not sure if refinery_pages table is the right place to add this attribute. Also, I am not sure if I should be looking for this attribute within Refinerycms admin pages (like existing "Show in menu" option)?

(Note: I also tried to add above attribute to "pages" table, but it gives "no such table" error)

It will be very helpful if you could suggest the right way to set the "show_in_footer" attribute, please!!

Thank you again!!

Best Regards,
Anks

Randie

unread,
Oct 2, 2013, 9:32:44 AM10/2/13
to refine...@googlegroups.com
Hello everyone,

I have been working with RefineryCMS for a few months now and I think it is quite a powerful CMS. I also appreciate the work done by its developers and the fact that they made this work available for everyone to use. Having said that, I have to also admit that documentation is poor and sometimes even outdated. I am not judging here; I know how much time it takes to properly document things, but on the other hand it also saves time from having to answer to all the questions posted by users.

In this particular post -and without any offence- I feel that parndt's vague and half-hearted answer fails to clarify a good but slightly incomplete guide.

I will write here the procedure that I followed. It doesn't mean that this procedure is the right way of adding a footer menu, but it worked for me.

Step 1 Background (http://refinerycms.com/guides/menu-presenter): I run the following in my terminal "rails generate migration AddShowInFooterToRefineryPages show_in_footer:boolean" and "rake db:migrate".
Steps 2 through to 4, as explained in the guide.
For the last step, I had to log in on my database and manually set the show_in_footer attribute to true.

In my opinion I cannot see how this footer menu can be considered as dynamic, if I have to mess directly with my database each time I want a page to appear in the footer. I guess to be able to select which pages should show in footer through Refinery's backend, one would have to override the form and add some check box or something similar, as mentioned in this post: https://groups.google.com/forum/#!searchin/refinery-cms/override$20the$20form/refinery-cms/G0XmwBj_9Ho/cfmY2vcAQ6cJ . However, without any guide available, overriding the form sounds quite scary to me.

PS: After following this guide for the first time, I had the following error: "uninitialized constant Refinery::Pages::MenuPresenter". Setting up a new project and following the guide again "fixed" the problem, but it also meant that I had to migrate to the fresh project all my html/css, content and any changes I had made... I didn't manage to figure out why this happened, but I think it may be because I had already overridden the footer partial before following the guide.

Hope my answer helps.

Uģis Ozols

unread,
Oct 3, 2013, 1:52:35 AM10/3/13
to refine...@googlegroups.com
Randie  - I wrote the MenuPresenter guide and what seemed trivial to me seems to trip up many Refinery users so thank you for confirming it.

I already have a couple of drafts where I have rewritten the guide in more detail and I even started to record a screencast yesterday but I'm not satisfied with the quality of the content I have produced so I'll keep working on it and hopefully will release something soon.

Thanks.

Anks

unread,
Oct 3, 2013, 7:20:36 AM10/3/13
to refine...@googlegroups.com
Hello All - Thank you for directions provided within your replies ....
Right - I am also new to RefineryCMS, that's the reason get stuck sometimes, if  tweaking is required within RefineryCMS code...
Thank you Randie, overriding form solved the problem, and right - overriding form without any guide reference is scary for me as well :) ..  ...

Ugis / Phil - RefineryCMS is fabulous, which makes new RoR developer's (like me) life lot easier, helps including various quality web-features very quickly ..
Improving on the documents/guides/videos will make our web-development even easier ...
Thank you again for all your efforts and support!!! 

Cheers,
Anks

Uģis Ozols

unread,
Oct 4, 2013, 9:23:11 AM10/4/13
to refine...@googlegroups.com
Hey all,

I have opened https://github.com/refinery/refinerycms/pull/2429 which contains updated Menu Presenter guide. Could you take a look and make any corrections/suggestions you have?

Thanks!

Anita Graham

unread,
Oct 4, 2013, 11:33:52 AM10/4/13
to refine...@googlegroups.com
(I found the Additional Menus guide from a link in this topic. I can't see it from the Guides Index. Where should I see it?)

Having done a similar thing for Testimonials (added fields to the Refinery Page method) I'd suggest you need to add your control field to the part of the Admin Page form which generates the Advanced Page attributes fields.
This is done in /refinerycms-pages/app/views/refinery/admin/pages/_form_advanced_options.html.erb.  I would guess that a straight override is not ideal, but I wonder whether there is a better method.

For testimonials I created a separate tab with several related fields, however show_in_footer sounds as though it would sit well next to show_in_menu.


Randie

unread,
Oct 4, 2013, 1:46:48 PM10/4/13
to refine...@googlegroups.com
Hi Uģis,

Thanks for your answer. The updated guide on github is much clearer now and complete.

I was wondering, though, if it would be possible in this footer menu to arrange the appearing pages not based on the site's hierarchy but based on my own preference. What I mean to say is that, following this guide, I can now easily choose which pages will appear in the footer menu, but is it also possible to sort them the way I want?

Thanks a lot!
Message has been deleted

Anks

unread,
Oct 5, 2013, 6:14:10 AM10/5/13
to refine...@googlegroups.com
Hey Ugis - Thanks a ton for latest Menu Presenter guide on github ...
I executed  code and instructions provided within this new guide, and would like to mention that instructions are very easy to follow and provided code is working fine.
This provides flexibility  to implement footer / additional menu anywhere on the web-page.
I believe this new guide on git-hub will be merged with existing guide on refinerycms website, as code snippet for ApplicationHelper is provided within refinerycms website guide but not mentioned within guide on github...
I appreciate your all help and thank you again for this superb guide!!!

Cheers,
Anks

Uģis Ozols

unread,
Oct 5, 2013, 4:34:52 PM10/5/13
to refine...@googlegroups.com
The updated guide was merged and is now available at http://refinerycms.com/guides/menu-presenter.

Randie - of course it's possible to display pages in whatever order you like but depending on what you want you'll probably have to write that functionality yourself. If you have any issues just post here and I or someone else will try to help.

Philip Arndt

unread,
Oct 6, 2013, 12:39:42 AM10/6/13
to refine...@googlegroups.com
Uģis is my hero!

Uģis Ozols

unread,
Oct 7, 2013, 1:48:09 AM10/7/13
to refine...@googlegroups.com
*blushing*

Also thanks to all who contributed to make this guide better than it was!

On Sunday, October 6, 2013 7:39:42 AM UTC+3, parndt wrote:
Uģis is my hero!

Anks

unread,
Oct 7, 2013, 9:36:54 AM10/7/13
to refine...@googlegroups.com
You guys rock!!! New uploaded guided is perfect!!!

Thank you - Anks ...

Randie

unread,
Jan 23, 2015, 2:19:43 PM1/23/15
to refine...@googlegroups.com
Hello Uģis,

I was wondering if it would be possible to edit this guide, so that the second menu can also work in Rails 4. Since attr_accessible was deprecated in Rails 4, the line "attr_accessible :show_in_footer" breaks the app. I have tried to use the gem "protected_attributes" in combination with this line, but it doesn't help much, as the application does start, but the "show_in_footer" checkbox fails to update the respective field in the database.

Many thanks in advance!

Randie 
Reply all
Reply to author
Forward
0 new messages