Jump to content


Photo
- - - - -

How to structure a custom template


  • Please log in to reply
5 replies to this topic

#1 kneops

kneops

    Advanced Member

  • Members
  • 95 posts
  • LocationNetherlands
  • Framework Version:2.4.1
  • Country: Country Flag

Posted 09 May 2013 - 10:20 AM

I've read the docs about adding a custom template, like page.homepage.php but I still have no idea how to add content to that template. I've looked inside the folders of the pagelines directory to find a example of the structure used by PL for building a single post template or a category template. Where are they?

 

For the rest I asume that whatever I place underneath setup_pagelines_template(); will be the part between the head and footer?

 



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 15907 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 09 May 2013 - 10:26 AM

Hi,

 

It is not possible to build a Post template or a Category template, as these pages are considered special by Wordpress. The custom page template is for creating a custom page template that can be used in PageLines > Drag and Drop, where you also have Template | Default, Template | 1, Template | 2,  Template | 3 etc...

 

To add content to your template such as sections etc... go to PageLines > Drag and Drop and select your custom template, which if created correctly, should now appear in the templates list.

 

Then you go to Wordpress > Pages, add/edit a page and then in the template drop down menu on the right hand side, select your template.



#3 kneops

kneops

    Advanced Member

  • Members
  • 95 posts
  • LocationNetherlands
  • Framework Version:2.4.1
  • Country: Country Flag

Posted 09 May 2013 - 10:36 AM

So adding a custom template is nothing more than adding numerous extra templates to be able to construct using the drag and drop section?

I thought is was an option to build a template completely by hand if that was needed.



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 15907 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 09 May 2013 - 10:56 AM

Why would you want to create a page template by hand ?

 

If however, you're referring to adding your own content then the best course of action would be to build your own sections.



#5 kneops

kneops

    Advanced Member

  • Members
  • 95 posts
  • LocationNetherlands
  • Framework Version:2.4.1
  • Country: Country Flag

Posted 09 May 2013 - 11:02 AM

Until now I've been building my WP sites 'by hand', so perhaps I'm still too much used to that ;) I will read a bit more about sections and hooks.

Anyway, what I said, was that correct?: 'So adding a custom template is nothing more than adding numerous extra templates to be able to construct using the drag and drop section?'



#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 15907 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 09 May 2013 - 11:12 AM

Yes, if you create a custom page template, it is basically another template which you can use in drag and drop.