Jump to content

Archived

This topic is now archived and is closed to further replies.

jordi

Extending core sections (DMS)

Recommended Posts

jordi

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 ;-)


Jordi López Garrostas
programador web

Share this post


Link to post
Share on other sites
Rob

Thanks for sharing that info!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
jordi

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


Jordi López Garrostas
programador web

Share this post


Link to post
Share on other sites
Rob

Thank you again Jordi!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

  • Similar Content

    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a few weeks ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • tuciudadenred
      By tuciudadenred+
      Hi everyone, what happens is that the web page metrosalarmas.com has a google tags which I have not attacked where I can look to remove those tags and be able to locate the correct ones.
    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a week ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • cstudio
      By cstudio
      Hello,
      I need some help!  I am trying to add a Square booking script.  When I add it to a embed section it crashes the page editor and I am unable to save the page version.  I have tried using different browsers with the same result.
       I can add the script on the backend in the word press content area and get it to show and work, but it look terrible.  A page with in a page.  http://www.zoeanastacia.com/booking/.
      I need help getting the page editor to work properly or to make the wp content section to not look like an 90's iframe.
      Thanks
    • JawDesigns
      By JawDesigns
      Hi everyone,
      Flywheel have reported errors on my clients site 'www.racewaredirect.co.uk' and it's not loading. Can someone please provide some information on how to fix this? The site has never experienced these issues before.
      Thanks,
      James Wilson
×