Jump to content

Preferred way to retrofit existing static site


fluxus
 Share

Recommended Posts

Hey all, newbie to ProcessWire here with a few simple questions.

I am primarily a designer, but I know how to code my own design. The only time I work with PHP is when I build custom checkouts with Stripe, save orders to the database, query for valid coupon, etc.

So mostly basic stuff. Here is my current use case.

I have an existing web site that is vanilla HTML/CSS/JS  that only touches the backend on checkout/creating order. The client wants me to add four new languages on top of default english.

Since I never ever want to go through the pain that is manually doing this in all of different places I decided to use CMS for this. I already looked at ProcessWire in the past, but in the end always resorted back to either CouchCMS or PerchCMS because both allowed me to leave my HTML as it is. No theming or PHP,  just add custom tags to render/output content and that is it. Of course you can use PHP in both, but you can do a lot of powerful things with just custom tags. 

 

Back to my question. What is the best way to proceed with adding ProcessWire to my existing site. There is no blog here, no articles, etc... nothing that is generated dynamically. I just want to be able to manage all translations from one central place.

From what I read, one way is to replace all html files with php extension, add that to templates folder and create pages from those templates. Then using the language fields mark those for editing in the backend.

Your thoughts?

 

Link to comment
Share on other sites

1 hour ago, fluxus said:

allowed me to leave my HTML as it is. No theming or PHP,  just add custom tags to render/output content and that is it. Of course you can use PHP in both, but you can do a lot of powerful things with just custom tags. 

This approach would and will work in ProcessWire as well.

There is a video showing how it could be done. It's quite old but most of it is still the same today. ProcessWire and some dialogues look different now but it might be a good starting point.

Depending on the design, functionalities, dynamic data and some other things one approach might be slightly better than another but each and every will work.

It's important to know which parts of the site need to be translated, where to store those details and who will be in charge for maintaining that.

Think about footer content, navigation and small things like that... those could be tricky at first in a multilanguage scenario.

There is a great intro to multilanguage as well which can be found here: https://processwire.com/docs/multi-language-support/ and of course the support forum for all kinds of questions.

1 hour ago, fluxus said:

existing web site that is vanilla HTML/CSS/JS

My workflow is almost the same. I build the website in a static way to see all the details and later on move everything into ProcessWire. Looking back to my first projects... they were exactly like your situation here.

1 hour ago, fluxus said:

touches the backend on checkout/creating order

This part could be a tricky one as well depending on what's going on there. You might end up with some custom functions, maybe even a module but in most cases even this should be quite easy.

 

Oh... welcome to the forum and the world of ProcessWire. 

  • Like 2
Link to comment
Share on other sites

1 hour ago, wbmnfktr said:

This part could be a tricky one as well depending on what's going on there. You might end up with some custom functions, maybe even a module but in most cases even this should be quite easy.

Can you please explain why it would be tricky? There is no PHP included here directly on the page, it is just HTML checkout that talks to the PHP backend via Fetch API.

My reasoning was if I leave that as it is it should work as expected. 

Not sure if you got me right, there will be no dynamic elements here. I just want a simple and nice interface to allow me or the client to translate the existing static website into 4 new languages.

P.S. And thanks for your help, appreciate it

Link to comment
Share on other sites

3 hours ago, fluxus said:

From what I read, one way is to replace all html files with php extension, add that to templates folder and create pages from those templates. Then using the language fields mark those for editing in the backend.

I think this can actually be a good starting point overall.

First, install a ProcessWire blank profile. If you do the file rename services.html -> site/templates/services.php, later you'll have to actually create the Template in ProcessWire, which automagically maps by name to a file by default. Say, template "services", matches to file "services.php". Actually if you add "services.php" to the site/templates folder and in the processwire interface try to create a new template, ProcessWire will suggest to create templates according to the existing files. 

After you do do this, you can go and recreate the pages in the page tree (assigning the right templates, to the right pages) you could end up with a "static" copy of your website.

After this, you can think of adding the fields to the templates! This part involves a bit more, like installing the language modules, setting up the language fields, etc. But I could save that for later. 

  • Like 1
Link to comment
Share on other sites

28 minutes ago, fluxus said:

Can you please explain why it would be tricky?

Tricky means in this case: I don't know anything about your actual PHP and there might minor things to fix. For example: if you enable caching later on and depending on what kind of caching (for example ProCache)... your PHP might never get called as ProCache bypasses PHP after a cache file was created.

30 minutes ago, fluxus said:

there will be no dynamic elements here

So... a really static website? Ok. Fine... ProcessWire will be perfect even for this. Maybe even way better than PerchCMS and others as you always can add up functionality with ease - even super dynamic stuff.

32 minutes ago, fluxus said:

nice interface to allow me or the client to translate the existing static website into 4 new languages

This will be super easy!

 

The way @elabx describes it, it should work pretty well. 

 

33 minutes ago, fluxus said:

And thanks for your help, appreciate it

My pleasure.

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