Forum

Thread tagged as: Question, Blog

Modifying the Blog App main view

Hi there

I was wondering if it's possible to modify the main view of the Blog app. By default it shows: Title / Status / Date

Is it possible to take data from the blog post and insert it into the view?

As per my screenshot / crude mockup: https://i.imgur.com/rJt71VQ.jpg

I have managed to modify the view so it shows an unlimited amount of stories rather than the pagination which was set at 15 so looking to see if the above if possible. I presume it's much trickier though than just editing a number?

Regards

Rich

Rich Hemery

Rich Hemery 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

There’s no interface for modifying that listing currently. That’s restricted primarily to Collections at the moment, but we could conceivably extend it out for add-ons to use too.

Thanks Drew. On a related(ish) note... (let me know if I should open up a new thread)

On the same site we are using the standard Perch search: https://lovebedfordoffers.co.uk/search.php?q=debenhams

Is it possible for the search to look up/filter as the Blog addon does? Currently all of our blog posts (offers) appear in the search, but I was wondering if the code could be modified to work like the blog does so it only shows offers that haven't expired yet...

For example, the code for the search is:

<?php perch_search_form(); ?>

<?php
    $query = perch_get('q');
    perch_content_search($query, array(
        'count'=>500,
        'from-path'=>'/offers',
        'excerpt-chars'=>300
      ));
?>

The code on the offers page is:

  <?php perch_blog_custom(array(
                'count' => 100,
                'template' => 'post_in_list.html',
                'sort' => 'expires',
                'sort-order' => 'ASC',
                'filter' => 'expires',
                'match' => 'gt',
                'value' => date('Y-m-d H:i:s'),
            ));
?>

I've tried bits and pieces but I presume it doesn't work because one is ' <?php perch_blog_custom(array(' and one is ' perch_content_search($query, array('

Apologies my PHP knowledge is very limited.

Regards

Rich

Drew McLellan

Drew McLellan 2638 points
Perch Support

At the moment you can't really mix free text search with filtering. It's more one or the other. This is something we're looking into a solution for.