Jump to content

Confused about head.inc and foot.inc


ioio
 Share

Recommended Posts

Hello everyone,

I am using processwire for the first time. 

I am confused about whether replacing head.inc and foot.inc in the /site/templates with my own head.inc and foot.inc.

I created these files by copying the code that is repeating throughout the site both at the beginning of the pages and the end of them.

I guess the admin part of the site is using head.inc and foot.inc too but I am not sure.

I am afraid to replace those files and screw up things in the admin part of the site. Those pages certainly don't need the navigation or the social links that are contained in my files.

Do I rename my files or do I place them somewhere else? 

Link to comment
Share on other sites

Hi ioio and welcome to the forums.

You can edit anything under the site/templates folder without affecting the admin side of PW.

Let us know how it works out with the head and foot files and if you have any more specific questions.

Also, not that you don't even need to follow the structure of having a head and foot file. Many users prefer a main.inc file which contains the entire site structure and echos the content variables where appropriate and is included at the end of each template file. There are other possible approaches as well - really it just comes down to what works best for you and how you like to work and mentally visualize things.

  • Like 2
Link to comment
Share on other sites

Hi ioio, welcome to the forum!

You can replace them without any problem. Actually, you can replace everything in the templates folder by your own files without any problem with the exception of admin.php. Just be aware that ProcessWire will look on that folder for the php files that correspond to the names of your page templates. You can also replace the scripts and style pages and organize your includes inside your own folder structure, as long as you call them with the correct path on the include() function.

Edit: Adrian was faster because Canada is closer to the PW server than Portugal ;)

Edit: On the other hand, Portugal is closer than France and Switzerland :P

  • Like 2
Link to comment
Share on other sites

Hello ioio,

Welcome to the ProcessWire community!

Don't be afraid of messing the admin part of ProcessWire as long as you touch templates in the site/templates/ directory of your installation. You can indeed use the same names head.inc and foot.inc even though you change all their content. The Admin part is left clean because it  resides in the wire/ directory and you don't want to touch this one ;-)

Actually, this is my first answer to someone's question! No doubt another member of the community will provide you with useful recommendations.

Hope I helped !

EDIT : Woa... You guys are so fast...

Edited by celfred
  • Like 1
Link to comment
Share on other sites

Hello everyone  :)

Thank you for your replies.

Ok....so I will replace them and see what happens  O0

I saved the original files just in case  :P



I think I will try the main.inc approach after I become more familiar with both processwire & php.

I am at the beginning of the beginning  :-[

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...