← Back to team overview

mahara-contributors team mailing list archive

[Bug 1645840] [NEW] Allow the site templates to have access to the same blocks as the page it will create

 

Public bug reported:

Once some of the default blocks are deleted from a template in
Administration -> Configure site -> Pages, it is not possible to add
them back in. for example 'Personal info' blocks to the Dashboard
template.

This is due to the site template not being treated the same as the page type it will create.
 
To allow the block options to appear on the template edit screen we need to either adjust the relevant blocks by adjusting their 

    public static function allowed_in_view()

function so that it also returns true for the site template page, eg for
'Personal info' block change

        return $view->get('owner') != null;

to 
        return $view->get('owner') != null || (int)$view->get('template') === View::SITE_TEMPLATE;


But it would be better if we created a step or function that allows the site template to mimic the rules for the type of page it is a template for

** Affects: mahara
     Importance: Wishlist
         Status: Confirmed

** Changed in: mahara
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1645840

Title:
  Allow the site templates to have access to the same blocks as the page
  it will create

Status in Mahara:
  Confirmed

Bug description:
  Once some of the default blocks are deleted from a template in
  Administration -> Configure site -> Pages, it is not possible to add
  them back in. for example 'Personal info' blocks to the Dashboard
  template.

  This is due to the site template not being treated the same as the page type it will create.
   
  To allow the block options to appear on the template edit screen we need to either adjust the relevant blocks by adjusting their 

      public static function allowed_in_view()

  function so that it also returns true for the site template page, eg
  for 'Personal info' block change

          return $view->get('owner') != null;

  to 
          return $view->get('owner') != null || (int)$view->get('template') === View::SITE_TEMPLATE;

  
  But it would be better if we created a step or function that allows the site template to mimic the rules for the type of page it is a template for

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1645840/+subscriptions


Follow ups