Не могу подключить библиотеку jquery к шаблону. index.php шаблона Код (CODE): <?php /** * @package Gantry Template Framework - RocketTheme * @version 1.5.0 December 1, 2010 * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2010 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only * * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system * */ // no direct access defined( '_JEXEC' ) or die( 'Restricted index access' ); // load and inititialize gantry class require_once('lib/gantry/gantry.php'); $gantry->init(); ?> <!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" xml:lang="<?php echo $gantry->language; ?>" lang="<?php echo $gantry->language;?>" > <head> <?php $gantry->displayHead(); $gantry->addStyles(array('template.css','joomla.css','typography.css')); ?> </head> <body <?php echo $gantry->displayBodyTag(array('backgroundlevel','bodyLevel')); ?>> <div id="rt-page-surround"> <?php /** Begin Drawer **/ if ($gantry->countModules('drawer')) : ?> <div id="rt-drawer"> <div class="rt-container"> <?php echo $gantry->displayModules('drawer','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Drawer **/ endif; ?> <?php /** Begin Top **/ if ($gantry->countModules('top')) : ?> <div id="rt-top"> <div class="rt-container"> <?php if (controlsDisplay('top')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('top','standard','scroller'); ?> <div class="clear"></div> </div> </div> <?php /** End Top **/ endif; ?> <div id="rt-topbar"></div> <div id="rt-page-background"> <div id="rt-page-background2"> <?php /** Begin Header **/ if ($gantry->countModules('header')) : ?> <div id="rt-header"> <div class="rt-container"> <?php echo $gantry->displayModules('header','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Header **/ endif; ?> <div class="rt-container"> <?php /** Begin Navigation **/ if ($gantry->countModules('navigation')) : ?> <div id="rt-navigation" class="<?php if ($gantry->get('menu-centering')) : ?>centered<?php endif; ?>"><div id="rt-navigation2"><div id="rt-navigation3"> <?php echo $gantry->displayModules('navigation','basic','basic'); ?> <div class="clear"></div> </div></div></div> <?php /** End Navigation **/ endif; ?> <?php /** Begin Sub Navigation **/ if ($gantry->countModules('subnavigation')) : ?> <div id="rt-subnavigation" class="<?php if ($gantry->get('menu-centering')) : ?>centered<?php endif; ?>"> <?php echo $gantry->displayModules('subnavigation','basic','basic'); ?> <div class="clear"></div> </div> <?php /** End Sub Navigation **/ endif; ?> <?php /** Begin Utility **/ if ($gantry->countModules('utility')) : ?> <div id="rt-utility"> <?php echo $gantry->displayModules('utility','standard','standard'); ?> <div class="clear"></div> </div> <?php /** End Utility **/ endif; ?> <?php /** Begin Showcase **/ if ($gantry->countModules('showcase')) : ?> <div class="rt-section-div"></div> <div id="rt-showcase"> <?php if (controlsDisplay('showcase')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('showcase','standard','scroller'); ?> <div class="clear"></div> </div> <?php /** End Showcase **/ endif; ?> <?php if ($gantry->countModules('showcase') and $gantry->countModules('feature')) : ?> <div class="rt-showfeature-div"></div> <?php endif; ?> <?php /** Begin Feature **/ if ($gantry->countModules('feature')) : ?> <div id="rt-feature"> <?php if (controlsDisplay('feature')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('feature','standard','scroller'); ?> <div class="clear"></div> </div> <?php /** End Feature **/ endif; ?> <div id="rt-body-background"> <div id="rt-body-overlay"> <?php /** Begin Main Top **/ if ($gantry->countModules('maintop')) : ?> <div id="rt-maintop"> <?php echo $gantry->displayModules('maintop','standard','standard'); ?> <div class="clear"></div> </div> <?php /** End Main Top **/ endif; ?> <?php /** Begin Breadcrumbs **/ if ($gantry->countModules('breadcrumb')) : ?> <div id="rt-breadcrumbs"> <?php echo $gantry->displayModules('breadcrumb','basic','breadcrumbs'); ?> <div class="clear"></div> </div> <?php /** End Breadcrumbs **/ endif; ?> <?php /** Begin Main Body **/ ?> <?php echo $gantry->displayOrderedMainbody('mainbody','sidebar','standard','standard','standard','standard','standard'); ?> <?php /** End Main Body **/ ?> <?php /** Begin Main Bottom **/ if ($gantry->countModules('mainbottom')) : ?> <div id="rt-mainbottom"> <?php echo $gantry->displayModules('mainbottom','standard','standard'); ?> <div class="clear"></div> </div> <?php /** End Main Bottom **/ endif; ?> </div> </div> <?php /** Begin Bottom **/ if ($gantry->countModules('bottom')) : ?> <div id="rt-bottom"> <?php if (controlsDisplay('bottom')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('bottom','standard','scroller'); ?> <div class="clear"></div> </div> <?php /** End Bottom **/ endif; ?> </div> </div> <?php /** Begin Footer Section **/ if ($gantry->countModules('footer') or $gantry->countModules('copyright') or $gantry->countModules('debug')) : ?> <div id="rt-footer-surround"> <?php /** Begin Footer **/ if ($gantry->countModules('footer')) : ?> <div class="rt-container"> <div id="rt-footer"> <div class="rt-section-surround"> <div class="rt-row-surround"> <?php echo $gantry->displayModules('footer','standard','standard'); ?> <div class="clear"></div> </div> </div> </div> </div> <?php /** End Footer **/ endif; ?> <?php /** Begin Copyright **/ if ($gantry->countModules('copyright')) : ?> <div id="rt-copyright"> <div class="rt-container"> <?php echo $gantry->displayModules('copyright','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Copyright **/ endif; ?> <?php /** Begin Debug **/ if ($gantry->countModules('debug')) : ?> <div id="rt-debug"> <div class="rt-container"> <?php echo $gantry->displayModules('debug','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Debug **/ endif; ?> </div> <?php /** End Footer Section **/ endif; ?> </div> <?php /** Begin Popups **/ echo $gantry->displayModules('popup','popup','popup'); echo $gantry->displayModules('login','login','popup'); /** End Popup s**/ ?> <?php /** Begin Analytics **/ if ($gantry->countModules('analytics')) : ?> <?php echo $gantry->displayModules('analytics','basic','basic'); ?> <?php /** End Analytics **/ endif; ?> </div> </body> </html> <?php $gantry->finalize(); function controlsDisplay($positionStub){ global $gantry; $published = array(); $showControls = false; $positions = $gantry->getPositions($positionStub); foreach($positions as $position){ if ($gantry->countModules($position)) array_push($published, $position); } foreach($published as $position){ if (!$showControls && $gantry->get('scrolling'.$positionStub.'-enabled') && $gantry->countSubPositionModules($position) > 1) $showControls = true; } return $showControls; } ?> библиотеку положил в корень сайта в папку js (там лежит файл jquery.js) создал страницу в нее через html редактор написал код скрипта Код (CODE): <!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> <title></title> <style type="text/css"> body { font-family: Arial, Sans-Serif; font-size: 13px; } #inputArea { font-family: Arial, Sans-Serif; font-size: 13px; background-color: #d6e5f4; padding: 10px; width:310px; } #inputArea input, #inputArea textarea { font-family: Arial, Sans-Serif; font-size: 13px; margin-bottom: 5px; display: block; padding: 4px; width: 300px; } .activeField { background-image: none; background-color: #ffffff; border: solid 1px #33677F; } .idle { border: solid 1px #85b1de; background-image: url( 'gray_bg.png' ); background-repeat: repeat-x; background-position: top; background-color:#FFFFFF; } </style> <script src="jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $("input, textarea").addClass("idle"); $("input, textarea").focus(function(){ $(this).addClass("activeField").removeClass("idle"); }).blur(function(){ $(this).removeClass("activeField").addClass("idle"); }); }); </script> </head> <body> <div id="inputArea"> <form method="post" action="#"> <label>Имя:</label><input type="text" /> <label>E-mail:</label><input type="text" /> <label>Веб-сайт:</label><input type="text" /> <label>Текст комментария:</label><textarea rows="4" cols="30"></textarea> <input type="submit" value="Отправить"></form> </div> </body> </html> Вот что получается а должно получится (на голом HTML все работает как надо скрин ниже, а на Joomle не получается) Помогите пожалуйста, уже 2 день бьюсь
ну ты конечно крут создал непонятно где html файл а jquery спрятал в каталог js и пытаешься непонятно откуда подключить к своему html эту библиотеку в шаблоне библиотека jquery должна лежать в папке самого шаблона в js а её подключение производится вот так Код (PHP): <script language="JavaScript" src="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/js/jquery.js"></script> между тегами Код (html): <head></head> в любом месте
index.php шаблона Код (CODE): <?php /** * @package Gantry Template Framework - RocketTheme * @version 1.5.0 December 1, 2010 * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2010 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only * * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system * */ // no direct access defined( '_JEXEC' ) or die( 'Restricted index access' ); // load and inititialize gantry class require_once('lib/gantry/gantry.php'); $gantry->init(); ?> <!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" xml:lang="<?php echo $gantry->language; ?>" lang="<?php echo $gantry->language;?>" > <head> <script language="JavaScript" src="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/js/jquery.js"></script> <?php $gantry->displayHead(); $gantry->addStyles(array('template.css','joomla.css','typography.css')); ?> </head> <body <?php echo $gantry->displayBodyTag(array('backgroundlevel','bodyLevel')); ?>> <div id="rt-page-surround"> <?php /** Begin Drawer **/ if ($gantry->countModules('drawer')) : ?> <div id="rt-drawer"> <div class="rt-container"> <?php echo $gantry->displayModules('drawer','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Drawer **/ endif; ?> <?php /** Begin Top **/ if ($gantry->countModules('top')) : ?> <div id="rt-top"> <div class="rt-container"> <?php if (controlsDisplay('top')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('top','standard','scroller'); ?> <div class="clear"></div> </div> </div> <?php /** End Top **/ endif; ?> <div id="rt-topbar"></div> <div id="rt-page-background"> <div id="rt-page-background2"> <?php /** Begin Header **/ if ($gantry->countModules('header')) : ?> <div id="rt-header"> <div class="rt-container"> <?php echo $gantry->displayModules('header','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Header **/ endif; ?> <div class="rt-container"> <?php /** Begin Navigation **/ if ($gantry->countModules('navigation')) : ?> <div id="rt-navigation" class="<?php if ($gantry->get('menu-centering')) : ?>centered<?php endif; ?>"><div id="rt-navigation2"><div id="rt-navigation3"> <?php echo $gantry->displayModules('navigation','basic','basic'); ?> <div class="clear"></div> </div></div></div> <?php /** End Navigation **/ endif; ?> <?php /** Begin Sub Navigation **/ if ($gantry->countModules('subnavigation')) : ?> <div id="rt-subnavigation" class="<?php if ($gantry->get('menu-centering')) : ?>centered<?php endif; ?>"> <?php echo $gantry->displayModules('subnavigation','basic','basic'); ?> <div class="clear"></div> </div> <?php /** End Sub Navigation **/ endif; ?> <?php /** Begin Utility **/ if ($gantry->countModules('utility')) : ?> <div id="rt-utility"> <?php echo $gantry->displayModules('utility','standard','standard'); ?> <div class="clear"></div> </div> <?php /** End Utility **/ endif; ?> <?php /** Begin Showcase **/ if ($gantry->countModules('showcase')) : ?> <div class="rt-section-div"></div> <div id="rt-showcase"> <?php if (controlsDisplay('showcase')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('showcase','standard','scroller'); ?> <div class="clear"></div> </div> <?php /** End Showcase **/ endif; ?> <?php if ($gantry->countModules('showcase') and $gantry->countModules('feature')) : ?> <div class="rt-showfeature-div"></div> <?php endif; ?> <?php /** Begin Feature **/ if ($gantry->countModules('feature')) : ?> <div id="rt-feature"> <?php if (controlsDisplay('feature')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('feature','standard','scroller'); ?> <div class="clear"></div> </div> <?php /** End Feature **/ endif; ?> <div id="rt-body-background"> <div id="rt-body-overlay"> <?php /** Begin Main Top **/ if ($gantry->countModules('maintop')) : ?> <div id="rt-maintop"> <?php echo $gantry->displayModules('maintop','standard','standard'); ?> <div class="clear"></div> </div> <?php /** End Main Top **/ endif; ?> <?php /** Begin Breadcrumbs **/ if ($gantry->countModules('breadcrumb')) : ?> <div id="rt-breadcrumbs"> <?php echo $gantry->displayModules('breadcrumb','basic','breadcrumbs'); ?> <div class="clear"></div> </div> <?php /** End Breadcrumbs **/ endif; ?> <?php /** Begin Main Body **/ ?> <?php echo $gantry->displayOrderedMainbody('mainbody','sidebar','standard','standard','standard','standard','standard'); ?> <?php /** End Main Body **/ ?> <?php /** Begin Main Bottom **/ if ($gantry->countModules('mainbottom')) : ?> <div id="rt-mainbottom"> <?php echo $gantry->displayModules('mainbottom','standard','standard'); ?> <div class="clear"></div> </div> <?php /** End Main Bottom **/ endif; ?> </div> </div> <?php /** Begin Bottom **/ if ($gantry->countModules('bottom')) : ?> <div id="rt-bottom"> <?php if (controlsDisplay('bottom')): ?> <div class="controls"><span class="down"></span><span class="up"></span></div> <?php endif; ?> <?php echo $gantry->displayModules('bottom','standard','scroller'); ?> <div class="clear"></div> </div> <?php /** End Bottom **/ endif; ?> </div> </div> <?php /** Begin Footer Section **/ if ($gantry->countModules('footer') or $gantry->countModules('copyright') or $gantry->countModules('debug')) : ?> <div id="rt-footer-surround"> <?php /** Begin Footer **/ if ($gantry->countModules('footer')) : ?> <div class="rt-container"> <div id="rt-footer"> <div class="rt-section-surround"> <div class="rt-row-surround"> <?php echo $gantry->displayModules('footer','standard','standard'); ?> <div class="clear"></div> </div> </div> </div> </div> <?php /** End Footer **/ endif; ?> <?php /** Begin Copyright **/ if ($gantry->countModules('copyright')) : ?> <div id="rt-copyright"> <div class="rt-container"> <?php echo $gantry->displayModules('copyright','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Copyright **/ endif; ?> <?php /** Begin Debug **/ if ($gantry->countModules('debug')) : ?> <div id="rt-debug"> <div class="rt-container"> <?php echo $gantry->displayModules('debug','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** End Debug **/ endif; ?> </div> <?php /** End Footer Section **/ endif; ?> </div> <?php /** Begin Popups **/ echo $gantry->displayModules('popup','popup','popup'); echo $gantry->displayModules('login','login','popup'); /** End Popup s**/ ?> <?php /** Begin Analytics **/ if ($gantry->countModules('analytics')) : ?> <?php echo $gantry->displayModules('analytics','basic','basic'); ?> <?php /** End Analytics **/ endif; ?> </div> </body> </html> <?php $gantry->finalize(); function controlsDisplay($positionStub){ global $gantry; $published = array(); $showControls = false; $positions = $gantry->getPositions($positionStub); foreach($positions as $position){ if ($gantry->countModules($position)) array_push($published, $position); } foreach($published as $position){ if (!$showControls && $gantry->get('scrolling'.$positionStub.'-enabled') && $gantry->countSubPositionModules($position) > 1) $showControls = true; } return $showControls; } ?> HTML страницы Код (CODE): <ul> <li><strong>Антон</strong></li> </ul> <p><strong> </strong></p> <p><span style="text-decoration: underline;"><img src="images/stories/icq.png" border="0" title="ICQ" /></span> <span style="text-decoration: underline;">123456</span></p> <p><strong><img src="images/stories/skype.png" border="0" title="Skype" /> </strong><span style="text-decoration: underline;">Name 1</span></p> <p><a href="mailto:info@domen.ru">info@domen.ru</a></p> <p><span style="text-decoration: underline;">+7 495 425-95-96</span></p> <ul> <li><strong>Александр</strong></li> </ul> <p><strong> </strong></p> <p><img src="images/stories/icq.png" border="0" title="ICQ" /> <span style="text-decoration: underline;">123456</span></p> <p><a href="mailto:info@domen.ru">info@domen.ru</a></p> <p><span style="text-decoration: underline;">+7 495 569-95-96 </span></p> <!-- body { font-family: Arial, Sans-Serif; font-size: 13px; } #inputArea { font-family: Arial, Sans-Serif; font-size: 13px; background-color: #d6e5f4; padding: 10px; width:310px; } #inputArea input, #inputArea textarea { font-family: Arial, Sans-Serif; font-size: 13px; margin-bottom: 5px; display: block; padding: 4px; width: 300px; } .activeField { background-image: none; background-color: #ffffff; border: solid 1px #33677F; } .idle { border: solid 1px #85b1de; background-image: url( 'gray_bg.png' ); background-repeat: repeat-x; background-position: top; background-color:#FFFFFF; } --> <script src="jquery.js" type="text/javascript"></script> <script type="text/javascript">// <![CDATA[ $(document).ready(function(){ $("input, textarea").addClass("idle"); $("input, textarea").focus(function(){ $(this).addClass("activeField").removeClass("idle"); }).blur(function(){ $(this).removeClass("activeField").addClass("idle"); }); }); // ]]></script> <div id="inputArea"><form action="#" method="post"> <label>Имя:</label><input type="text" /> <label>E-mail:</label><input type="text" /> <label>Веб-сайт:</label><input type="text" /> <label>Текст комментария:</label><textarea cols="30" rows="4"></textarea> <input type="submit" value="Отправить" /></form></div> Все равно форма обратной связи отображается как на первом скрине. А нужно как на 2-ом. Папку js в папке шаблона создал в нее кинул файл jquery.js В чем ошибка?