#320 ✓resolved
Walter McGinnis

Add ability for add-ons to declare their controllers as needing content_wrapper start and content_wrapper end partials in application layout

Reported by Walter McGinnis | July 9th, 2012 @ 05:00 PM | in 1.4

Add ons that have full width content need to be able to declare that the need the proper wrapper divs put in the HTML of the layout template, otherwise they won't be indented properly and they also won't play nicely with themes.

Add hook methods to be able to declare an add-ons controller(s) as needing one or both of these partials included in their layout rendering.

Comments and changes to this ticket

  • Walter McGinnis

    Walter McGinnis July 9th, 2012 @ 05:09 PM

    • State changed from “open” to “resolved”
      # override in your add-on
      # to declare your controller
      # should return true for render_full_width_content_wrapper?
      # remember to alias_method :previous_add_on_full_width_content_wrapper_controllers, :add_on_full_width_content_wrapper_controllers
      # and return something like
      # previous_add_on_full_width_content_wrapper_controllers + your_new_array_of_values
      def add_ons_full_width_content_wrapper_controllers
        Array.new
      end
    
      # override in your add-on
      # to declare your controller
      # should return true for content_wrapper_end partial
      # remember to alias_method :previous_add_on_content_wrapper_end_controllers, :add_on_content_wrapper_end_controllers
      # and return something like
      # previous_add_on_content_wrapper_end_controllers + your_new_array_of_values
      def add_ons_content_wrapper_end_controllers
        Array.new
      end
    

    are implemented and merged to master.

  • Walter McGinnis

    Walter McGinnis July 11th, 2012 @ 11:49 AM

    • State changed from “resolved” to “open”

    This technique was prone to infinite loops. Adding module attribute that add-ons can add their controllers to instead.

  • Walter McGinnis

    Walter McGinnis July 11th, 2012 @ 11:50 AM

    Or I should say class attribute, not module attribute.

  • Walter McGinnis

    Walter McGinnis July 11th, 2012 @ 01:52 PM

    • State changed from “open” to “resolved”

    Merged to master. Now use the following to declare your controllers that need these partials:

    ApplicationController.add_ons_full_width_content_wrapper_controllers += array_of_controllers
    ApplicationController.add_ons_content_wrapper_end_controllers += array_of_controllers
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Kete was developed by Horowhenua Library Trust and Katipo Communications Ltd. to build a digital library of Horowhenua material.

People watching this ticket

Pages