This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

Copy the core file concrete/blocks/guestbook/controller.php to blocks/guestbook/controller.php - This is our new override file.

Open concrete/core/controllers/blocks/guestbook.php and copy the getEntries() function (lines 184-194 in v5.6.1.2, lines 192-196 in the latest v5.6.3.2) - This is where the default order of 'ASC' is located.

Edit blocks/guestbook/controller.php and paste the getEntries() copied above inside the GuestbookBlockController class.

Change the function declaration to this (~ line 9):

function getEntries($order = 'DESC') {  // Changed from $order = 'ASC'

Save the file - it should look something like this:

<?php defined('C5_EXECUTE') or die('Access Denied.');
class GuestbookBlockController extends
    concrete5_Controller_Block_Guestbook {
    * gets a list of all guestbook entries for the current block
    * @param string $order ASC|DESC
    * @return array
   function getEntries($order = 'DESC') {  // Changed from ASC
      $bo = $this->getBlockObject();
      $c = Page::getCurrentPage();
      return GuestBookBlockEntry::getAll($this->bID, $c->getCollectionID(), $order);
class GuestBookBlockEntry extends
    concrete5_Controller_Block_GuestbookEntry { }

More from jasteele12: Legacy - Documentation

Loading Conversation