I am using Display Suite (7.x-1.5) to handle display of search results. In the Display Suite search settings (Structure / Display Suite / Search) I set the view mode to 'search result'.
When I then search for a term the 'search results' view mode is not honoured by display suite. Instead I can only see the output of advanced-forum.naked.topic-header.tpl.php.
I am also using my own custom templates for advanced forum as set by the following in my themes .info file:
plugins[advanced_forum][styles] = 'templates/forum'
Any ideas why display suite is not honouring the 'search result' view mode for forum topic search results?
Comments
Comment #1
swentel CreditAttribution: swentel commentedHad a quick look at the code. It think it's a racing condition problem with advanced_forum_theme_registry_alter(). As advanced forum has a lower weight, it will add its preprocess function after that of Display Suite, so when new template suggestions are added AF always wins.
Now, Display Suite's weight is 1, I could make it lower, but then field group needs to come along as well.
Another option could be this: add an checkbox in Advanced Forum on a settings screen (if there's one, I have no idea, don't know the module) to check for the Display Suite module and if so, not inject the preprocess function.
Not sure exactly to handle this, but I'll follow this thread for ideas or add more answers it there's any questions.
Comment #2
MichelleThanks, swentel. I don't think this is necessarily a bug but definitely needs some resolution.
There's already an option in the settings to make AF not style forum nodes that are shown in a view so adding an option to not show them in a DS search result doesn't seem like a bad idea as long as there is some way of determining when it is being listed in a DS search result.
I'm not sure when I'll be able to dig into actual code here... Possibly troky will beat me to it. I have an awful lot on my plate already. :(
Michelle
Comment #3
Swift Arrow CreditAttribution: Swift Arrow commentedHey! I had the same problem, and was about to post a "me-to" here, but then I saw this tutorial:
Tutorial on Search Display
It turns out that the Search Display has to be enabled in the search settings. Of course, you may have already done that, in which case, I hope that this link is useful for other perpetual beginners such as myself. :)
Just in case that link ever goes down, the basic procedure:
Hope this helps someone!
Comment #4
Swift Arrow CreditAttribution: Swift Arrow commentedI'm taking the liberty to close this, since it does work as designed.
Comment #5
crutch CreditAttribution: crutch commentedApologies, DS search is not working at all for me after many searches and following the video. Getting this error
Warning: Invalid argument supplied for foreach() in node_ds_search_execute() (line 437 of C:\xampp\htdocs\*\sites\all\modules\ds\modules\ds_search\ds_search.module).
Comment #6
troky CreditAttribution: troky commentedAbove warning is form DS, not AF. Can't help you with that.
Comment #7
crutch CreditAttribution: crutch commentedoops, how did i get here, sry about that
Comment #8
Kendall Totten CreditAttribution: Kendall Totten commentedThank you Swiftarrow, #4 worked for me!
Comment #9
mahipal46 CreditAttribution: mahipal46 commentedPlease enable module "Display Suite Search Result" .then go to search setting in configuration page
then in "Active search modules" check Display Suite Search. also Default search module is Display Suite Search. it will works.
Comment #9.0
mahipal46 CreditAttribution: mahipal46 commentedtypo fix