How do I migrate a PHP based website to Joomla? - php

I have a PHP based website, with database connections, form processing, etc, that I need to use a CMS on. I'm trying to use Joomla but after using it for 2 days and reading tutorials on it I'm getting the impression that it's designed to handle static content and that all form processing is to be handled by 3rd party extensions.
Am I getting the wrong impression? Is there a standard way to import a PHP website into a Joomla CMS?

I inherited a Joomla 1.5 site a few months ago, so I was in a similar situation to you - where to begin, with lots of questions about Joomla, its ethos, etc. What I've learnt in the meantime is:
Joomla is very heavily dependent on 3rd-party extensions. Some of these are good, some not so good - evaluation and caution is advised.
Joomla encourages the use of extensions, even for relatively static content. Whether these are full blown 'components', or 'modules', depends on quite how powerful/flexible they need to be.
The MVC architecture that underlies everything has its positives and negatives. On the plus side, if everything is done consistently, there is a good separation of concerns and - in particular - the template system offers good configurability. On the downside, very simple components/modules have an awful lot of complexity - e.g. just in terms of number of files.
Joomla is open-source ... sort of. If your familar with the open-source community, you might be a bit disappointed with Joomla, especially when it comes to 3rd-party extensions. Many of them do not embrace the open source ethos, and try to sell code and/or support so, to reiterate, choose your extensions carefully.
Writing your own extension is fairly simple, especially if you're familiar with PHP. Although the documentation isn't great, there are some gems - in particular, take a look at:
http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
http://docs.joomla.org/Accessing_the_database_using_JDatabase
When it comes to forms, I'm still undecided. The site I've inherited uses a third-party extension to manage them (mod_breezingforms), but it has its issues. If you have the luxury of trying out several alternatives, take it.
Run your development site in debug mode. Take a look at database queries. In my own experience, Joomla is very, very demanding on the database. For example, I have some pages that make hundreds of calls to the database with every request. Watch out for this.
At some point, you'll see itemid in the URL and wonder what on earth it is. It refers to a menu item. Menus in Joomla are a bit more general than you might think - they don't necessarily represent a 'menu' and they're quite important. For example, the built-in way to include content on a series of pages is for them to belong to the same menu item, so you might need to create 'fake' menus to house content.

Try MODx Revolution. You can insert your existing php form processors straight into Snippets with next to no modification required, or using the existing FormIt extra. Ajax is easy as pie.
Some docs to get your started:
Overview
Making Sites with MODx
Snippets
edit: apologies if it looks like I've tried to hijack this thread, somehow missed the fact the question is referring specifically to Joomla. MODx is definitely worth a look though ;)

There aren't many CMS's that can handle forms correctly (maybe only the very very generic ones, such as contact me forms, or shopping carts), but for any other purpose, you probably want to use your own PHP script to handle and process the form.
Nothing is stopping you from having a CMS on one part of the page, and your own PHP script on another.
I've once had a website with 2 different CMS's (Wordpress and Joomla), as well as some custom made pages. Slightly trickier to handle, but it's possible.

This question is very broad to answer. There are few step-by-step tutorial available on the internet for this.
From Joomla
Site Ground tutorial
If you follow this head start. You are sure to know a lot of joomla along way and convert your website to the joomla.
BUT, it is easier to build on Joomla rather than convert to it

The first trick to using Joomla effectively is to not over think things and use code that is proven so you don't have to work so hard.
Your existing content can likely be imported to Joomla just be exporting it to a CSV then importing back in to the Joomla article table.
Form handling is incredibly easy. There are dozens of form handling extensions, some of which do more than you will likely ever need. I use ChronoForms most of the time because it can be made to do basically anything once you learn how it works. I also like RSForms if you need non-tech people to be able to create forms on their own.
"Load dynamic data" in to a Joomla article is not very specific, but I'll take a stab at it. If you mean getting user submissions, then there are front end content submission options built in. If you mean loading data from another source, then you can generally use either a module or a plugin to get that data loaded either on the page or actually within the article itself.
Spend a little time getting to know how it works. Learn the difference between a component, plugin, and module and that will help you get a better grasp of what you can do. Joomla is an extensible framework, there's nothing you can't make it do and many things that are already built for you.

I would use JUMI, a Joomla component for embending your own PHP scripts. No scripts modifications are required!

Related

Converting PHP site to Joomla

I have a large complex web site currently implemented using PHP and MySQL.
Some of the pages (about, contact us, etc) are largely static, but need to be updated from time to time. I'd like these updates to be able to be done by non technical admins, so I'm migrating the site to Joomla CMS. I've created a Joomla template to reproduce the banners, styling etc of my existing web site and have successfully reproduced the static pages by cutting and pasting into Joomla articles.
I'm now trying to embed my existing dyanamic php pages into the Joomla framework. I assume that I need to convert them into one or more Joomla components? I realize that I'll need to strip out the php code that currently generates banners, menus, etc, but I don't want to make major changes to these php pages, i.e. I don't want to re-implement them to follow an MVC pattern. I'm looking for a simple Joomla 3.2 hello world component tutorial. The tutorials that I've found are either too complex (i.e. MVC) or they're "too simple". By too simple I mean the component is not listed when I select Menu Item Type within the Menu Manager. Can anyone point me to any documentation that explains the minimal config that I need to include in a custom Joomla 3.2 component in order for the component to be listed when selecting Menu Item Type?
Also, should I create one big custom component to wrap my existing PHP application containing multiple pages("views"?)? Conceptually there the system could be considered as about 3 sub-systems, but there is some overlap between the MySQL tables used in these different sub-systems.
I don't need the implementation to be portable, i.e. I'm not trying to create a reusable component that others could use, I just need it to work on my site, using the least amount of work possible.
Thanks, Wayne.
I hope to clarify a bit and give you way out.
In response to your comment on #user3057084, the power of Joomla and its flexibility comes from it being MVC! If you want to wrap your existing code with little modifications, Wordpress will let you do all kind of nasty things! Nasty in the sense of mixing logic with data, i.e. copying and pasting your code and getting it to work quickly.
Joomla coding standards require that you separate models from views. And that you understand how the Joomla MVC implementation works. It will take longer, but you'll learn a useful skill that can and should be applied if you want to write portable maintainable code following Design Patterns.
Now about the way out.
Nothing keeps you from putting your raw php code in a Joomla view, including the database access. It's really ugly and I feel bad even suggesting this, but if it can be a small step towards using a great framework, then the end justifies the means.
The absolute easiest way for you in Joomla would be to create a template override (which you'll do from the admin with a few clicks in the template manager), then throw your code in, and it will run. Then, a little bit at a time, you might learn to separate the parsing of the input in the controller, store / retrieve the data in a model, and leave just the markup in the view.
But are you absolutely sure you need to code for this? There are thousands of (free) extensions out there that might do the job for you with no coding and little configuration, leaving you just a data migration to handle.
Have you had a look at Wordpress yet? In my experience, non-technical people find it easier to administer a wordpress website in comparison to a Joomla website.
When it comes to the menu structures,themes and contact forms and blogs - Wordpress takes the cake.
It would be worth your while to check it out? It might save you hours of frustration?

PHP is a framework the best choice for basic CMS websites

Having been dong research on codeigniter,kohana and fuel php, they seem excellent for the large scale project I want to create with various sections of code. The system I want to build is to be a core set of code, which can produce a full ecommerce web application with plenty of modules, or can produce a simply few page site, with a news or gallery or whatever.
I have started thinking that I may be looking at the wrong thing for producing basic sites. From my very brief research, it seems (atleast on codeigniter) I need to use the 404 overwrite to point to my pages controller in order to handle basic content pages (from the base url /).
Should I consider a seperate code set for the basic sites, and use these frameworks only for large web apps, or is this the normal way frameworks would handle serving basic content pages.
I personally have a core framework (MVC/CodeIgniter) which I use for even the simplest static sites - Because someone will always say "Oh and can we have a shop" or a contact us form or ...
The overhead of the frameworks themselves is negligible if they're not doing any work - so why not put them in?
Another bonus is that you now know exactly what environment your modules will be in - you don't need to worry about maintaining one versions for sites with the framework and one for those without (One other benefit of using a framework is that it makes if far easier to maintain code in general - especially in multiple-developer environments.)
Th templating engines provided by most frameworks (or easy extensions to them) are often useful even for static sites (custom controls like a news ticker or custom markup/js validation for certain controls)
In short, unless you have extremely limited server resources (mobile device?) use a framework
Edit:
I'd add a note of caution - PHP is a very flexible, powerful language and when used well can create some truly fantastic sites. When used poorly, however, it is easy to make insecure websites.
From your post, you seem relatively new to PHP/Frameworks. Can I suggest you make sure that the framework you pick enforces good behavior (as much as possible)
CodeIgniter removes unsafe $_POST and $_GET variables, replacing them with safe equivalents. It also provides a parameterised mechanism for querying the database which helps avoid SQL inection attacks. These are important things to consider when comparing frameworks.
I personally found CodeIgniter to be a good balance of maintainability, security, extensibility and functionality.
I would consider using a CMS for the basic sites, something like Drupal, they do a lot out of the box and should satisfy your requirements for a basic site.
As for the eCommerce part, from experience its best use something that is separate from the CMS. Largely because projects or frameworks that are designed for that sort of thing are generally an application.
CMSes do what they do they do best, but that all they really do :)
Also have a look at Magento for your eCommerce needs.
Hope this helps.
I think your question is about what to use for "basic websites".
Should I consider a separate code set for the basic sites, and use
these frameworks only for large web apps, or is this the normal way
frameworks would handle serving basic content pages
If by basic sites you mean websites that have little to no dynamically drawn content, I would suggest a CMS such as Wordpress. You mention that you are using PHP and Wordpress is a very popular option. If you are creating a blog and a very static pages, this will be a great option. It can even be modified to do more 'dynamic' things that can be considered "CMS Territory". Once you get the basics of Wordpress down, and if you still feel that you need to modify it a lot, then you should look in to a framework that will allow you to have total control such as Codeigniter, Cakephp, etc.
Hope this helps.
Ben this is an interesting topic and no matter which direction you eventually go it would be nice to know your choice of combination. Depending on your requirements.
For something with medium range functionality OSCOMMERCE might be worth a check on. Also see Zencart, Virtumart and Megento.

Dynamic Sites with Wordpress (PHP)

Hey I'm slightly newb when it comes to building comment boxes and avatar/profile pic systems linking with acccounts
My question is: Is there a way I can just use parts of Wordpress CMS such as the content system (because it is* separate via comments.php) into my dynamic php/sql driven website?
Are there any examples of this? I've been having a hard time finding any examples/tutorials/github stuff on this
Thanks :)
Wordpress wouldn't really be something you could pick apart like that, most of the components are tied together and I don't think it would be easy to use just the cms part and not others. The admin interface would definitely be hard to change, and since wordpress updates frequently, you would have trouble merging the updates back to your site I would think.
That said, you can find or create a custom theme and disable comments and remove all the comment functionality from your site. If not, can you describe your needs more and/or what you already have done? Maybe another CMS or system would be more suitable for you.
Or look at one of the PHP frameworks such as Zend Framework, symfony, or Codeigniter. These frameworks can ease development but have some learning curve.

Do I have to work with code when building websites in Drupal

I know HTML and I know some PHP. But I would like to know if professionals do use code a lot when developing websites in Drupal. My experience from Drupal is that you don't have to write any PHP or HTML at al and that you can do everything from the admin menu. But since I'm new with Drupal and currently learning Drupal 7 I would like to know what opinion others have when it comes to Drupal and building websites.
When are you using code in you are using code at all?
As a professional, yes, I use PHP and HTML all the time while working with Drupal. I'd say that roughly 70% of the time is doing PHP, 5% is configuring the modules via Drupal's interface and 25% is testing. The numbers given are, of course, just to let you see how important PHP coding is when I'm doing a Drupal site for a client.
Theme development cannot be done without PHP + HTML + CSS + JavaScript coding. Drupal 7 requires more work than Drupal 6 due to an increased template engine granularity.
If there's no contrib module that suits you, you need to write your own or tweak an existing one (PHP and SQL, sometimes JavaScript). This is true especially of Drupal 7, as there are still many modules from D6 that have no stable version for D7.
Once you get more experienced, you'll come to this conclusion:
Drupal carries you 90% of the way, and the remaining 10% is up to you.
Not every module will solve the particular problems of your project.
The upside is the API is pretty thorough and most (just about anything) is solvable in a simple module, template override, or hook.
Unless you are building simple sites, you will probably do some coding. At the very least you will modify existing code to make changes to existing modules. More likely you may need to create new modules. Even though existing modules about, finding one that always does exactly what you want may be difficult.
Short answer: Yes, you will have to write code.
Here's why. Drupal, on it's own is all well and good. It does what it needs to do, however when setting up a website professionally you can't use the default themes, most clients wont want this. Quite a lot of clients would prefer a unique theme, which involves you creating one. This would involve some PHP programming in order to get it working with Drupal.
Not only that, but writing and or customizing Drupal plugins will most likely be necessary.
In most, if not all professional environments the 'default' just isn't enough.
I'm on the newer end of the Drupal spectrum. I've built about five sites. I built my first several sites using little or no PHP (I did use ample CSS and HTML markup). So I would say that it is possible to build in Drupal with little understanding of PHP.
But. Drupal is a complex system which seems to favor developers, as opposed to end users who may favor the click together approach (although this is something that may be changing).
I've found that the more I understand the codebase and the API, the easier it is to get what I want without having to wade through a giant body of contributed modules. The repository of contributed material in Drupal is fantastic and covers a lot of ground, but isn't always actively maintained and may not do just what you want.
I think a good place to start is understanding the hook system, the Form API, and the menu system, as well as how to generate queries. That's all more back-end stuff. On the front end: the template system, template.php and the preprocess and theming functions.
Checkout api.drupal.org.
No.
Drupal and its 90 million modules love checkboxes and dropdowns and textfields etc etc to set everything up. For most features, you won't need PHP and only very little HTML.
I consider this a downside and a flaw, but some like it.

Should I use WordPress or go custom?

I'm taking on a relatively small freelance project and my client would like to update several portions of their site; photo gallery, calendar list, about page, and some event links.
My gut tells me to use something like WordPress and use "Pages" for these sections, but I'm worried about my client maintaining the formatting. Especially something like calendar dates and links.
They won't be doing any blogging - this is just so they can update those sections when needed (obviously).
But then I thought, what if I just roll my own CRUD for these portions, but I'm not sure if that would be necessary for a project like this.
So what would people out there use in a situation like this? How much control does one have over the formatting of content in WordPress? I'd like not to have to teach my client on when to call certain CSS classes.
Any help is more than appreciated.
EDIT:
Any idea how the top carousel of BungoBox was made in WordPress? Or don't you think it's possible and that is done manually?
I would stick to wordpress or similar CMS system. It will be a pain-in-the-arse, to take care of formatting (WYSIWYG for client), take care of security, make the administation pages nice and functional, and so on.
You will find a LOT of information on wordpress as a cms on the web, for example see here
Have you considered any other cms system?
From the description this is a site that would consist of just a few pages that the client would want to update? if so, I'd stick with wordpress myself. There's a ton of pre-written modules and themes already out there, and there's no sense "re-inventing the wheel". Also I've found in my travels that Wordpress leads the pack in being able to manipulate content to your will of all the CMS's and the available WYSIWIG plugins they have. Remember, if they cant' get their document to look just right, guess whose getting the call, and who will be expected to fix it on your dime if you didn't specify that in your contract (you are offering maintenance as an additional feature right?)
Now if the client is looking for a more robust system, a larger site then I interpreted in your writeup, then I'd look into more of a CMS system such as Drupal or Joomla. Avoid the trap that seems to nail PHP coders that it'd be faster to do it yourself; it'd have to be a lot of custom functioanlity to start looking at building it yourself from the ground up (and even then, there's enough frameworks to help)
What about something like Drupal? Never used it personally, but I think it's built for this sort of thing, whereas WordPress is kind of tailored towards blogs.
Definatly go with wordpress, drupal is just too heavy for the job and will take you much longer to configure.
If you are worried about your client ruining design with a WYSIWYG editor, just don't give them access.. keep them on a need to know basis for their own good.
Working with wordpress will free you from maintaining security issues and many other unpredictable-at-this-point cases of reinventing the wheel.

Categories