Search Results Order

  • Hi all - I realized all my blog searches have the order wrong. So I added the sort and sort-order option. But nothing is happening:


    Blog results template:


    So shouldn't the results be showing the post in ascending order by post date?

  • If you are only searching blog posts, you probably can simply things by using perch_blog_custom() instead of perch_content_search() to perform the search:


  • Thanks hus_hmd - this worked mostly. The posts are in DESC order by date now finally, but it's not using the template to layout the design. I added the search-result.html template in, but it's not changing anything.


    So how do I use the search-result.html template on these results?

  • Since you're now using perch_blog_custom(), your template needs to be in templates/blog/. You can use your regular blog list template for instance:


  • You helped me do this in this thread: Use The Image In A Blog Post In Search Results


    When I suggested that approach in that thread I think I was under the impression you were searching content from multiple sources (not just the blog app). Now that I realise you're only searching blog posts, I'm suggesting you simplify the way you handle the search. This means you will need to modify some templates, but this is not a bad thing.


    It is not a huge change by the way. If you're unsure how to set up the template (or unsure why it is not working), post the desired HTML and either me or someone else would certainly help you.