Jump to content

Archived

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

oksodavid

understanding templating

Recommended Posts

oksodavid

This is a loose estimation of what I think may be possible for templating, so, I'm bringing it up here to discuss and try to understand more fully, especially how this impacts bigger projects with large volumes of content...

 #1 page-xxx.php selected in wp editor, using pl_add_static_settings / pl_get_section within php template (notes: *elements should/should not be overridden in front end? *if there is front end override, on a particular page, what is the behavior for other pages using the page-xxx.php template? )

#2 page-xxx.php selected in wp editor, with a binding to a front end template, essentially slaving front end design to .php ( templates plug enabled - notes above apply? )

#3 completely front end, ignores page-xxx.php if selected in wp editor and syncs front end template ( templates plug enabled - notes above apply? )

*#3, atm, there's no binding to a front end template once it's loaded - it becomes orphaned. I've been using it as a basic layout recall facility, working on the principle all meta data is specific to the page id, and needs managing individually. Is this the intension, and does the any of above have an inference on this going forward with regard to a locked/unlocked design?

Share this post


Link to post
Share on other sites
Andrew

Was hard to follow your questions here... but here is the gist of how it works: 

  • PHP template output is always captured in the content section.  If you use static settings, etc.. those will also be added to content section on load. So nothing changes here. 
     
  • If you use 'page template scope' then PL5 will sync all pages using that same PHP template AND also in template scope. This solves a problem for sites with lots of pages. 
     
  • Recommendation for adding templates in child themes is to name them 'tpl-your-slug.php'... Prefix with 'tpl-'... as WordPress is telling us not to use the page- prefix anymore...

 

Share this post


Link to post
Share on other sites
reidwalley
6 hours ago, Andrew said:

Was hard to follow your questions here... but here is the gist of how it works: 

  • PHP template output is always captured in the content section.  If you use static settings, etc.. those will also be added to content section on load. So nothing changes here. 
     
  • If you use 'page template scope' then PL5 will sync all pages using that same PHP template AND also in template scope. This solves a problem for sites with lots of pages. 
     
  • Recommendation for adding templates in child themes is to name them 'tpl-your-slug.php'... Prefix with 'tpl-'... as WordPress is telling us not to use the page- prefix anymore...

 

Regarding using "tpl-" instead of "page-" to identify php Template files: the PageLines.com child theme (v10.0.6) home page template is currently called "page-home.php."

Should I change it to "tpl-home.php" when creating my own child theme?

Share this post


Link to post
Share on other sites
oksodavid

@Andrew ok, having no problem with building templates with static settings for some elements, such as boxes and splashup. Heroes is interesting though, as it uses post type box - an element within an element. Could you demo how to apply heroes with pl_get_section?

Share this post


Link to post
Share on other sites
Andrew

@oksodavid as in how to set defaults? 

@reidwalley yes, rename to tpl-whatever... i have only learned recently of WP's guidance on this.

Share this post


Link to post
Share on other sites
oksodavid

@Andrew yeah, I'm fine building static sections for some components but I can't figure heros, presuming $heroes_settings = array needs to actually reference post type box and include 'ibox_array'       => array( etc?

the other question I have is about overriding defaults, eg boxes defaults to icons, so, aside including 'image'  within the array, I also need to override the default to render the image. I guess what would be really useful would be a complete key for all the available components and opts.

Share this post


Link to post
Share on other sites
oksodavid

@Andrew would love to follow up on this with you

Share this post


Link to post
Share on other sites

×