Skip to content

Instantly share code, notes, and snippets.

View proweb's full-sized avatar

Sergey Mochalov proweb

View GitHub Profile
@proweb
proweb / index.php
Created January 25, 2012 19:53
Joomla - Execute some code on home page and other code on all other pages
<?php
//This will detect the Home Page of Joomla and perfom whatever code you tell it to
$menu = & JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
//This code will be executed on the home page
} else {
//This code will be executed on every page except the home page
@proweb
proweb / index.php
Created December 10, 2011 17:42
Правильное (последовательное) подключение мета-тегов, CSS и JS.
<?php
defined('_JEXEC') or die;
/* The following line loads the MooTools JavaScript Library */
JHTML::_('behavior.mootools');
/* The following line gets the application object for things like displaying the site name */
$app = JFactory::getApplication();
/* Get the document object */
@proweb
proweb / default.php
Created September 28, 2011 20:29
Last and first classes MOD_MENU Joomla default.php
// Copy /modules/mod_menu/tmpl/default.php to /templates/MYTEMPLATE/html/mod_menu/default.php
// Around line 34, find:
if ($item->deeper) {
$class .= 'deeper ';
}
// Replace this with:
$currentitemcount ++;
@proweb
proweb / gist:1156153
Created August 19, 2011 06:00
jQuery focus on first field trick
$(document).ready(function(){
$("input[type=text]:first").focus();
});