Jump to content

Archived

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

rsmm

How to include multiple sections into one plugin

Recommended Posts

rsmm
I've figured out how to turn a single section into a plugin by looking at the code for the PL Next Box. And this loads into DMS with no problems. 
 

 

Here's an example of the header

/*
  Plugin Name: SMS Spacer
  PageLines: true
  Version: 1.0.0
  Section: true
  Class Name: SMS_Spacer
  Filter: component
  Loading: active
*/

class SMS_Spacer extends PageLinesSection {
  //do section stuff
}

However, I have yet to figure out how to load in a pack of sections from one plugin. Is this possible?

 

Am I posting this message in the most applicable forum category?

 

Share this post


Link to post
Share on other sites
James Giroux

Hey There,

 

A lot of people use a section wrapper to create the effect you're going for.  If you look at many of the third party sections that are out there you can see how it's done.  We also have a starter section that you can use for reference.

 

https://github.com/pagelines/pl-starter-section

 

The way it works is that the first level is the 'plugin' which tells WordPress to look in the sections folder.  In that sections folder you can put multiple sections, at least I believe you can. I personally haven't tested it out in a while.  

 

The reason for that is because when you're creating extensions for WordPress, the best practice is to separate functionality into multiple plugins/sections. This way users can choose which functionality they want enabled and which they don't.

 

Hope that helps!

 

James.


James Giroux, CEO
Groundwork

Share this post


Link to post
Share on other sites
rsmm

Great. I'll give this a try.

Share this post


Link to post
Share on other sites

  • Similar Content

    • elementalkites
      By elementalkites+
      Good evening. I am attempting to use the Impulse section on a page I am working on (https://dev.elementalkites.com). The tool seems to have the ability to overlay a logo on top of the slider images but in my case it isn't working, even though I have added the logo file and given it a height to display at. I have attached a screenshot for reference. Any help would be appreciated.
       
       
    • 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
×