Jump to content
Sign in to follow this  
kiacat

How to make a new page template in Platformbase

Recommended Posts

kiacat

The following steps for creating a new (custom) page template page have been compiled from Pagelines document files, Blog posts, and text within the functions.php folder of Platformbase. Could you check this and tell me if I have the correct wording and syntax. STEP 1 Inside the Platformbase folder, create a new file using notepad or some other text writing program and name it page.[page-id].php. In my case, I would replace the [page-id] with the name of my template such as trails, events, projects, or nonprofits. For this example I will call my file page.trails.php. STEP 2 Inside the page.trails.php text document I add the following code: /* Template Name: Your Page Name */ setup_pagelines_template(); In the case of my example, I would write it like this /*Template Name: trails*/ setup_pagelines_template(); Question: How is ???Your Page Name??? used? Is this a name I will see in the WordPress parent/child dropdown list? Does this text need to be the same as what was used in the file name (eg; do I need to write ???trails??? to match ???trails??? in ???page.trails.php??? or could I have written something different like ???equestrian trails???, ???hiking trails???, or ???mountain bike trails???)? STEP 3 Use notepad or some other text writing program to open the functions.php file inside the Platformbase folder and add the following: ???pagelines_add_page(???[page-id]???, ???[Page Name]???);??™ In the case of my example, I would write it like this: ???pagelines_add_page(???trails???, ???trails???);??™ Question: If the template folder is page.trails.php and I had named the template ???Equestrian Trails??? would the following be correct? ???pagelines_add_page(???[trails]???, ???[Equestrian Trails]???);??™ Question: The instructions say to put this in the functions.php folder but it wasn??™t clear if it was important where it was put in relation to other files.

Share this post


Link to post
Share on other sites
cmunns
How is ???Your Page Name??? used?
This is just what is used in the dropdown when you have to choose the page template for a page.
If the template folder is page.trails.php and I had named the template ???Equestrian Trails??? would the following be correct?
Yes, but don't use the square brackets in your final code
The instructions say to put this in the functions.php folder but it wasn??™t clear if it was important where it was put in relation to other files.
Add it somewhere in the middle where all the commented code is...probably right after it says add custom functions here or something liek that.

Share this post


Link to post
Share on other sites
kiacat

Thanks for your quick reply. Sounds like it isn't necessarily important where I put ???pagelines_add_page(???trails???, ???trails???);??™ in the functions.php document.

Share this post


Link to post
Share on other sites
timlinson

Not too important, aside from basic syntax.. i.e. within php tagged area, not inside some other function, etc.

Share this post


Link to post
Share on other sites
kiacat

Found out that I had too many quotation marks in the sample above: INCORRECT ???pagelines_add_page(???trails???, ???Trails???);??™ CORRECT pagelines_add_page(???trails???, ???Equestrian Trails???); For other searchers: I added this to the functions file in pagelinebase with an escaped note for my own reference (//Add Trails Page). I included the lines immediately above to provide a point of reference. After this is done, the template will show up in WordPress template drop-down list. // Add Base Page if ( function_exists( 'pagelines_add_page' ) ) pagelines_add_page('base', 'Custom Page'); // Add Trails Page pagelines_add_page('trails', 'Trails'); Thanks to both Adam and Tim for helping me resolve this.

Share this post


Link to post
Share on other sites
menacek04

So I have been trying to get this to work for me and have been unsuccessful. I guess maybe I do not totally understand this, but I thought that this was adding an additional page template that would work with the PlatformPro Template Setup drag and drop functionality in the settings page. Is this not the case? I have done the above and I can see my template listed in the page template drop down when editing a page. But I can NOT see it available as a page in the PlatformPro Template Setup so that I can use the drag and drop functions. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
bonngean

@menacek04, You should start your own post, asking the same question since this topic has already been resolved for the person who asked the original question. By starting your own thread, your question will get bumped to the top of the forum allowing others to help you. --Bonnie Gean

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

Sign in to follow this  

×