Default Page Blocks

Permalink Browser Info Environment
Is there any way to make Easy News publish a default page block? I want each story to have a comment block and have tried this by inserting it into the page type default, but it does not display when I add an Easy News entry through the Dashboard.

Thanks
Spencer

Type: Discussion
Status: New
SpencerC
View Replies: View Best Answer
hanicker replied on at Permalink Reply
hanicker
Can you try this fix?

in easy_news/controller.php

replace
foreach($blocks as $b) {
         $b->deleteBlock();
      }

with
foreach($blocks as $b) {
         if($b->getBlockTypeHandle()=='content')
            $b->deleteBlock();
      }

Hope this helps.
SpencerC replied on at Permalink Reply
SpencerC
Thanks for your suggestion, however the code is not in that file. Here's the code from Controller.php:

<?php  
defined('C5_EXECUTE') or die(_("Access Denied."));
class EasyNewsPackage extends Package {
   protected $pkgHandle = 'easy_news';
   protected $appVersionRequired = '5.4.0';
   protected $pkgVersion = '1.1';
   function __construct(){
      Loader::library('controller',$this->pkgHandle); //Used by controllers
      Loader::library('dashboardcontroller',$this->pkgHandle); //Used by controllers
   }
   public function getPackageDescription() {
      return t('Add multiple news area to your site.');
   }
   public function getPackageName() {
      return t('Easy News');
hanicker replied on at Permalink Reply
hanicker
Argh, sorry. It's in easy_news/controllers/dashboard/easy_news/controller.php.
SpencerC replied on at Permalink Reply
SpencerC
It worked!

Thanks for your help.

-Spencer
SpencerC replied on at Permalink Reply 1 Attachment
SpencerC
Oops! It almost worked. The content as entered in Easy News in the Dashboard landed in the block below the Comments. So it auto-populated, but in the next available block of the Main Area as opposed to pushing the block set in the default page below the news. Is there a remedy? I've attached a screenshot.

Thanks for your help,
Spencer
hanicker replied on at Permalink Best Answer Reply
hanicker
Try changing (in same file)
from
$p->addBlock($bt, 'Main', $data);

to
$b=$p->addBlock($bt, 'Main', $data);
      $b->setBlockDisplayOrder(1);


Hope this fix
SpencerC replied on at Permalink Reply
SpencerC
Worked. Cool!

Thanks,
Spencer

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.