Jump to content

Everything a page => go for it


Recommended Posts

Hi MarkE,
Thanks for pointing to an example use of this.
Yes, with some easy business logic on the template file we can make the _main.php
choose what footer type/content to show in what case or on what front website page.

I am also playing with taking the header lines out of the usual _inc file
and move them into "a header page" fields and see how that goes.

Link to comment
Share on other sites

  • 2 weeks later...

Another very good example of how to handle parts of a website efficiently in processwire "as a page"

I was building a website from scratch lately and was fiddling my css around to look for a way to get it better organized.
And then came across this post from Diogo again:



1. Create a template file css.php and put all your css code inside. On the top of the file put this code <?php header("Content-type: text/css"); ?>.

2. Create a "css" PW template with that file.

3. Create a "css" page and give it the "css" template.

4. Link to the stylesheet like this <link rel="stylesheet" href="<?php echo $pages->get('/css/')->url; ?>">.

5. use the PW API on your stylesheet 🙂


6. put some fields on the "css" template and use them on your css

Examples: the color picker field for colors; an image field with your style pictures (background, logo, etc).







Link to comment
Share on other sites

1 hour ago, wbmnfktr said:

Has anyone ever tried this css.php-approach in combination with ProCache?

I'd tried, but it doesn't work out for me. Don't remember where the exact problem was. In the end I decided to not compress or cache the template, which is responsible for the output of the css file. 

  • Like 1
Link to comment
Share on other sites


  • Recently Browsing   0 members

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