• 0

Extending core sections (DMS)


Question

Posted · Report post

Hi,
 
trying out DMS I have creted some child sections in a child theme, extending core sections like Postloop or Widgetizer.
 
An hour ago I updated DMS to 1.0.3 and after that I got a PHP Fatal Error. What was happening is that DMS was trying to load child (ok, now they are called 'custom') sections before parent sections, so the parent class wasn't found.
 
I solved that adding this line to the header of the section.php file of every class I have extended:

Depends: NameOfParentClass

 
For example, if you want to create a SecondaryBar section your code should look like that:
 

<?php
/*
    Section: Secondary Sidebar
    Author: Pagelines
    Author URI: http://www.pagelines.com
    Description: The secondary widgetized sidebar (extends the Primary one)
    Class Name: SecondarySidebar
    Workswith: sidebar1, sidebar2, sidebar_wrap
    Persistant: true
    Filter: widgetized
    Loading: active
    Depends: PrimarySidebar
*/


class SecondarySidebar extends PrimarySidebar {


}

I hope it would be useful for someone ;-)

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0

Posted · Report post

Thanks for sharing that info!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I forgot one thing: after adding the dependencies, Section Caché must be reloaded. But if you're getting a Fatal Error it would be impossible to reach the Admin Panel.

 

So the easiest fix for that is:

  1. rename your child theme, that will force wordpress to deactivate it
  2. once the Admin Panel is back, activate your theme, that will force DMS to reload your sections

Regards,

Jordi

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thank you again Jordi!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now