how to create a custom page template, using custom field values
#1
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
...
20
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
...
35
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
else
CUSTOM SECTION BRANDED TOUR code
or something like that.
Anything at all, please provide a solution.
Thank you very much.
#2
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!
#3
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?
Thank you.
#4
Posted 04 October 2012 - 01:02 AM
It seems pagelines_template_area is the PL version of get_template_part. Am I mistaken?
#5
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
#6
Posted 04 October 2012 - 03:07 AM
#7
Posted 04 October 2012 - 03:11 AM
is there a way to conditionally call a section / templatepart?
for example:
-create section1
-create section2
-create pagetemplateX
-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:
-section1
-section2
-section3 = if this, section1; else, section2.
I hope my q makes sense.
Thanks.
#8
Posted 04 October 2012 - 12:05 PM
#9
Posted 04 October 2012 - 12:07 PM
#10
Posted 04 October 2012 - 12:17 PM
Usage:
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:
branded:
unbranded:
(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.
Thanks, Simon.
#11
Posted 04 October 2012 - 12:19 PM
Thanks.
#12
Posted 04 October 2012 - 12:22 PM
#13
Posted 04 October 2012 - 12:26 PM
#14
Posted 04 October 2012 - 12:26 PM
or am I missing something?
#15
Posted 04 October 2012 - 12:28 PM
#16
Posted 04 October 2012 - 12:41 PM
how do i assign all of a specified CPT to a single page template?
#17
Posted 04 October 2012 - 12:45 PM
#18
Posted 04 October 2012 - 01:16 PM
So how do I filter the main options?
#19
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
#20
Posted 05 October 2012 - 05:47 PM
Add to customize plugin, and change the page number.
Also tagged with one or more of these keywords: Resolved
Resolved
PageLines Framework →
Technical Support →
Anything Boxes And Polylang Language Filtering ProblemStarted by janpeeters , 01 Dec 2012 |
|
|
||
Header In Banner AlignmentStarted by bankrollbuilder , 28 Nov 2012 |
|
|
||
Resolved
PageLines Framework →
Customizations →
2 Hero UnitsStarted by starlit , 28 Nov 2012 |
|
|
||
Tabs Do Not Align HorizontallyStarted by hutruk , 28 Nov 2012 |
|
|
||
Resolved
PageLines Framework →
Customizations →
Reduce Margin In Contact FormStarted by texasx , 27 Nov 2012 |
|
|











