how to create a custom page template, using custom field values
Posted 01 October 2012 - 05:40 PM
if URL has "?v=unbranded" in it, display custom fields 1-20...
get meta field 1
(link url = get meta field 2) get meta field 3 (close link tag)
get meta field 4
if URL doesn't have "?v=unbranded" in the browser address bar, display custom fields 21-35
get meta field 21
(link url = get meta field 22) get meta field 23 (close link tag)
get meta field 24
How can I create a page template for PageLines like this, even if it has to be:
if ?v=unbranded, display
CUSTOM SECTION UNBRANDED TOUR code
CUSTOM SECTION BRANDED TOUR code
or something like that.
Anything at all, please provide a solution.
Thank you very much.
Posted 01 October 2012 - 06:59 PM
Creating another page template is as easy as adding this code to a new php file and placing it in the root of the child theme:
The only caveat being that the file name needs to follow this naming scheme: page.somename.php. I'd recommend not using any dashes or underscores in the "somename" portion of it, as it's given me trouble before.
From there, the template will be available to customize within the drag & drop area of the framework.
Regarding the part about conditionally integrating your content with meta data, the easiest thing to do would be to create a custom section to handle this.
A section can be very simple and has very few requirements. You can strip it down to almost nothing and just use the section_template method to write your whole template for that content if you wanted. The benefit of a section is that it also provides other methods for conditionally enqueuing scripts and other stuff just when the section is active on that page. Again, check out the sample PullQuote section in the Developer Tookit found .
Hope that helps!
Posted 03 October 2012 - 07:32 PM
A "regular" WP theme would just have header.php, single.php, and footer.php --> and also header-whatever.php, single-whatever.php, and footer-whatever.php.
How do I do this with PageLines?
Posted 04 October 2012 - 01:02 AM
It seems pagelines_template_area is the PL version of get_template_part. Am I mistaken?
Posted 04 October 2012 - 01:16 AM
You can do this with Sections and apply sections to specific parts of your site. Admittedly, it's not the easiest thing to do. See
Posted 04 October 2012 - 03:07 AM
Posted 04 October 2012 - 03:11 AM
is there a way to conditionally call a section / templatepart?
-within pagetemplateX say "if this, then section1; else, section 2"
I think not because the page.name.php file is just for protocol, not including custom functionality.
So maybe this:
-section3 = if this, section1; else, section2.
I hope my q makes sense.
Posted 04 October 2012 - 12:05 PM
Posted 04 October 2012 - 12:07 PM
Posted 04 October 2012 - 12:17 PM
For a custom post type, I'm displaying real estate tours and I have a _GET that says if url variable has ?v=unbranded then display this "view" else display the branded "view" (due to real estate MLS systems requiring unbranded versions and I don't want to have to create 2 pages/templates for the same information (e.g. the address and MLS number and photos don't change). The "views" I mentioned are essentially 2 page templates within 1 (not a PL theme, trying to convert to it).
For the branded version, I have social sharing links, facebook og integration, and a navigation.
For the unbranded version, social sharing links, navigation, etc. aren't allowed.
Here's an example of my current theme's display of each:
(FYI: currently that's just a single page, not a CPT page)
It's all custom fields and it's not totally done, but hopefully that gives you the understanding of what I want.
I've been messing around with a custom section this morning and I suppose I could do all that conditional stuff within it and just drag it to the "real estate tour" custom page template but that still doesn't get my < head > stuff -- except maybe I can remove_action or do some other stuff in a custom section to remove my Crackbar and Branding -- dunno -- want some guidance though.
Posted 04 October 2012 - 12:19 PM
Posted 04 October 2012 - 12:22 PM
Posted 04 October 2012 - 12:26 PM
or am I missing something?
Posted 04 October 2012 - 12:28 PM
Posted 04 October 2012 - 12:41 PM
how do i assign all of a specified CPT to a single page template?
Posted 04 October 2012 - 12:45 PM
Posted 04 October 2012 - 01:16 PM
So how do I filter the main options?
Posted 04 October 2012 - 03:46 PM
How do I do this? Thanks.
Oh right yea, well in that case you can actually filter the main options, and turn off the navbar on that page