I have to render dynamic content (search result of offers) in an Alchemy CMS page.
First I made, in the cms-backend, a page called "searchresult".
I made an element without essences. A table should be rendered.
The seachform has as action /searchresult
and the page is called with the (get)-search params:
/searchresult?utf8=✓&searchmaingroup=bb&searchprofgroup=4100
But where can I collect the data for this?
I tried a page_layout with the configuration option "controller" and "action" to an own controller
- name: offersearch
elements: [header, resulttable]
autogenerate: [header, resulttable]
controller: offers
action: index
cache: false
Controller:
OffersController < Alchemy::BaseController
def index
end
end
But this makes still a redirect to this controller and the searchparams are lost.
Is there any "hook" in Alchemy cms where I can catch the searchparams and fill a variable like:
@offers = Offer.where(...)
and take this to the cms page element (view-partial)
I tried to find a solution here: Creating a custom Guestbook Module for Alchemy CMS
But this is unfortunately not complete enough for me. (The custom offer-module in my CMS backend works fine.)