Thứ Năm, 30 tháng 5, 2013

Top 10 Free Responsive Joomla Themes

So for the past three days, we’ve given you a quick intro on building responsive web designs for a mobile layout and showcased some free and premium WordPress themes you can adopt for your website.
In today’s post, we’re moving on to Joomla themes. Granted we didn’t find much of it but it’s not like we didn’t try (honest!). In any case, if your site is powered by Joomla, you should take a look. In this list, you will find 10 of the best free responsive Joomla themes, with links to a demo of the themes in action and where to get them.

H5BP4J

H5BP4J is a responsive template starter (very basic) for those who prefer to create their own templates. This template starter was build on HTML5 Boilerplate.

Music

Music is a free responsive Joomla template from GavickPro. This Joomla template produces a breathtaking Web site that will catch your visitors’ attention.
Music

Cameleon

Cameleon is a Joomla 2.5 template built with a responsive design to fit into any screen size available out there. The template comes with rtl support, JJ Slider and accordion menu, Google Fonts and more. It’s also compatible with Joomla 1.6.x – 1.7.x and Joomla 2.5.x

Elastica

Elastica is both beautiful and well presented responsive, and it can fit to all screen sizes, including extra widescreen. Elastica is built on JAT3 2 Framework and jQuery Masonry script.
Elastica

CMS Blue

CMS Blue is a simple responsive theme that offers the basics but you can always use your creativity to modify. This CMS Theme also comes in different colors and style; CMS GreyCMS Water and CMS White.
CMS Blue

JoomlaDagen

JoomlaDagen is a responsive template for Joomla 1.7. The template is also using Twitter Bootstrap, Skeleton and Google Fonts.
JoomlaDagen

Puresite

Puresite is a simple and clean yet beautifully presented responsive Joomla template. This template works well and fits any screen sizes, and the minimalistic design makes it look great.
Puresite

Leo Restro

Leo Restro comes in 3 theme colors to suit your style and support customization for background and fonts via template configuration. Leo Restro is built on the Leo Framework.
Leo Restro

OneWeb

OneWeb is a basic template or ‘template starter’ for Joomla that was built with responsive design in mind; one that you can use for better template design development. Among the features are a fluid grid, HTML5, lightweight and fast.
OneWeb

Vertex

Vertex is a free responsive Joomla template, however the download will require a free membership. Vertex is built on Shape5 framework which offers 95 module positions, custom row and column width, and much more.
Vertex

Bonus:

HTML5 Blank Template

This blank template is an HTML5 template for responsive web design on your Joomla 2.5, created with HTML5 Boilerplate. No graphic or modules, just a solid future-proof foundation to start your Joomla development with.
HTML5 Blank Template

ST BIRDSIGN - RESPONSIVE JOOMLA TEMPLATE

ST BirdSign is a responsive joomla templates with great features. It is built on Avatar Framework but have implemented & improved for many purpose.
  1. Responsive for various resolution screens.
  2. Unlimited Colors , Backgrounds & Module Styles
  3. Flexible layout with 58 module positions, easy to change dimensions of template.
  4. Goolge Font and Google Analytics
  5. GPL License
Responsive Joomla Templates

Thứ Năm, 23 tháng 5, 2013

Customising the dynamic page title

A common requirement is to customise the way in which the page title is displayed, For example, including the site name as part of the page title. The code on this page will allow you to change the global page title across the entire site. You may customise it to your own liking within your own template files. The code can be placed anywhere in your template index.php, although most people tend to insert it near the top or within the <head> element.
To get the current page title:
<?php
$title = $this->getTitle();
?>
Similarly, you use setTitle to set a new page title. For example, to append the site name to the regular page title, you can use code like this:
<?php
$app = JFactory::getApplication();
$this->setTitle( $title . ' - ' . $app->getCfg( 'sitename' ) );
?>
Combining these two pieces of code together, you can do this:
<?php
$app = JFactory::getApplication();
$this->setTitle( $this->getTitle() . ' - ' . $app->getCfg( 'sitename' ) );
?>
Here's a more complete example of what a template would look like with this code embedded in it:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
$app = JFactory::getApplication();
$this->setTitle( $this->getTitle() . ' - ' . $app->getCfg( 'sitename' ) );
?>
<jdoc:include type="head" />
 
.... rest of template file.

Custom user groups

I use custom user groups (user roles) within Joomla 1.5. For example under the registered users group I've added several subgroups:
myproject
customers
customer A admin
product manager
product manager admin
etc....
I use these groups within my extension to set the permissions.
When I add the groups into the jos_core_acl_aro_groups table and set the relations correctly the groups in the user management are not displayed correctly (e.q. the administrator groups disappear). For displaying the groups correctly you will have to change the code of : administrator/components/com_users/admin.users.php line 285:
(Not sure in what version this changed - but in J! 1.5.14 this change is no longer in the administrator/components/com_users/admin.users.php file. This change must now be made to administrator/components/com_users/views/user/view.html.php on line 113.)
if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' )
{
// administrators can't change each other
$lists['gid'] = '<input type="hidden" name="gid" value="'. $user->get('gid') .'" /><strong>'. JText::_( 'Administrator' ) .'</strong>';
}
else
{
$gtree = $acl->get_group_children_tree( null, 'USERS', false );
into
if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' )
{
// administrators can't change each other
$lists['gid'] = '<input type="hidden" name="gid" value="'. $user->get('gid') .'" /><strong>'. JText::_( 'Administrator' ) .'</strong>';
}
else
{
$gtree = $acl->get_group_children_tree( null, 'USERS', true);
If you like to add your self custom groups do the following:
Edit the jos_core_acl_aro_groups table and add your custom groups (for example with phpmyadmin). When you add a new group make sure that you assign the correct parent to the added group. For example: the joomla registered group has the ID 18, when you assign a subgroup to it make sure that the parent_id is 18. Dont assign the lft and rght fields yet but use the code below to rebuild the groups tree correctly:
<?php
 
// Put this code in a file in your Joomla root then run it. Don't forget to delete the file when you're done.
 
require 'configuration.php';
$config = new JConfig;
 
$user = $config->user;
$password = $config->password;
$db = $config->db;
$host = $config->host;
 
mysql_connect($config->host, $config->user, $config->password) or
die("Could not connect: " . mysql_error());
mysql_select_db($config->db);
 
// 0-> parent_id in Joomla this is the value of the parent_id field of the Root record
// 1-> start the left tree at 1
rebuild_tree (0, 1);
 
function rebuild_tree($parent_id, $left) {
 
global $config;
 
// the right value of this node is the left value + 1
$right = $left + 1;
 
// get all children of this node
$result = mysql_query('SELECT id FROM ' . $config->dbprefix . 'core_acl_aro_groups WHERE parent_id = ' . $parent_id . ';')
or die(mysql_error());
 
while ($row = mysql_fetch_array($result)) {
// recursive execution of this function for each
// child of this node
// $right is the current right value, which is
// incremented by the rebuild_tree function
$right = rebuild_tree($row['id'], $right);
}
 
// we've got the left value, and now that we've processed
// the children of this node we also know the right value
mysql_query('UPDATE ' . $config->dbprefix . 'core_acl_aro_groups SET lft = ' . $left . ', rgt = ' . $right . ' WHERE id = ' . $parent_id . ';')
or die(mysql_error());
 
// return the right value of this node + 1
return $right + 1;
}
 
echo 'Complete! Go check your Joomla User Admin!';
 
?>
When you want to use the custom groups to assign to your articles so that for example only the customers can view specific articles you need to add these groups into the jos_groups, just assign the ID + name of the group whereby the name must be equal to the groups names you added into the jos_core_acl_aro_groups table.

Creating a CSS Drop down Menu

To emphasize W3C valid code and lean pages, neither Flash nor JavaScript are generally considered to be favourable. Many (drop down) menu solutions make use of one of these two. There are a number of techniques one can use to get more visually attractive (drop down) menus, almost solely using cascading style sheet (CSS) and limiting the use of Javascript.
All use unordered lists (ul) to create the menu. An often-used solution is the drop down menus called “Suckerfish” or "Son of Suckerfish." It's pure CSS, very lean, hack free and employs just 12 lines of JavaScript to fix some problems with Microsoft Internet Explorer 6 and earlier. You can see a demo of what can be created with Suckerfish. More detailed guides about the Suckerfish technique can be found at htmldog.com and alistapart.com.

Contents

 [hide

Suckerfish Combined with the Extended Menu Module

In order to let Suckerfish function well, you need your menu in the form of a good clean list. It just so happens that there is a module out there to do this. It's called Extended Menu (Module Type: mod_exmenu-j15). You can find it Extended menu and in the JED.
Download and install the module. Now let’s set it up:
In the main Joomla interface, open the Extensions menu and choose the Module Manager.
Select your newly added Extended Menu Module by clicking on its name - it'll probably be fairly close to the bottom of the list.
• Assign a Menu suffix and a Module class suffix of "mainnav" (unless you change the CSS, below)
• Set Menu style: Tree List
• Set Expand Menu: Yes (don't worry about the tooltip description here - the CSS code takes care of hiding and showing the sub-menus, so they need to always be visible.)
• You can leave the other settings here at their defaults.
In order to see it in action, you will likely want to select a set of menus for it to display.

The Cascading Style Sheet

You can either add these CSS selectors to your existing template.css or create a new CSS file. If you create a new file be sure to include a reference to it inside the <head>..</head> section of your template's index.php file.
#twocols{ /* The columns that gets dropped down over yours might be different. */
z-index:20;
}
 
#leftcol{ /* The columns that gets dropped down over yours might be different. */
z-index:10;
}
 
.moduletablemainnav { /* I have absolutely positioned the module, you might have a different scheme. */
position:absolute;
top:187px;
left:20px;
z-index:100;
font:0.9em Verdana, Arial, Helvetica, sans-serif;
margin:0;
padding:0;
}
 
#mainlevelmainnav,#mainlevelmainnav ul {
float:left;
list-style:none;
line-height:1em;
background:transparent;
font-weight:700;
margin:0;
padding:0;
}
 
#mainlevelmainnav a {
display:block;
color:#f90;
text-decoration:none;
margin-right:15px;
padding:0.3em;
}
 
#mainlevelmainnav li {
float:left;
padding:0;
}
 
#mainlevelmainnav li ul {
position:absolute;
left:-999em;
height:auto;
width:11em;
font-weight:400;
background:#36f;
border:#00C 1px solid;
margin:0;
}
 
#mainlevelmainnav li li {
width:11em;
}
 
#mainlevelmainnav li ul a {
width:11em;
color:#fff;
font-size:0.9em;
line-height:1em;
font-weight:400;
}
 
#mainlevelmainnav li:hover ul ul,#mainlevelmainnav li:hover ul ul ul,#mainlevelmainnav li.sfhover ul ul,#mainlevelmainnav li.sfhover ul ul ul{
left:-999em;
}
 
#mainlevelmainnav li:hover ul,#mainlevelmainnav li li:hover ul,#mainlevelmainnav li li li:hover ul,#mainlevelmainnav li.sfhover
ul,#mainlevelmainnav li li.sfhover ul,#mainlevelmainnav li li li.sfhover ul {
left:auto;
z-index:6000;
}
 
#mainlevelmainnav li li:hover,#mainlevelmainnav li li.sfhover {
background:#039 url(../images/soccerball.gif) 98% 50% no-repeat;
}
Make sure you have the z-indexes set up properly. Also remember, in order to have a z-index, the element needs some sort of positioning. If not absolute, then relative.

The JavaScript File

You need to insert a reference to the JavaScript file for early versions of Microsoft Internet Explorer into the head of your template's index.php file.
<script type="text/javascript"><!--//--><![CDATA[//><!--
sfHover = function() {
var sfEls = document.getElementById("mainlevelmainnav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]></script>

Suckerfish Combined with the Default Joomla! Menu Module

The second approach is to implement a Drop Down menu using the mod_mainmenu module that comes with Joomal 1.5. I've played around with the “suckerfish” and CSS to make this work. This work perfectly in IE 7 as well as Netscape.
1. Create your Menu with the following Hierarchy:
Menu 1.
– Menu 1 Sub Menu 1.
– Menu 1 Sub Menu 2.
– Menu 1 Sub Menu 3.
2. Make sure the mod_mainmenu parameters are set to:
• Menu Style is set to List.
• Always show sub-menu Items is set to Yes.
• Menu Class Suffix is set to san - you can pick you own, but then make sure you change it in CSS & JS files.
3. Insert this piece of JS in your template index.php <head> tag, or in Javascript file that’s called from index.php
/* ********* drop down menu Java script code - start **********/
<script type=”text/javascript”><!//–><![CDATA[//><!– // don’t need this line if using .JS file
sfHover = function()
{
var sfEls = document.menusan.getElementsByTagName(”LI”);
 
for (var j=0; j<sfEls.length; j++)
{
sfEls[j].onmouseover=function()
{
this.className+=” sfhover”;
}
sfEls[j].onmouseout=function()
{
this.className=this.className.replace(new RegExp(” sfhover\\b”), “”);
}
}
}
if (window.attachEvent) window.attachEvent(onload, sfHover);
//–><!]]></script> // don’t need this line if using .JS file
 
/* ********* drop down menu Java script code – end **********/
4. Here's the corresponding CSS
Either add these CSS selectors to your template's existing template.css file or create a new CSS file, name it and include it between the <head>...</head> section of the index.php.
/****************** Dropdown Menu styling starts here **************/
.menusan
{
/* Use these parameters to positions your menu. */
position: relative;
left: 10px;
}
 
.menusan, .menusan li, .menusan li ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
}
 
.menusan li a {
display: block;
width: 10em;
color:#FFFFFF ;
background-color:#BC031F;
border:2px solid #BC031F;
text-decoration:none;
}
 
.menusan li { /* all list items */
float: left;
width: 10em; /* The width is needed by the Opera browser. */
border-bottom:1px solid #ccc;
}
 
.menusan li ul { /* second-level lists */
position: absolute;
width: 10em;
left: -98%; /* Use left instead of display to hide menus; display: none isn’t read by screen readers. */
}
 
.menusan li a:hover {
border:2px solid #8C7AD6;
background-color:#8C7AD6;
color:#fff;
}
 
.menusan li:hover ul, .menusan li.sfhover ul { /* lists nested under hovered list items */
left: auto; /* change this to 10px, 20px, etc for indenting the sub menu */
}
/* **************** Dropdown Menu styling end here ***************/
5. Save all.

Creating Several Menus Using Just One Menu

You can use a single menu to create multiple drop downs menus. Just create the menu in the following hierarchy and you’ll have 2 drop down menus, Menu 1 & Menu 2.
Menu 1.
– Menu 1 Sub Menu 1.
– Menu 1 Sub Menu 2.
– Menu 1 Sub Menu 3.
Menu 2.
– Menu 2 Sub Menu 1.
– Menu 2 Sub Menu 2.
– Menu 2 Sub Menu 3.
You might have to play with CSS a bit to work out the positions of the second menu etc. (Note: This did not work on the Chrome Browser 5.0.)