Hi there!
I've started helping out with a project that has been built primarily using Panel Nodes. From what I understand, those are being depreciated in place of Panelizer (The latter I prefer anyway, given that it lets any content type have Panels instead of shoehorning all per-node Panels functionality into a single content type).
We're pretty close to moving everything from Panel Nodes to Panelizer, however, there's one (pretty major, really) sticking point -- Drupal stock search doesn't seem to index Panelizer panels, even though it's able to for Panel Nodes.
My methodology:
1. Create a new Panels node.
2. In Panel Content, create a custom bit of content (Either via "New custom content" or via "Page Content" > "HTML Text"). In the content body, type a unique string.
3. Create a new node in a Panelized content type.
4. Repeat the process in step 2, using the same unique string.
5. Run cron to index the content.
6. Search for the unique string.
The Panels node will show up; the Panelizer node will not.
I'd really like to not have to use Apache Solr search for this project. Is there any way to make Panelizer content panes searchable? If not, I think it's a fairly important feature, especially if you're depreciating Panel Nodes in favour of Panelizer (Again -- an idea I wholly support!).
Thanks!
Comments
Comment #1
merlinofchaos commentedUpdate to the 3.x branch and use the view mode functionality instead of the page manager override. Search will index that.
Comment #2
merlinofchaos commentedFailing that, there is an alter hook you can use to add the panel info to the search. You'd have to load the node's panelizer manually and add it to the node content, but it wouldn't be more than half a dozen lines of code, I think.
Comment #3
aendra commented@merlinofchaos -- Thanks a tonne for the response, that's quite helpful.
Two more quick questions --
a. How stable is the 3x branch of Panelizer? How long until it's a recommended release? We're wanting to use this on a production site and are slightly worried about using a dev module for such a large piece of functionality.
b. If I'm understanding you correctly -- I'd use hook_node_update_index(), load all panels content into something sensible, and then return that?
Thanks again for the help, I'm super appreciative of the work you do and know you probably have a trillion other more pressing issues than providing support for something fixed in dev.
Comment #4
merlinofchaos commentedIt's pretty stable; it's in use on a client site now. I plan to have a stable release of it within the next week or so.
For question two, yes, that sounds more or less like what you'd have to do.
Comment #6
r2integrated commentedHey all, I wasn't able to get search to index the final rendered Panelizer output even following Earl's instructions in #1, so I decided to implement the code mentioned in #3. Here it is in case it helps anyone - Earl, please let me know if I've butchered this. I implemented the following by adapting panelizer_entity_view_alter():
Comment #7
damienmckennaWhat view mode should be customized in order to get this to work - the "Default" one?
Comment #8
merlinofchaos commentedIf I recall, there is a specific 'search' view mode that can be customized for this purpose. If it isn't customized it should just fall back to the defaults.
Comment #9
merlinofchaos commentedThere is a 'search index' view mode; a patch I committed today will have Panelizer respect the setting for it. Until today you couldn't actually customize that view mode. With a 3.x-dev dated from today or later, you need to go to manage display, select custom settings, and check the 'search index' to make it customizable. Then you can add panelizer information to it for the purposes of searching.
Comment #11
cyprien2 commentedCan i have a complete receipe to have a text field indexed by the default search drupal module ?
Thanks in advance