Jump to content


Photo

Structure of template files


  • Please log in to reply
2 replies to this topic

#1 Robert Zelník

Robert Zelník

    Full Member

  • Members
  • PipPipPip
  • 69 posts
  • 5

Posted 05 March 2012 - 09:19 AM

Currently the template files are basically divided in three parts:
  • head.inc
  • the current content template
  • foot.inc
Are there any reasons to do it that way?

I would like to suggest a well-established way of templating, where the whole page layout is in one file (head and foot together) and this layout template can include sub-templates for particular blocks of content, including the current content template. This way would better support an appropriate level of granularity: easier layouts/templates could be included in one or two files and more complex layouts/templates could be splitted to as many parts as needed. What do you think?

#2 diogo

diogo

    Hero Member

  • Moderators
  • 2,006 posts
  • 1081

  • LocationPorto, Portugal

Posted 05 March 2012 - 09:47 AM

You're completely free to do it the way you want. Check this post where people discuss other ways of organizing templates and where Ryan explains why this is the chosen form for the default install http://processwire.c...__fromsearch__1

#3 Robert Zelník

Robert Zelník

    Full Member

  • Members
  • PipPipPip
  • 69 posts
  • 5

Posted 05 March 2012 - 10:14 AM

Thanks Diogo, that's what I was looking for. I didn't know about that topic. I like the suggested solutions.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users