-
AuthorPosts
-
saco721 Friend
saco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 6, 2015 at 1:35 pm #206132I was wondering how I would go about placing a search bar in my main menu, here is a screen shot:
thanks for your time!
saco721 Friendsaco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 6, 2015 at 3:58 pm #569660Hi,
I am part of the way to getting the search bar in the horizontal menu, I have installed RokCandy, but I get two search bars instead of one, and nothing happens when I press enter. I then tried Modules Anywhere and get exactly the same result, please see screenshot :
Thank you for your time!
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 7, 2015 at 2:36 am #569707You should check these 3rd party search extension with default Joomla template first to make sure that it works properly.
saco721 Friendsaco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 12, 2015 at 2:22 pm #570327Hey Saguaros,
OK, I have checked the both Modules Anywhere and Rokcandy with other joomla templates and the search bar appears in the correct place and works as it should.
I was wondering how to add a search bar to a menu without using 3rd party extension?. Thanks for your time!
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 13, 2015 at 6:06 am #570399You will need to create a new module position and add custom style for it.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 13, 2015 at 6:06 am #735465You will need to create a new module position and add custom style for it.
saco721 Friendsaco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 13, 2015 at 3:41 pm #570460Hey Saguaros,
Firstly, something I should have mentioned is that I have installed joomla 3.2.1 with JA_T3_Blank template.
I am new to modifying the ja purity iii template, so please be patient, I have looked for tutorials that explain how to create a new module position and have found a few but they are quite difficult for me to understand, I have managed to add a new module position by adding the following code to default.php
<jdoc:include type="modules" name="<?php $this->_p('newmod') ?>" />
I then add :
<position>newmod</position>
to templateDetails.xml
I can select the new module position in the module manager, but it doesn’t do anything, how do I assign the new module position to a block?. Are there any tutorials that describe this process.
Your help is greatly appreciated, thanks!.
saco721 Friendsaco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 13, 2015 at 3:41 pm #735524Hey Saguaros,
Firstly, something I should have mentioned is that I have installed joomla 3.2.1 with JA_T3_Blank template.
I am new to modifying the ja purity iii template, so please be patient, I have looked for tutorials that explain how to create a new module position and have found a few but they are quite difficult for me to understand, I have managed to add a new module position by adding the following code to default.php
<jdoc:include type="modules" name="<?php $this->_p('newmod') ?>" />
I then add :
<position>newmod</position>
to templateDetails.xml
I can select the new module position in the module manager, but it doesn’t do anything, how do I assign the new module position to a block?. Are there any tutorials that describe this process.
Your help is greatly appreciated, thanks!.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 14, 2015 at 8:29 am #570527Hope this tips can help you: http://www.joomlart.com/forums/topic/how-to-create-a-new-module-position-6/
saco721 Friendsaco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 19, 2015 at 3:11 pm #571112Hey Saguaros,
Great tutorial, Thanks for your help!, from the info in the example, I can add a search bar to the logo, using the code below :
[PHP]
* JA Teline IV Template for Joomla 2.5
* ————————————————————————
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license – Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* This file may not be redistributed in whole or significant part.
* ————————————————————————
*/
// no direct access
defined ( ‘_JEXEC’ ) or die ( ‘Restricted access’ );?>
<?php
$app = & JFactory::getApplication();
$siteName = $app->getCfg(‘sitename’);
if ($this->getParam(‘logoType’, ‘image’)==’image’): ?>
<h1 class=”logo”>
<a href=”index2.php” title=”<?php echo $siteName; ?>”><span><?php echo $siteName; ?></span></a>
</h1><?php else:
$logoText = (trim($this->getParam(‘logoText’))==”) ? $siteName : JText::_(trim($this->getParam(‘logoText’)));
$sloganText = JText::_(trim($this->getParam(‘sloganText’))); ?>
<div class=”logo-text”>
<h1><a href=”index.php” title=”<?php echo $siteName; ?>”><span><?php echo $logoText; ?></span></a></h1>
<p class=”site-slogan”><span><?php echo $sloganText;?></span></p>
</div><?php endif; ?>
<div class=”my_new_search_pos”>
<jdoc:include type=”modules” name=”my_new_search_pos” />
</div>
[/PHP]i’m almost there, but how do I define top.mainnav, where my_new_search_pos should go?
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 20, 2015 at 2:25 am #571166What do you mean by ‘define top.mainnav’ here?
If you already added position ‘my_new_search_pos’, you then can assign the search module to this new position and add CSS style for it if needed.
saco721 Friendsaco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 20, 2015 at 3:38 pm #571239Hey Saguaros,
Sorry, top.mainnav is the module position for the menu that I want to add the search bar to. I get the position using http://www.mydomain.com/?tp=1. Please see screenshot :
In the example, it uses the file templatesja_teline_ivblocksheader.php, In the JA_T3_Blank – Default template, this file did not exist so I had to create a new file, templatesja_t3_blankblocksheader.php. This new file looks like this :
[PHP]
* JA Teline IV Template for Joomla 2.5
* ————————————————————————
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license – Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* This file may not be redistributed in whole or significant part.
* ————————————————————————
*/
// no direct access
defined ( ‘_JEXEC’ ) or die ( ‘Restricted access’ );?>
<?php
$app = & JFactory::getApplication();
$siteName = $app->getCfg(‘sitename’);
if ($this->getParam(‘logoType’, ‘image’)==’image’): ?>
<h1 class=”logo”>
<a href=”index2.php” title=”<?php echo $siteName; ?>”><span><?php echo $siteName; ?></span></a>
</h1><?php else:
$logoText = (trim($this->getParam(‘logoText’))==”) ? $siteName : JText::_(trim($this->getParam(‘logoText’)));
$sloganText = JText::_(trim($this->getParam(‘sloganText’))); ?>
<div class=”logo-text”>
<h1><a href=”index.php” title=”<?php echo $siteName; ?>”><span><?php echo $logoText; ?></span></a></h1>
<p class=”site-slogan”><span><?php echo $sloganText;?></span></p>
</div><?php endif; ?>
<div class=”eden_pos”>
<jdoc:include type=”modules” name=”eden_pos” />
</div>
[/PHP]The eden_pos module position, places the search bar in the logo. See screenshot :
I want to place the search bar in module position top.mainnav thats between top.header and top.topsl1 module positions, I think the code may look something like :
[PHP]
<?php
/*
* ————————————————————————
* JA Teline IV Template for Joomla 2.5
* ————————————————————————
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license – Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* This file may not be redistributed in whole or significant part.
* ————————————————————————
*/
// no direct access
defined ( ‘_JEXEC’ ) or die ( ‘Restricted access’ );?>
<?php
$app = & JFactory::getApplication();
$siteName = $app->getCfg(‘sitename’);
if ($this->getParam(‘logoType’, ‘image’)==’image’): ?>
<h1 class=”logo”>
<a href=”index2.php” title=”<?php echo $siteName; ?>”><span><?php echo $siteName; ?></span></a>
</h1><?php else:
$logoText = (trim($this->getParam(‘logoText’))==”) ? $siteName : JText::_(trim($this->getParam(‘logoText’)));
$sloganText = JText::_(trim($this->getParam(‘sloganText’))); ?>
<div class=”logo-text”>
<h1><a href=”index.php” title=”<?php echo $siteName; ?>”><span><?php echo $logoText; ?></span></a></h1>
<p class=”site-slogan”><span><?php echo $sloganText;?></span></p>
</div><?php endif; ?>
<div class=”top.header”>
<jdoc:include type=”modules” name=”top.header” />
</div>
<div class=”eden_pos”>
<jdoc:include type=”modules” name=”eden_pos” />
</div>
<div class=”top.topsl1″>
<jdoc:include type=”modules” name=”top.topsl1″ />
</div>[/PHP]
But doesn’t work. I hope i’m making sense about what i’m trying to do. Is there an equivalent file in ja_t3_blank that contains all module positions like templatesja_teline_ivblocksheader.php?.
Thanks very much for your time!.
- saco721 Friend
saco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 20, 2015 at 3:38 pm #736287Hey Saguaros,
Sorry, top.mainnav is the module position for the menu that I want to add the search bar to. I get the position using http://www.mydomain.com/?tp=1. Please see screenshot :
In the example, it uses the file templatesja_teline_ivblocksheader.php, In the JA_T3_Blank – Default template, this file did not exist so I had to create a new file, templatesja_t3_blankblocksheader.php. This new file looks like this :
* JA Teline IV Template for Joomla 2.5
* ------------------------------------------------------------------------
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license - Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* This file may not be redistributed in whole or significant part.
* ------------------------------------------------------------------------
*/
// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );?>
<?php
$app = & JFactory::getApplication();
$siteName = $app->getCfg('sitename');
if ($this->getParam('logoType', 'image')=='image'): ?>
<h1 class="logo">
<a href="index2.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</h1><?php else:
$logoText = (trim($this->getParam('logoText'))=='') ? $siteName : JText::_(trim($this->getParam('logoText')));
$sloganText = JText::_(trim($this->getParam('sloganText'))); ?>
<div class="logo-text">
<h1><a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a></h1>
<p class="site-slogan"><span><?php echo $sloganText;?></span></p>
</div><?php endif; ?>
<div class="eden_pos">
<jdoc:include type="modules" name="eden_pos" />
</div>
The eden_pos module position, places the search bar in the logo. See screenshot :
I want to place the search bar in module position top.mainnav thats between top.header and top.topsl1 module positions, I think the code may look something like :
<?php
/*
* ------------------------------------------------------------------------
* JA Teline IV Template for Joomla 2.5
* ------------------------------------------------------------------------
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license - Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* This file may not be redistributed in whole or significant part.
* ------------------------------------------------------------------------
*/
// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );?>
<?php
$app = & JFactory::getApplication();
$siteName = $app->getCfg('sitename');
if ($this->getParam('logoType', 'image')=='image'): ?>
<h1 class="logo">
<a href="index2.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</h1><?php else:
$logoText = (trim($this->getParam('logoText'))=='') ? $siteName : JText::_(trim($this->getParam('logoText')));
$sloganText = JText::_(trim($this->getParam('sloganText'))); ?>
<div class="logo-text">
<h1><a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a></h1>
<p class="site-slogan"><span><?php echo $sloganText;?></span></p>
</div><?php endif; ?>
<div class="top.header">
<jdoc:include type="modules" name="top.header" />
</div>
<div class="eden_pos">
<jdoc:include type="modules" name="eden_pos" />
</div>
<div class="top.topsl1">
<jdoc:include type="modules" name="top.topsl1" />
</div>But doesn’t work. I hope i’m making sense about what i’m trying to do. Is there an equivalent file in ja_t3_blank that contains all module positions like templatesja_teline_ivblocksheader.php?.
Thanks very much for your time!.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 21, 2015 at 3:34 am #571309I’m afraid that’s not the correct way.
You should take a look at this documentation to know more about module positions and blocks: http://www.joomlart.com/documentation/wiki-ja-t3v2-joomla-2-5/developer-guide#Layouts
The block will hold module positions so in this case, blocks like ‘header, mainnav, topsl1’ are different, if you want to re-order the module position, you can only change module position order within that block.
You can try with my tweak here:
Create a block called ‘custom’: ROOT/templates/ja_t3_blank (your default template)/blocks/custom.php
This ‘custom’ block contains your new ‘eden_pos‘ position so you can load this position as below:
<?php
// No direct access
defined('_JEXEC') or die;
?>
<?php if($this->countModules('eden_pos')) : ?>
<div class="eden_pos">
<jdoc:include type="modules" name="eden_pos" />
</div>
<?php endif; ?>
In order to have this ‘eden_pos’ module placed between ‘header’ and ‘topsl1’ module, you will need to place this block between the mainnav and topsl1 block. Just go to backend > Extensions > Template manager > JA T3 Blank (your default template) > Layout tab > Default >>> click ‘Edit‘ button, add block as below:
<?xml version="1.0" encoding="utf-8"?>
<layout name="desktop">
<!--Extra css load for this layout-->
<stylesheets>
</stylesheets>
<blocks name="top" style="xhtml">
<block name="absolute" type="modules" style="raw">absolute</block>
<block name="top-panel" type="modules" style="raw" main-inner="1">top-panel</block>
<block name="header" type="header" main-inner="1"></block>
<block name="mainnav" type="mainnav" main-inner="1"></block>
<block name="custom" type="custom" main-inner="1"></block>
<block name="cpanel" type="usertools/cpanel"></block>
<block name="topsl1" type="spotlight" special="left" specialwidth="70">sl1-l,sl1-r</block>
<block name="topsl3" type="spotlight" special="left" specialwidth="70">sl1-l1,sl1-r1</block>
.....................................................
Then you can simply assign your desired module to this ‘eden_pos’ position > Clear JAT3 cache in backend and it will show in front-end.
-
1 user says Thank You to Saguaros for this useful post
saco721 Friendsaco721
- Join date:
- February 2014
- Posts:
- 58
- Downloads:
- 0
- Uploads:
- 18
- Thanks:
- 14
- Thanked:
- 1 times in 1 posts
May 26, 2015 at 8:46 pm #571824Hey Saguaros,
search bar is now in correct place and working perfectly :), thank you so much for your time!,
best wishes,
Saco.
AuthorPostsThis topic contains 16 replies, has 2 voices, and was last updated by saco721 9 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum