I am not sure, but I think I cannot use this filter as I want to make a frontend filter for users (i.e. a buttons to sort by rating, date etc). Or is it possible to execute the filter only after a button is submitted?

You don't need a filter. Paged results is kind of a bitch to get working correctly within PageLines. There's a default section called Pagination that will work with your query in your section. Just drag the Post/Page Pagination section below your new section.

I already was using the Post/Page Pagination section below the new section, hence that's not it.

I understand the pre_get_posts filter is the best solution as it runs (as it's name suggest) before the first query and prevents unnecessary requests, but I don't know how to execute it out of a form action. Any ideas?

An alternative could be to use wp_query. Any ideas how I can use a custom wp_query within Pagelines?

I just went through all of this as I wrote AnyLoop, a custom post loop section on the store. It has multiple wp_queries and can run simultaneously. And after much frustration, using the section I described works, with wp_query. Feel feel to experiment on your own, I'm just trying to save you some time.

Just create your own section using the Base Section (known as the free Pull Quote example section in wp admin store), drop in the query, and fashion the output how you please. Then just drop the section on whatever you page you want.

I can change the array of the query_post to get any custom loop I would like. However, using query_posts gives trouble with the pagination. I read on a couple of forums that I should use wp_query. Let's say I would like to query only cat 3. Wordpress codex shows this code:

I cannot imagine this is hard for a pagelines developer Pretty basic customization stuff I would say. It would be very much appreciated if someone could give an example of how I can do a custom wp_query in Pagelines while using the Pagelines loop.

Thank you for your time!. Actually I already had the filter working. What I am trying to accomplish is a couple of buttons wihch users can click to sort the posts (based on rating, views and date). I would like to have the filter buttons above all loops and behave dynamic. Hence, when a user is on a category/taconomy/tag page it will filter the posts within that taxonomy. My guess was that I should use a custom wp_query instead of the pre_get_post filter to allow dynamic behaviour? That is why I was looking for an example of a wp_query instead of query_posts within pagelines?

In the meantime I could show the buttons only for the mainloop on the homepage. The code below works, but not with pagination... :-) Maybe because the pre_get_posts filter gets the $filter variable to late or something?