官术网_书友最值得收藏!

Upgrading a Joomla! 2.5 component to make it Joomla! 3 compatible

If anyone has told you that all you need to do to upgrade an extension from Joomla! 2.5 to Joomla! 3 is do a find-and-replace for the new legacy classes, then they were lying, or didn't know what they were talking about. This may be true for very simple extensions that are already following best practices, but in reality there is a lot more work involved. There were a number of functions that were deprecated or changed, and with the introduction of Bootstrap, the backend interface has undergone some significant changes. So to make the extension work well on Joomla! 3, there is a bit of work involved.

The following section details a lot of the changes you will need to make to get your extension working in Joomla! 3:

http://docs.joomla.org/Potential_backward_compatibility_issues_in_joomla_3.0_and_Joomla_Platform_12.1

Some of the changes are quite subtle, such as changing the nameQuote to QuoteName, but some require a bit more work than just finding and replacing, such as the changes from getTableFields to getTableColumns. One change I'd like to highlight is the removal of DS that was commonly used for the directory slashes in previous Joomla! versions. Now you should use / instead. For example, JPATH_COMPONENT.DS.'controller.php' would now be written as JPATH_COMPONENT.'/controller.php'. Although you could define a DS constant to avoid having to change your code, I would recommend that you make the effort and update your code.

For plugins and modules, this is probably all you need to do to them and they will work, but for components it is not quite that easy. Even after you've made all these changes, although your extension may work in Joomla! 3, it may not look very pretty. You will see an example of this in the following screenshot, where there are unnecessary bullet points and a field that is only partially showing:

Since Joomla! 3 now uses Bootstrap and is mobile-ready, there is a bit of work required to make the extension look and behave like the core extensions, as there are a number of visual changes such as the introduction of tabs. All the detailed changes necessary to convert a Joomla! 2.5 component to a fully Joomla! 3 native component are outside the scope of this book, but you will be able to compare your code to our Joomla! 3 examples to get an idea of what you need to change, or you could also have a look at com_weblinks. The following screenshot shows the same form as shown in the previous screenshot, however this one has been fully updated to support Joomla! 3:

主站蜘蛛池模板: 宽甸| 武冈市| 徐汇区| 钦州市| 于田县| 克东县| 庆阳市| 泸州市| 云霄县| 花莲市| 盱眙县| 兴仁县| 汉川市| 沁水县| 黄梅县| 达孜县| 宜昌市| 会同县| 衡南县| 榆树市| 德兴市| 清丰县| 甘肃省| 浦东新区| 南和县| 赫章县| 班玛县| 织金县| 盐津县| 电白县| 上饶市| 山东| 江源县| 迭部县| 织金县| 北票市| 麻栗坡县| 惠水县| 京山县| 三江| 汝城县|