NEEDS TO BE EDITED
Contents |
The Platform framework has several ways for you to extend the framework easily. Two of the most important ways are with the PageLines sections and template API.
This API currently allows you to do three very important tasks in your child theme.
Child Sections – Create your own drag and drop sections – PHP, JS, CSS, Images, etc.. Drag/Drop Templates – Create your own page templates that work with drag and drop. Section Template Overwrite - Overwrite core sections, e.g. the branding section, with template files in your child theme
Adding custom sections is one of the coolest things you can do with Platform. This allows you to extend the framework in a limitless way.
In a custom section you can create your own drag and drop template that includes everything you need:
Persistent PHP Header code like Javascript Options and Meta Options The actual HTML template CSS and image files
Adding Custom Sections
Adding a custom section takes only three steps:
1. Add The File – Add a file to the child ‘sections’ folder, with the naming convention: section.[your section id].php.
2. Add The Section Class – Duplicate the code from a demo section and rename key elements, like the ‘class name’, ‘name’, and id. Reference the code to learn how the API works.
3. Register The Section - Add a pagelines_register_section function with the information it needs to your functions.php (see inline documentation for function args)
To get started, just look at the demo sections provided in the child theme. The Base child theme has a custom section called section.pullquote.php.
This is meant to show you how to create a custom section. In the video below the sample pullquote section is copied and used to create a second navigation section.
Adding new templates for adding sections to is really easy as of PlatformPro 1.3.
It requires three steps:
Add File called page.[page-id].php to Base Add this code to that file (see page.base.php): /* Template Name: Your Page Name */ setup_pagelines_template(); Add ‘pagelines_add_page(‘[page-id]‘, ‘[Page Name]‘);’ to the child functions.php file
Adding new templates for adding sections to is really easy as of PlatformPro 1.3.
To override a section template, for example, the ‘sharebar’ section, just add a file called ‘template.branding.php’ to the child theme. This will become the new template for that section.
Then just grab the template code from that section and paste it in your overriding file.
Now you can edit that code to your heart’s content, without fear of it being overwritten by updates.