pwired Posted November 10, 2021 Share Posted November 10, 2021 The concept "everything is a page" just keeps on challenging. So why not create "a page" for the website header and footer. Give them fields, and who knows how cool this can work out ... Link to comment Share on other sites More sharing options...
MarkE Posted November 10, 2021 Share Posted November 10, 2021 I tend to have multiple items (pages) in my footers so there is more than one ‘footer’ page. The code is then included in _main.php. I guess they could be grouped into one page, but not sure of the merits of that. 1 Link to comment Share on other sites More sharing options...
pwired Posted November 10, 2021 Author Share Posted November 10, 2021 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 More sharing options...
pwired Posted November 19, 2021 Author Share Posted November 19, 2021 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: https://processwire.com/talk/topic/2210-help-getting-a-custom-styles-php-file-working/?do=findComment&comment=20641 Quote 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 ? Extra: 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 More sharing options...
wbmnfktr Posted November 19, 2021 Share Posted November 19, 2021 Has anyone ever tried this css.php-approach in combination with ProCache? Link to comment Share on other sites More sharing options...
DV-JF Posted November 19, 2021 Share Posted November 19, 2021 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts