Hi!
I made search result output with help of module VIEWS (by using your instruction «Views integration»)
There is a bug here...
In view settings I cannot change number of nodes per page (always 10 produced)
When I look on builded view – all looks alright – I see as many nodes per page as I did in settings, but in search results always 10. ((
It seems problem is here:
/**
* Format the search results according to this style's desire.
*/
function format_results($search) {
if ($view = views_get_view($this->_name)) {
$limit = variable_get('default_nodes_main', 10);
return views_build_view('embed', $view, NULL, TRUE, $limit);
}
}
When I change this 10 to another number N (by hand) – in search results N nodes per page produced
Comments
Comment #1
David Lesieur commentedAt the moment, Faceted Search is using the number of posts per page set on admin/content/node-settings rather than the view's number of nodes per page. Yes, this will need to be fixed.
Comment #2
inforeto commentedIt would be good if you let faceted_search_views.module print the whole view instead of faceted_search_ui.module.
After all, you are basically inserting a view within format_results(), so the exposed filters, the pager and argument handling code can be included.
faceted_search still know the env_ID and user ID to find the right data.
For example, in format_results() there is $view->nodes_per_page available, but theme_faceted_search_ui_stage_results() have its own paging code that does not have access to views.
It's views which must take care of the pager, number of results and message for empty results message, and all that is need to resemble a search results page.
Without this, you can't use alpha pager and grid layouts and all those things that external modules could add.
And the interesting part is that this might be done by cutting code rather than writing more.
What other things are done in faceted_search_ui.module for display that need views integration?
Comment #3
David Lesieur commentedThe initial request of using a view's nodes per page option has now been fixed.
@inforeto: What you suggest would certainly be ideal. I don't recall all the reasons that led me to build the view in the embed mode rather than the page mode, but it would be nice to experiment again with this. Patches would be very much welcome. ;)
Note that while it is true that some of Views' options and extensions cannot be used in embedded views, I'm pretty sure that view styles such as grids can be used.
Comment #4
David Lesieur commented