.

Friday, 12 December 2014

Jooma : Creating a simple module/Using the Database

Many modules in Joomla require using a database. It is assumed in this tutorial that you already understand the basics of using the JDatabase class. If you don't please read the documentation on accessing the database using JDatabase before continuing this tutorial

Creating a table on install

To create the xml table on install we are going to add the following lines into mod_helloworld.xml:

<install>
<sql>
<file driver="mysql" charset="utf8">sql/mysql/install.mysql.utf8.sql</file>
<file driver="sqlazure" charset="utf8">sql/sqlazure/install.sqlazure.utf8.sql</file>
</sql>
</install>

<uninstall>
<sql>
<file driver="mysql" charset="utf8">sql/mysql/uninstall.mysql.utf8.sql</file>
<file driver="sqlazure" charset="utf8">sql/sqlazure/uninstall.sqlazure.utf8.sql</file>
</sql>
</uninstall>

<update>
<schemas>
<schemapath type="mysql">sql/mysql/updates</schemapath>
<schemapath type="sqlazure">sql/sqlazure/updates</schemapath>
</schemas>
</update> 
 
There are 3 sections to this code:
  • The install tag adds the database table
  • The uninstall tag removes the database table if the module is uninstalled. Note that not all modules will want to use this feature (and it's not required).
  • The update tag will update the databases if a database needs to be amended when updating the module.
Note that we have both schemas for MySQL and Microsoft SQL - again you can choose to tailor your module for one or both of these systems.
In this example we will just show the example files for the MySQL database. Creating the Microsoft SQL Server will be left as an exercise for the reader.
In our install.mysql.utf8.sql file we will create the table and place some hellos into it

CREATE TABLE IF NOT EXISTS `#__helloworld` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`hello` text NOT NULL,
`lang` varchar(25) NOT NULL,

PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

INSERT INTO `#__helloworld` (`hello`, `lang`) VALUES ('Hello World', 'en-GB');
INSERT INTO `#__helloworld` (`hello`, `lang`) VALUES ('Hola Mundo', 'es-ES');
INSERT INTO `#__helloworld` (`hello`, `lang`) VALUES ('Bonjour tout le monde', 'fr-FR');
 
In the uninstall file we'll just remove the table.

DROP TABLE IF EXISTS `#__helloworld` 
 
Finally we'll just leave a placeholder in the updates file. There is an SQL file for each component version. Each file name must match the version string in the manifest file for that version. Joomla uses this string to determine which SQL files(s) to execute, and in what order they will be executed.
Important Note: These files are also used to set the version number in the #__schemas table. This version number must be present in the current version of the component in order for the new SQL files to be run during the update. For example, if you have version 1.0 and are updating to version 1.1, the 1.1.sql file will not be executed if there was no 1.0.sql file in the 1.0 release. For this reason, it is good practice to have a SQL update file for each version, even if there is no SQL change in that version.
# Placeholder file for database changes for version 1.0.0

Making the request in the helper file

Now on installing our module we should find that there is a helloworld database set up in our database schema with our hello's in. We must now retrieve this from the database to display to the user. We will now amend the getHello function we placed in the helper file in the last part.
For now we'll ignore using form fields to choose a hello and just retrieve the English shout

// Obtain a database connection
$db = JFactory::getDbo();
// Retrieve the shout
$query = $db->getQuery(true)
->select($db->quoteName('hello'))
->from($db->quoteName('#__helloworld'))
->where('lang = ' . $db->Quote('en-GB'));
// Prepare the query
$db->setQuery($query);
// Load the row.
$result = $db->loadResult();
// Return the Hello
return $result;

Conclusion

Using modules with database connections for Joomla! is a fairly simple, straightforward process. Using the techniques described in this tutorial, a lot of modules can be developed with little hassle, with updates easy to manage

Thursday, 11 December 2014

Joomla 2.5 to 3.x Step by Step Migration

The following are step by step instructions to migrate your 2.5.x site to Joomla 3.x. While there are hundreds of different scenarios, this will give you the basic procedure to follow. Very complex migrations will likely be as a result of third-party extensions. You are encouraged to contact the developers of third-party extensions for their suggested path to migrate their extensions.

Introduction

The migration from Joomla 2.5 to 3.x is considered a mini-migration. This is because the Joomla core extensions will upgrade with a “one-click” upgrade via the Joomla! Update component in the backend administrator side of Joomla. Many third-party extensions are a one-click upgrade too. Some are not. You need to look at each one and determine what path the extension needs to follow to get from 2.5 to 3.x. If you haven't already, you might be interested in reading the Self Assessment and Planning for 2.5 to 3.x Migration prior to following the steps below.
Joomla Core Extensions:
  • Categories
  • Articles
  • Menus
  • Modules (core modules - not third-party)
  • Banners
  • Contacts
  • Messaging
  • Newsfeeds
  • Redirect
  • Search
  • Smart Search
  • Weblinks

For very large or complex 2.5 to 3.x migrations

The one-click update will be fine and work well for many. For some larger, more complex sites, the one-click update may not be the best route. For large or very complex sites, you may want to follow instructions for a regular migration and bypass the one-click update functionality. To do this, follow the same instructions for planning 1.5 to 3.x and migrating from Joomla 1.5 to 3.x, simply substitute 2.5 for 1.5 while reading.

Step by Step

Set up a Development Location

  1. Take a backup of your live 2.5 site. You can use a suggested tool (see bottom of page) or you can do this manually
  2. Make sure your environment meets the technical requirements for Joomla 3 before proceeding
  3. Create a new database and new user to restore your 2.5 site to.
  4. Create a testing site or build area to work in and restore the back up copy of your 2.5 site in one of the following places:
  5. In your test location, update your Joomla 2.5 instance to the latest maintenance release (currently 2.5.28).
  6. Test.
  7. Backup again.

Assess Each Extension

  1. You are going to be looking at every single extension installed on your site. You will be determining if they need to update to the latest version or be uninstalled. In Joomla 2.5.28 you can go to Extension Manager  Update tab and click Find Updates which will add a tooltip in the Manage tab giving some compatibility information from the backend. This functionality only supports extensions that update via the Extension Manager Update tab. If you have extensions installed that do not use the Joomla extension update then they need to be assessed manually as detailed below. The same goes for those extensions that have a tooltip. You will still need to check the type of package and migration path with the extension developer to verify how to upgrade/migrate.
  2. Go to Extension Manager  Manage tab
  3. Click the drop-down for Type.
  4. Select Package from the drop-down.
    J25-admin-extension-manage-package-en.png
    Selecting Package first is recommended because if there is something you need to uninstall in a package, it will automatically uninstall the associated Modules, Plugins, or anything else in the package at one time.
  5. Uninstall any Packages that are no longer needed or will not be migrating to Joomla 3.
  6. Repeat this process of going through the Manage tab for all Types in the drop-down: Component, File, Language, Library, Module, Plugin, and Template. If the Author states Joomla! Project, then leave those extensions alone. Smart Search is a Joomla core supported extension even though the Author fields are blank. For all others, make sure that you uninstall those not in use or not compatible with Joomla 3.x.
    NOTE! You will not be able to uninstall a Template that is set as default. You will need to select a Core supported template like Beez or Atomic and then uninstall the template if you need to do so.
  7. Make a note of any versions of Packages and Components currently running that you will be keeping on your site. You can use the Third-Party Extension Inventory Worksheet or just copy/paste them into a document for reference.
  8. Update all extensions to the latest versions.
  9. Before and as you update, note if the extensions have both 2.5 & 3.x versions in the same package. If so, they will be fine to "one-click update." If not, and 2.5 and 3.x have different packages, you need to look at them case by case. They will normally fall into one of the following scenarios:
    • The extension has separate packages but upon upgrading to 3.x, they automatically detect this and still work. Make sure the developer confirms this.
    • The extension has separate packages that need to be uninstalled in 2.5 and then installed with the Joomla 3.x version once the site is migrated. An example of this might be a content plugin. It is very simple to uninstall it in 2.5 and then install it again in 3.x.
    • See Template Considerations for more specific information on templates.
Note on Core Supported Extensions: If you are using a Core Supported Extension (Banners, Contacts, Messaging, Newsfeeds, Redirect, Search, Smart Search, or Weblinks) in Joomla 2.5 and it has been decoupled in Joomla 3.4+, Joomla will detect their use during the upgrade and install those Core Supported Extensions automatically.

Going to Joomla! 3.x

Once you have either updated or uninstalled your third-party extensions so that only those compatible with Joomla 3 are remaining in your installation continue with the following steps:
  1. Go to System  Global Configuration  Server tab and turn Error Reporting from System Default to Maximum. Make sure to Save & Close.
    J25-system-global-config-server-tab-en.png
  2. Go to Extensions  Plugin Manager and enter Remember Me into the Filter and press enter.
  3. Disable the Remember Me plugin by clicking the green check mark and making it a red circle.
    J25-extension-plugin-remember-me-en.png
  4. Take another backup
  5. Recommended but not required: Fix assets. (Fixing the assets table). See below for a tool to do this in just a few clicks.
  6. Go to Components  Joomla Update. (It should say no updates found. If it doesn’t, update Joomla to the latest version and test. Then do another backup.) Click on the Options button at the top right corner.
  7. Select Short Term Support (This is the current text - it may be different in the future) from the drop-down for Update server.
    J25-component-joomla-update-select-support-en.png
  8. Click Save & Close.
  9. You will then see your Installed Joomla Version, the Latest Joomla! verion and the URL for the update package.
    J25-component-joomla-version-update-en.png
  10. Cross your fingers, make sure you turned off remember me and that you have a backup from just before this point.
  11. Click the Install the update button.
  12. Watch the spinning circle go round and round and feel the anxiety building. No just kidding. The amount of time the wheel spins is dependent on your site, internet connection, and server speed.
  13. If all goes well, you will get to a totally new look to the backend administrator panel.
    J32-administrator-overview-en.png
  14. Click the Purge button given.
  15. Go to Extensions  Extension Manager  Database and click Fix
  16. From the Extension Manager go to Discover and see if there are any extensions to install
  17. # Recommended but not required: Fix assets. (Fixing the assets table). See below for a tool to do this in just a few clicks.
  18. Enable Remember Me from the Plugin Manager.
  19. Go to the frontend of your site and see if it shows up even if it’s not the right template. If so, continue. If not, see common errors during migration.
  20. Take a backup.
  21. Go to Content  Article Manager  Options button  Editing Layout tab and set the Save History to Yes.
  22. Install your new template or other extensions if you have them to install. Back up often.
  23. Configure them. Back up often.
  24. Test everything. Back up often.

Going Live with your Joomla! 3.x Site

  1. When you’re ready to go live, back up your 2.5 site for a last time. Restore it in a subdirectory or subdomain if you would like to.
  2. Back up your Joomla 3.x site and move or restore your Joomla! 3.x site to the root (or change nameservers if you were building on a temp domain at a new hosting account root).
  3. Test again.
  4. Remove 2.5 site from server within a couple of days.
  5. Remove all dev sites you may have been working with or keep them up-to-date if they are running a current version in order to ward off hack attempts on your server.
If you had data change on the 2.5 site while you were migrating to 3.x you will want to get that data moved over to the 3.x site before going live. You can do this manually (make sure you keep the same user IDs - go in order) or by using a transfer tool/third-party extension.

Inauguration of Webdec Technologies

WEBDEC Technologies

The penetration of web and digital media into every aspect of people’s lives has caused fundamental changes in how people interact with brands, perceive brands and establish brand loyalty. The proliferation of social media and the convergence of digital media heralds the age of e-relationships. Thriving in this digital era requires an unique approach of  digital marketing.
Webdec  partners with clients to create an edge in this changing digital landscape with a unique blend of creative design, technology , digital marketing and business innovation.

Services We Provide


  • Web Development
  • Apps Development
  • Open Source Development
  • Payment Gateway Integration 
  • Social Commerce
  • e-Commerce Consulting 
  • Social Media Marketing
  • Search Engine Optimization
  • Search Engine Marketing
  • Website Designing
  • Corporate Identity Branding
  • Audio/Visual Presentation

Contact Information

Website           : www.webdec.net , www.webdec.co.in
E-mail             : info@webdec.net, info@webdec.co.in, sales@webdec.net
Contact No.    : 7277045883
Address          : 68/A, 1st floor, H.I.G. Colony, Near New Harmu Park , Ranchi , Jharkhand-834002.

Tuesday, 2 December 2014

Create A Responsive WordPress Theme

Let’s assess the situation. WordPress is an extremely popular, flexible, easy to use and open-source blogging and CMS system. More and more mobile devices are flooding the market every day, changing the way people use the Internet. And the need is growing for more beautifully designed and coded WordPress themes that work well across all of these devices. So, what are we waiting for? Let’s get to work!

At first, the idea of designing and developing a fully responsive, mobile-ready WordPress theme might be overwhelming. You might be thinking, “How do I handle a responsive design with all of this flexible content that a WordPress theme has? What should I consider when designing for touch devices? And do I really have to get rid of drop-down menus and other hover elements on mobile devices?”
But after doing some research and looking more closely at some of the responsive WordPress themes and theme frameworks out there, you will probably wrap your head around the idea pretty quickly, and the evolving world of WordPress theme design will sound like a huge opportunity that you can’t wait to get started on.

It’s All About Preparation

Having a detailed design concept is even more important for a responsive WordPress theme than for a static-width theme. At this stage, you haven’t decided anything, so nothing will get in your way of creating a clever and practical layout that adapts smoothly to different screens.
First, consider what you want to achieve with your WordPress theme, which user group you are targeting, and what their needs are. With these considerations, you can create a list of useful elements for your layout.

Creating the Theme’s Concept

Using this list, you can plan your theme by sketching the layout at various screen sizes.

When sketching, be aware that the layout widths you choose are only rough reference points to represent the common screen sizes of today’s smartphones, tablets and desktop computers. Your goal should always be to create a responsive design that adapts smoothly to a wide diversity of screen sizes.
Ethan Marcotte, author of Responsive Web Design, described his approach to responsive Web design in a recent interview, explaining:
I’m a big, big believer of matching breakpoints to the design, not to individual devices. If we’re after more future-proof responsive designs, we should stop thinking in terms of “320px,” “480px,” “768px,” or whatever — the Web’s so much more flexible than that, and those pixels are a snapshot of the Web as we know it today. Instead, we should focus on breakpoints tailored to the design we’re working on.
While working on your concept sketches, also think about which layout options to offer in the theme (such as header and sidebar options or multiple widget areas) and how they will adapt to different screen sizes as well.

An optional sidebar element in a responsive layout.

Tools for Concept Sketching

Which tool you use to develop the theme’s concept is not important. Just choose one that allows you to work quickly and that doesn’t interrupt your workflow.
If you feel most comfortable sketching on a piece of paper or in a notebook, go for it. You could also try sketching on an iPad using a popular app such as Paper by FiftyThree or Bamboo Paper, together with a digital pen like Wacom’s Bamboo Stylus. Working directly on a tablet will make sharing your ideas later with the developer a lot easier. One of my all-time favorite articles is Mike Rohde’s “Sketching: The Visual Thinking Power Tool,” which promotes sketching as a simple visual tool for thinking.

Use your tablet a simple fast sketching tool.

A Good Concept Saves Time

If you develop the concept precisely at the beginning of the project, you will save a lot of time and effort later in the design process. The layout will adapt to different screen sizes more intelligently if you have thought a lot about the design’s behavior before even opening Photoshop (or your software of choice).

Theme-Specific Challenges to Consider

Because designing a WordPress theme with very flexible content is quite a different challenge than designing a static website, at this early stage of the process you should find solutions to the following theme-specific problems:

1. WordPress’ Navigation Menu

Until responsive Web design found its way into WordPress theme designs, most themes seemed to rely on good old-fashioned drop-down menus to give users multi-level navigation. But because drop-down menus rely on mouse hovering, they don’t work well on touch devices.
We already have some smart solutions for developing responsive, touch device-ready navigation. Brad Frost has a very helpful resource comparing common solutions for responsive menus in his post “Responsive Navigation Patterns.”

2. Responsive Layout Options

Most themes offer users at least some layout options, such as left or right sidebar, header widget and footer elements. To offer this kind of flexibility in a responsive theme, you will have to consider how all of the layout elements will behave on different screen sizes. For instance, if you want to offer a left sidebar option, consider that the content of this sidebar would appear above the main content area on mobile devices. In most cases, this wouldn’t be the best solution because mobile users want to read the most important content first (such as the latest blog post) without having to scroll down a sidebar.

3. Flexible Widget Areas

Widget areas are another challenge for responsive designers. After all, designing one is not easy if you don’t know what kind of content the user will put in it. So, you need to make sure that the design works no matter which and how many widgets are used in the widget areas.

Enough Headaches. Let’s Get To The Fun.

Because you are creating a responsive website, designing the entire website pixel by pixel in Photoshop and then just handing it over to the developer would result in too static a design and too time-consuming a process.

Working With Reference Points

Instead, the design process should be used to figure out the general look and feel of the theme. At this stage, you should also work more intensively on the challenges mentioned, such as responsive navigation, layout variations and flexible widget areas.
How you prepare the design for further development will depend partly on the nature of the project and how closely you will work with the developer. In general, showing your design in the three layout versions is a good starting point: smartphone, tablet and desktop. These “screenshots” can then be used as reference points for development.

A responsive layout in three variations.

Designing in the Browser

Design details such as font sizes, white space and button styles can be defined later directly in the browser. Because browsers often treat these elements differently, designing and testing them directly in their final environments is way more efficient.

Designing for Touch Devices

Because your design will also be used on touch devices, you have to consider the special requirements of these devices. Using a finger to navigate a website is entirely different than using a precise mouse cursor.
This is why buttons and form input fields need to be at the right size. Font sizes and white space should also be applied more generously, so that users can navigate easily and read content comfortably.

Exercise Your Communication Skills

Staying in constant communication with the developer during the entire process is very important (i.e. if you are not the developer yourself). Especially in a responsive design process, incorporating the developer’s knowledge into your decisions will keep you from having to change things later on.

Development

After wrapping up the design process, the first decision to make is whether to code the theme from scratch or to use a blank or starter theme (such as Automattic’s Toolbox or the newer _s theme).
If you want to work with one of the popular responsive frameworks such as Twitter’s Bootstrap or ZURB’s Foundation, then you could use a starter theme that already includes the framework, such as BootstrapWP or WordPress Foundation. Another popular starter theme is Bones, which uses 320 and Up as a mobile-first boilerplate.
Of course, the way you start a theme will always depend on the project and your personal preferences. But if you’re still learning, then a blank theme would serve as a solid foundation for development.

Go Mobile First

A smart approach is to design and develop for the smallest layout first (i.e. smartphones) and then work your way up to tablet and desktop screen sizes. To get further insight into the mobile-first approach to Web design, read the book Mobile First by Luke Wroblewski.

Design and develop your WordPress theme starting with the smallest size first.

Supporting Media Queries in Old Browsers

With the smartphone layout as your default, you will need to rely on a JavaScript solution such as Respond.js to support media queries in old browsers (such as Internet Explorer 7 and 8).
Alternatively, you could add CSS classes for old IE browsers through conditional comments, and then add CSS styles to set a maximum width for old IE browsers outside of your media queries. You can find a detailed explanation of this method in the article “Leaving Old Internet Explorer Behind.”

Images in a Responsive Theme

With the release of high-pixel-density devices such as the new iPad and new MacBook Pro, you will also need to reconsider the images in your theme.
Alternatives to images would be to use a CSS solution or use icon fonts. Fewer images will also result in a much more lightweight theme, which will speed up performance on slow mobile Internet connections. Trent Walton shares his reflections on the Retina-optimization of Web design in his article “In Flux.”

Test, Test, Test

Particularly when developing a responsive theme, testing your work live as soon and as often as possible is critical. This way, you can quickly correct styles during development as necessary. Also, test whether fonts are easy to read and whether images, gallery sliders and embedded elements such as video work correctly on different devices.

How to Test on Mobile Devices

Of course, checking your theme on one of the many screen-resolution-testing tools, such as Screenfly, during development is very helpful, too.


The mobile version of United Pixelworkers’s website tested with Screenfly.
But because of the different behavior of mobile browsers, touchscreens and high-density screens, constantly testing your theme on actual devices is important.
Unless you work for a big company, finding ways to test your theme during the development process can be quite a challenge. Of course, you won’t be able to test on all of the devices out there, but besides the devices that you own, you could ask friends, family, other freelancers and coworkers to help you test. You can also visit your local electronics store to test on the devices there.

Test your WordPress thme on various devices as often as you can.
A helpful post with a lot of testing advice is part 5 of the recent “Build a Responsive Site in a Week” tutorial series on .NET magazine.

Responsive Theme Vs. Mobile Plugin

A mobile theme plugin such as the popular WPtouch plugin can be a great temporary solution to give mobile users a better experience on an existing website. In most cases, offering visitors an optimized mobile experience with the help of a plugin is probably better than not optimizing at all.
But in the long term, a fully responsive theme has many advantages to a plugin:
  • The website can maintain its unique branding across all devices.
  • Users will get the same experience on all devices and thus have less trouble navigating the website.
  • The website will be easier to maintain (the administrator won’t need to install and update the plugin).

A responsive WordPress theme on the left, and a mobile plugin at work on the right.

Conclusion

Responsive Web design is often still described as a trend. And some might quietly hope that the trend will pass sooner or later. But responsive Web design is so much more than a trend: it’s a new mindset, as has been said:
It’s such a shame that Responsive design is often degraded to being a ‘Web design trend’. It isn’t. It’s a new mindset.
In a multiple-device world, where the Internet seems to be available everywhere, responsive Web design feels so much more like a natural process that is just starting to show its potential.
So, what should our job as theme designers and developers be? Because responsive WordPress themes are still so new and in constant development, we must not be afraid to start from scratch, search for improvements and continue learning. And let’s share our knowledge and experience with each other along the way.

How to make a Joomla 3.1 Template Responsive

As we continue creating our Joomla 3.0 template from scratch, we will now make the template responsive.
Much of this tutorial is going to be simply showing you the changes that we're making to the template, but we'll add a few descriptions of what we're doing and why when necessary. We recommend that you read the official bootstrap documentation here on how to make a template responsive using bootstrap.

Our template as it looks now

You can see in the screenshot to the right how our Joomla 3.0 template looks at this time.
 

Removing any css that controls page structure

As Bootstrap and its responsive features basically control the structure of the page, we can remove any previous CSS that we've added that deals with the layout of the page (vs. styling the page, as in colors , font sizes, etc.)
All of the code in our css/style.css file controls the template's layout, so we are going to delete all of the code in that file. The screenshot to the right shows our template after all the code has been deleted from our css/style.css file.
 

Adding bootstrap-responsive.css and the viewport meta tag

As per the official documentation, we need to add the following two lines of code to our template to turn on the responsive features:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/support/assets/css/bootstrap-responsive.css" rel="stylesheet">
The following lines, highlighted in green below, show how we incorporated this code in our template's index.php file.
<?php
$doc = JFactory::getDocument();
$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap.min.css');
$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap-responsive.css');
$doc->addStyleSheet('templates/' . $this->template . '/css/style.css');
$doc->addScript('/templates/' . $this->template . '/js/main.js', 'text/javascript');
?>
<!DOCTYPE html>
<html>
<head>
<jdoc:include type="head" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
We won't show you a screenshot of these changes, as at this point they have made no impact to how the template looks.

Adding the container class

The bootstrap documentation says to set the main div that holds all of your content to a class of container. In our starting template, the main div has a class of main_container, as seen in the code below:
<body>
<!-- main container -->
<div class='main_container'>
After making the necessary change, changing the class from main_container to container, our code looks like this:
<body>
<!-- main container -->
<div class='container'>
As you can see in the screenshot to the right, our template is now taking a little more form to it.
 

Adding row and span* classes

Again, you'll want to read the official documentation to learn more about adding row and span classes to your template. In essense, the row class defines a container that will hold span* classes. A row is divided into 12 columns. If you wanted one column to be 3/4 of the page, and another to be 1/4 of the page, those fractions would equate to 9 and 3. The bellow is a basic example of how you could setup the 3/4 and 1/4 layout:
<div class="row">
<div class="span9">Larger content area</div>
<div class="span3">Smaller sidebar area</div>
</div>
In the screenshot to the right, you'll see our template after being setup with the row and span classes. Below, you'll find the code that makes up our index.php file after making all the changes discussed on this page.
 

Our template's index.php file up to this point

<?php
$doc = JFactory::getDocument();
$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap.min.css');
$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap-responsive.css');
$doc->addStyleSheet('templates/' . $this->template . '/css/style.css');
$doc->addScript('/templates/' . $this->template . '/js/main.js', 'text/javascript');
?>
<!DOCTYPE html>
<html>
<head>
<jdoc:include type="head" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<!-- main container -->
<div class='container'>
<!-- header -->
<div class='row'>
<div class='span12'>Header</div>
</div>
<!-- mid container - includes main content area and right sidebar -->
<div class='row'>
<!-- main content area -->
<div class='span9'>
<jdoc:include type="modules" name="position-3" style="xhtml" />
<jdoc:include type="message" />
<jdoc:include type="component" />
<jdoc:include type="modules" name="position-2" style="none" />
</div>
<!-- right sidebar -->
<div class='span3'>
<jdoc:include type="modules" name="position-7" style="well" />
</div>
</div>
<!-- footer -->
<div class='row'>
<div class='span12'>Footer</div>
</div>
</div>
</body>
</html>

Friday, 21 November 2014

5 Strong reasons Why Joomla is the Best CMS the World Has Ever Known!

When setting up a new website there are a lot of factors to consider, like your design and domain name, but the most important of all is choosing the right platform. This is crucial and not a decision to be taken lightly.
There are a number of factors that need to be taken into account, such as cost, time, quality, flexibility and control.
There is only one award-winning content management system used by millions around the world, including some of the most respected corporations, that meets all of these needs: Joomla.
The debate about which is better, WordPress or Joomla, has raged for too long. In this post I will outline the reasons why Joomla reigns supreme and rightly sits atop the Iron Throne of CMSs.
By the time you finish reading this post you will be convinced of the need to immediately uninstall your worthless WordPress install and make the switch to Joomla.
Your business – and your web cred – depends on it.
TL;DR: If you’re scratching your head at this post, don’t worry – it’s just part of our new Friday Funnies :)


1. 2.8% of the World’s Websites Use Joomla

You can’t argue with 35 million downloads and counting, or as the Joomla website says, one download every 2.5 seconds. Impressive stuff.
Joomla powers the websites of some of the world’s most well-known and much-loved brands like Pizza Hut and Kelloggs and even the websites for Leonardo Di Caprio and Gorillaz!
When you buy an Ã„LVROS armchair from the Kuwaiti IKEA website, you can thank Joomla for your smooth transaction.
With WordPress now the backbone of more than 20 per cent of websites, Joomla can quietly go about being the best CMS available without the added pressure of being the most popular. A brilliant business strategy.

2. Joomla Has More Than 6000 Extensions

What WordPress folk refer to as “plugins”, Joomla developers refer to as “extensions”.
The 12,000+ plugins available to WordPress users is way too much. It’s overkill. I mean, who needs to rainbowify, unicornify or catify their site? There’s no need for all that junk. There’s no need to add even more clutter to Joomla’s already beautiful templates.

3. Some of the Biggest and Most Respected Companies in the World Use Joomla


Pizza Hut, the UK Ministry of Defence, the Greek Government, the High Court of Australia and MTV in Greece are just some of Joomla’s biggest fans.
And did I mention that Leonardo Di Caprio uses Joomla? Pretty cool, huh?
But what you might not know is that McDonalds is also a convert. That is, McDonalds in Bahrain.
If you have a craving for McArabia Chicken or a McRoyale Burger, the local McDonalds website has you covered.
Joomla powers the restaurant’s website for the Arabian Peninsula, ensuring information is easily on hand for budding burger flippers with stars in their eyes wanting to find out more about the region’s Hamburger University.

Featured Plugin - WordPress Infinite SEO Plugin

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

4. The Admin Area Inspires Greatness

The Joomla admin area makes me so happy!
Just as Muhammad Ali was the greatest, so too is Joomla and its stunning and simple to use admin area.
Joomla’s endless lists of text that seem to go on and on and on, the multiple sets of navigation and the fact is calls me a “Super User” like I’m some sort of web wunderkind who controls the interwebs from the admin area that in no way at all looking bland and boring. I’m in love.
Logging in conjures up images of riding a unicorn over a sea of rainbows and joy balloons.
Yes, I love the admin area. It doesn’t make me want to smash my head on my keyboard at all.

5. The Default Templates are Simply Stunning

Joomla comes with two gorgeous default templates.
I mean Protostar, doesn’t it knock your socks off with its pretty blue flower and all the… other stuff? And don’t get me started on Beez3 with it big blue banner and boxes.
There’s no need to download any of the hundreds (not thousands) of fancy new templates when two high quality templates are already installed for free. And when you get tired of one template (which is highly unlikely) you can just switch to the other template.

Conclusion

Joomla is by far the best CMS available and way better than WordPress. It’s just a matter of time before it dominates the market place. Just a matter of time. You wait and see…

Wednesday, 19 November 2014

7 Quick Joomla! Tips for Developers


 
photo by Castles, Capes & Clones/Flickr
If you're doing custom design and development with Joomla! you need all of the tips and tricks you can get your hands on to streamline your development process and make sure you're doing things the correct way.
Here are a few tips & tricks for my Joomla! developer friends.

1. Add CSS stylesheet into the <head> from your template override

JHTML::stylesheet('PATH/TO/STYLESHEET.css');
Ever needed to add a stylesheet from a template override? Probably often, right? The code above will insert a <link> to your stylesheet. You can also link to stylesheets that don't live on your server (e.g., files hosted on a CDN).

2. Add a JavaScript file into the <head> from your template override

JHTML::script('PATH/TO/JAVASCRIPT_FILE.js');
Like stylesheets, you may run into instances where you'll need to add an external JavaScript file to the <head> from within a template override (or custom component view).
NOTE: Make sure to take a look at your source code to see if items are ordered correctly. Many times, you'll need to place a call to the JavaScript Framework that your script depends on just before the call to your script.
For example, if the script that I am including depends on the jQuery framework, my code might look like this:
...

echo JHTML::_('jquery.framework');
echo JHTML::script('components/com_mycomponent/assets/js/my_script_that_depends_on_jQuery.js');

...
Don't worry if you've called the jQuery framework elsewhere in your code, Joomla! will only render it once.

3. Add JavaScript frameworks via JHTML

Joomla! 3.2 has added a bunch of JavaScript Frameworks that you can include in your template.
We'll use some of these directly in our index.php file of our template if we know that every page will need it. Otherwise, you can include these in your custom modules and components—also in any of your template overrides!
//Bootstrap Framework (This will also automatically enable the jQuery Framework in noConflict mode)
JHtml::_('bootstrap.framework')


//jQuery Framework in noConflict mode
JHtml::_('jquery.framework');


//jQuery in normal mode
JHtml::_('jquery.framework', false);


//jQuery UI framework
JHtml::_('jquery.ui');


//jQuery UI with sortable enabled
JHtml::_('jquery.ui', array('core', 'sortable'));


//MooTools Core framework
JHtml::_('behavior.framework', 'Core');


//MooTools More framework
JHtml::_('behavior.framework', 'More');

There are a slew of other frameworks that you have access to through Jhtml, check out the Joomla! Docs for more.

4. Display a relative date with JhtmlDate::relative

JHtmlDate::relative($this->item->created);
You'll use this when you want to display a relative time instead of the standard date format. There are two optional arguments that you can pass in (unit and time)—check out the Joomla! API Documentation for additional info.

5. Standard Joomla! form field types

Bookmark this page!
This list comes in handy when you're building that custom module or component. I reference this page a ton.

6. Things to know when upgrading your Joomla! site

Bookmark this page, too!
Ever since Joomla! released version 3, we've been updating our clients' sites. A very tedious task when a site has a ton of custom extensions.
The above page will help you transition your old Joomla! site to a beautiful Joomla! 3 site. I find myself referencing this page constantly during an update.
And as always, BE SURE TO BACKUP YOUR SITE BEFORE UPDATING.

7. Joomla! Component Creator

http://www.component-creator.com/en/
If you haven't already, you need to give this generator a try.
This thing will get you building your new component, literally, in seconds. This has helped us skip all of the legwork that comes with building a template and lets us get into the meat of the development.
Trust me, this tool will help you get started on building a component a million times faster.
tags : joomla : cms : webdev : jquery : tutorial : mootools : dev with mtycks
sharing link :
category : Development

.

Popular Posts

Powered by Blogger.