Jump to content

Recommended Posts

Posted

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 ...

ClipBoard-1.jpg

Posted

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. 

  • Like 1
Posted

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.

  • 2 weeks later...
Posted

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).

 

 

 

 

 

 

Posted
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
  • Recently Browsing   0 members

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