Jump to content

Processwire with existing html/css site


NooseLadder
 Share

Recommended Posts

Hi, I'm new here. i just found out about Processwire today and am very interested in finding out more.

I can see how you build a site from scratch. I have a few questions:

1. Can Processwire be used to allow the client (end customer) to edit/update certain pages only without having the whole site inside Processwire. In other words:

If I have an existing site in html/css. Can Processwire be added to the server so that for example only a page on the html site (say a photo gallery page) can be managed through it. Or does the whole site need to be created in Processwire.

2. What is the process for moving an exisiting html/css site into Processwire?

I look forward to your replies.

Link to comment
Share on other sites

2. What is the process for moving an exisiting html/css site into Processwire?

Like with most CMS, you would convert your HTML into a PW template, basically replacing anything which will be generated dynamically by PW with PHP tags/PW API calls. There's a standard template in /site-default/templates/ of the PW download archive which you can use as a boilerplate. Have a look at the .php/.inc files in there. Basically, you need to reproduce your site's HTML structure there, replacing the parts which will later come from PWs database with the appropriate PHP tags/API calls. You can also replace references to the standard template's CSS and JS files with references to your own CSS/JS, or you can just leave the CSS/JS references and replace the content of those files with your own CSS/JS.

As it is most of the time with PW, it's entirely up to you. (And that's great about PW, at least in my book.)

Now, what's generated dynamically? Well, that really depends on what you want PW to do. Typically, all page content and the navigation are generated dynamically. You'll find examples for generating a navigation in the standard template, but there's also soma's excellent MarkupSimpleNavigation module. The standard template also has templates for a search function and a sitemap – you might or might not need those in your site.

Hope that clears that part up a little. :)

  • Like 1
Link to comment
Share on other sites

If I have an existing site in html/css. Can Processwire be added to the server so that for example only a page on the html site (say a photo gallery page) can be managed through it. Or does the whole site need to be created in Processwire.

You can have as much or as little of your site in ProcessWire as you want. ProcessWire will run alongside static HTML sites or sites running in other applications.

As for access control, you can define access per-template. So if you want the client only updating the photo gallery page, you would only give them access to edit/create pages using your photo-gallery template.

Link to comment
Share on other sites

I think that the basic profile that is included with ProcessWire is probably the best example. Install that, and then copy a few of your other HTML files into the same root directory you've installed ProcessWire in. Those HTML files will still be accessible when accessed in the URL. So if you are putting part of your site in PW and the other part not, then it's just a matter of linking the two (by way of <a href=...>, etc.)

  • Like 1
Link to comment
Share on other sites

I just wanted to say that you can easily put static html files inside PW with all the advantages: nice urls, making them appear on dynamic navigation and searches, or being able to make them dynamic quickly, to name only few.

For this, you just have to put them on the templates folder and change the .html extension to .php. Then, go to templates in PW and create a new template for each one, and associate them to these files. Then, create the pages on the tree and choose the correspondent template. That's it!

There are also advantages on keeping them as static files of course, being speed the most obvious.

  • Like 1
Link to comment
Share on other sites

Ok. You have to be patient with me.

1. I copy the existing html files into the site/templates folder. OK.

2. I create a new template for each one. OK.

3. And associate them to these files. This is where I'm stuck. Do I have to manually put in the links to images, CSS files into each template file. Not sure what you mean here.

Link to comment
Share on other sites

1. I copy the existing html files into the site/templates folder. OK.

Don't forget to change the file extension to .php

2. I create a new template for each one. OK.

If you changed them to php, they will appear on "templates found" when creating a new template.

3. And associate them to these files. This is where I'm stuck. Do I have to manually put in the links to images, CSS files into each template file. Not sure what you mean here.

The files I was talking about were the old html files, now turned in php files in step one. For the css files and images, you can keep the exact same structure you had. Just move the folders where they were to the templates folder also, so the relations are the same (this will work only if the paths are relative of course).

Link to comment
Share on other sites

  • 3 weeks later...

I've got a site ready to put into PW. All the pages are .php. I have installed PW on localhost. Path is localhost>newsitename>processwire.

I've got the basic template and pages structure. I have deleted basic page. There's the current Home page that comes with the template. I have put the newsite pages in the processwire>site>templates directory and created each one as a template.

Now I'm a bit confused on how to integrate the new pages into the existing template.

Do I put them as children under the existing Home page? I'm only really interested at this stage to use PW for access control for my end user to a few pages. I though it would be easier to put all the sites pages into the template and only give the user access to the ones they want to update. I will be having a gallery and a latest news page and maybe one other.

My imported site has already been split into separate .php files (header, footer, sidebar etc) and I have those in the templates directory as well as the main content pages.

I want my new index.php to be the home page. But i need some guidance on how to integrate into the template.

Current pages in pw Admin>Pages:

Home

Site Map

Search

404 Page Not Found

Admin

Trash

Thanks.

Link to comment
Share on other sites

I'm not sure I follow 100%, but it sounds to me like the next step you need to take is add the templates in ProcessWire. If your files are already ready-to-go in your /site/templates/ directory, then you can go to Setup > Templates > Add New Template. Check the box next to all the ones you want to add (of course, leave out your header/footer includes since those are partials rather than actual templates).

Then create your new pages using those templates you've added as appropriate. How you structure them is up-to-you. ProcessWire gives you a tree structure which you can push in any direction you want to. Think of your pages as a family tree and decide what should be "children" of another.

With regard to access control, you can configure this on a per-template basis. You can also leave it off, which will make each page using a given template inherit access control settings from the nearest ancestor page that has a template defining access (often the homepage).

Link to comment
Share on other sites

Hi Ryan, Thanks for the reply. I have added the templates for each of my new pages. The existing pages tree as supplied in the basic template is:

Home

Site Map

Search

404 Page Not Found

Admin

If I add my index.php page to the tree it will be a child under the existing Home page. Is that what needs to happen? I somehow felt that my index (home) page should be the parent, this is where I am confused. So should my tree look like this:

Home

Index

About Us

Contact Us

Gallery

Admin

Other page1

Other page 2

etc

The existing Home page has the fields that came with the template. So I will need to delete them.

OR would it be easier in this case to start with a blank canvas? I tried deleting Home page but it wouldn't let me due to it controlling Access rights. I'm probably overcomplicating this for myself and I feel like a total dunce. I hope you can clarify.

Link to comment
Share on other sites

Every site needs a 'root' page (homepage) but it doesn't matter what you do with it. I think all you need to do is just copy whatever is in your index.php file and paste it into the home.php file. And then get rid of your index.php file, because it will be home.php instead. Of course, you can also add/delete fields from the home template as needed.

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