Jump to content

How to convert a codeigniter website to a PW website?


GradDev
 Share

Recommended Posts

Hello,

My client has come to me with a website that has been developed in CodeIgniter by someone else and wants me take over it for some design changes.

The website is basically a directory listing of various of books, movies, events etc. related to a specific topic. So this is heavily database driven.

I know basic PHP, and have been using ProcessWire for a while now (though not yet an expert at the APIs). I have no knowledge of how CodeIgniter works.

What I will be needed to do is to change the design of some elements a bit, and add a couple of fields of information in the database.

My questions are-

How do I convert this website into a PW website?

How long will it take just for the conversion?

Do I need to learn CodeIgniter for it?

Link to comment
Share on other sites

26 minutes ago, GradDev said:

How do I convert this website into a PW website?

Carefully and well planed.

Parts of it could be migrated via API I guess and some parts need to changed manually. It all depends on several details we don't know, yet.

26 minutes ago, GradDev said:

How long will it take just for the conversion?

Based on the details you provided... somewhere between a few days and a year. Plus the design part.

How much books, movies, events, etc. need to be migrated? 
How many templates are needed?
How ... ?
What ... ?
Who ... ?

Hard to say actually. We don't know anything about the site, the data, the functionality. 

26 minutes ago, GradDev said:

Do I need to learn CodeIgniter for it?

You should at least understand whats happening in the code itself. As you you didn't mention any eCommerce stuff or bookmarking or recommendation features there seems to be not that much of functionality in the code and therefore I guess it will be only be common template logic and maybe some data management. The hardest part will possibly be the content and data migration. As soon as those are in ProcessWire it should be a piece of cake.

  • Like 2
Link to comment
Share on other sites

Thank you for the quick reply!

Okay, so let me make this clear that the website is not live yet. And just has been freshly developed. It is hosted on a server and I will be given the login credentials for the FTP and Database. The client had some issues with the prior developer so they left the project incomplete AFAIK.

Hence, not much content to migrate. Maximum of 100 entries might have been done. More entries will be done after I complete the redesign.

1 hour ago, wbmnfktr said:

How much books, movies, events, etc. need to be migrated? 
How many templates are needed?

The templates will be needed are as follows-

Movies list page, Individual movie page, books list page, individual book page, events list page, individual event page, home, about us, contact etc.

I think many of these designs will already be ready in the project. I just need to know where I can find them and modify them. Even if I get the directory with the HTML/CSS design files, that would be great.

 

Link to comment
Share on other sites

Ok... the hardest part seems to be stripping out/receiving all current database entries in order to migrate them in one way or another.

Working remote on the server might work somehow but I would try to get a local copy. That's most often way easier to handle.

The templates shouldn't be a problem either. At least it looks kind of easy and seems to be pretty normal.

I actually don't know the structure of CodeIgniter projects but I guess you should find all necessary parts (HTML, CSS, JS) pretty easy.

You might want to take a closer look into things like preprocessing (SCSS, Less, JS) and automation of some kind. Every developer uses his tools and quirks so there still might be some caveats ahead.

Link to comment
Share on other sites

I've been working with CodeIgniter for over 10 years, and although the general framework structure is predictable and documented, the custom code and database layout that has been developed with it could be... anything!

You don't really have to learn it, but being aware of how it works might be useful in extracting the bits you need. I think these two documentation pages will be most helpful at this stage:

As a rough guide, the URL patterns (/foo/bar) of a CodeIgniter app usually map directly to controllers. These should be in the application/controllers directory, and each file in here is a class. The example URL route of /foo/bar would call the bar() function in the Foo.php controller.

Within the controller, it should (might!) call some 'models' - responsible for database interaction - and pass the result data into the 'views'.

The views are responsible for transforming the data and results into HTML code that is sent to the browser, so this is likely where the main page layout should be, along with the different code for producing the different lists and detail pages. These live in the application/views folder.

By default, there's no templating language or library used (like Twig) - the views are just mixed HTML and PHP, like ProcessWire, so should hopefuly be easy enough to follow.

In terms of the database, you will need to look at how the current one is set up. With any luck, you could probably map each database table (books, movies, events) into PW templates of the same name, and set up PW fields that correspond to the columns in the database tables.

After that, you would need to address any relationships or links between the tables or records, and decide on which PW structure will be best. For example, parent/child pages, Page reference fields, or creating a tagging/categories setup.

If there's any budget for the project, I have some time over the coming weeks and would be happy to help you in the right direction if you think it would be useful ?

Craig.

  • Like 1
Link to comment
Share on other sites

It seems that the website is very simple in its structure: lists/details structure.. maybe even with the ProcessBlog module and using categories you can make the whole site.

If I had to do it, I would do the following process without having to study another platform or make new code:

- I would use a scrapper software on the current site and export the data to a csv file with the fields and names I want.
- I would create the templates in PW for the parent listing page / child detail page for each data model or use only one for all with tags/categories, depend on your idea
- I would use the ImportPagesCSV module to create all pages in only one step

All this you can do without having the html+css design implemented. I think that having the idea of fields and templates, this would not take me more than 4 hours of work.

If you don't have access to a scrapper software, there are some extensions for chrome that can help you, or you can make a small code and use https://github.com/paquettg/php-html-parser.

The idea with this is to avoid understanding CodeIgniter or the database.

I have done this before for marketing affiliate pages = 100% Guaranteed ?

  • Like 2
Link to comment
Share on other sites

4 hours ago, Pixrael said:

If I had to do it, I would do the following process without having to study another platform or make new code:

+1

I did something similar recently, which was surely easier than learning a system I was not really interested in. My trick was to inject the "old record ids" of the old system into its markup (so I only had to understand a little bit its templating), afterwards complete page contents were grabbed and were saved into PW's CKEditor fields and from then on I performed some careful planning and PW template/field works – based on the required relations – and lastly I used php-html-parser to turn the static CKEditor field markups into relations.

  • Like 2
Link to comment
Share on other sites

Thank you all for the inputs. Really appreciate it.

I will be learning the basic structure of CodeIgniter for now. In the next four days, once I get the FTP handed over, I will go ahead and decide how to go ahead with this.

If needed, I will come back to this thread for support and then also to update how I went ahead with it so it might help someone in the future.

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