Jump to content

About Standard Theme Processwire: where is html file?


Recommended Posts

Hi, I know the the templates in processwire are html files.
I search it into foleder "site" of standard installation of processwire standard theme (blanck and that blue) but I don't find any html file to modify it by html code.
So, I must modify it only by php code?
Can I traduct php pages templates in html page?

Link to comment
Share on other sites

Quote

I know the the templates in processwire are html files.

They are not, the templates are PHP files.

Quote

I search it into foleder "site" of standard installation of processwire standard theme

You need to look in /site/templates/

Quote

must modify it only by php code?

Yes

But if you use the wireRender pattern, then you can create pure html views, still .php files, but those can be placed into a $content variable for delayed output.

Link to comment
Share on other sites

Hello @franciccio-ITALIANO,

you could start by renaming the HTML files inside your templates folder from .html to .php and add them as templates. But those template files would be still static HTML. So you would have to define some fields for your dynamic content and add them to your templates. Next step would be to output those fields with PHP between the HTML. But this has been already explained more better here:

http://processwire.com/docs/tutorials/how-to-structure-your-template-files/
https://www.smashingmagazine.com/2016/07/the-aesthetic-of-non-opinionated-content-management-a-beginners-guide-to-processwire/ (Must read)

Regards, Andreas

  • Like 3
Link to comment
Share on other sites

6 hours ago, franciccio-ITALIANO said:

Must I traduct html files in php code by... what? Exist a program or application that do this work?

I would just say, it's no small thing – adapting a CSS theme to be used in processwire requires a decent knowledge of how to use the API, as well as some fairly good experience with HTML and PHP.

I can get a basic HTML 'theme' into a simple PW site in around 3-5 hrs, depending on the complexity, and that is using a lot of helper modules and functions that I developed over the years. It depends on the content of the site, how many templates you have and the types of fields you are using. For a 1 page site, it should be pretty simple, you just need to replace the contents of the _main.php file with the content of the html file and then update all of the paths to the assets, using for example a call to the $config variable for the templates folder (e.g. $config->urls->templates . "styles/my-style.css";)

  • Like 2
Link to comment
Share on other sites

Many of us have used "classical" systems with "system rules" to make websites before using Processwire. Processwire is a decoupled system without any rules. So with Processwire you handle html by: 1. writing your own html code in your processwire template files, 2. including inc files that hold your html code using php include, 3. generating dynamic html code with the processwire api combined with php, 4. etc. etc. etc. So if you see a nice free html template somewhere on the internet that you want to use to make a website, you would have to strip its html code and bring it inside processwire.

  • Like 2
Link to comment
Share on other sites

9 hours ago, Macrura said:

-...and then update all of the paths to the assets, using for example a call to the $config variable for the templates folder (e.g. $config->urls->templates . "styles/my-style.css";)

 

Thank to all!

But I don't understand this up.

The .php templates files have to put in "site -> templates". Ok.

The css. file in  "site -> templates -> styles". Right?

The images of the templates in "site -> templates -> styles -> images". Well.

So, WHAT must I put in  "site -> assets"
Must I don't touch it?

Then, in packets that I download by  http://www.free-css.com/, we find .js files and .scss file.

Now, in processwire into which folder must we put it?

Macrura, I don't undierstand where and why I must write php code that you suggest me!

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Once you are in the site->template folder you can structure your files/directories as you like, as long as you link them correctly inside your template folders.

And yes, leave site->assets alone ;)

You can contact me on skype (my nick is : The3fingers), I'm italian too.

  • Like 2
Link to comment
Share on other sites

3 hours ago, franciccio-ITALIANO said:

Macrura, I don't undierstand where and why I must write php code that you suggest me!

you would be writing php code to communicate with the PW api, to get your dynamic content from the CMS.

In reference to the $config->urls->templates, you can take a look at the default _main.php to see how that is being used to reference the themes folder, when you reference an asset (css or js file) that is stored within your templates folder.

  • Like 1
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

×
×
  • Create New...