test
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • saco721 Friend
    #206132

    I was wondering how I would go about placing a search bar in my main menu, here is a screen shot:

    thanks for your time!


    1. search
    saco721 Friend
    #569660

    Hi,

    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!


    1. s2
    Saguaros Moderator
    #569707

    You should check these 3rd party search extension with default Joomla template first to make sure that it works properly.

    saco721 Friend
    #570327

    Hey 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 Moderator
    #570399

    You will need to create a new module position and add custom style for it.

    Saguaros Moderator
    #735465

    You will need to create a new module position and add custom style for it.

    saco721 Friend
    #570460

    Hey 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 Friend
    #735524

    Hey 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 Moderator
    #570527
    saco721 Friend
    #571112

    Hey 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 Moderator
    #571166

    What 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 Friend
    #571239

    Hey 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!.


    1. pic
    2. pic2
    3. pic3
    saco721 Friend
    #736287

    Hey 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 Moderator
    #571309

    I’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. addBlock
    saco721 Friend
    #571824

    Hey Saguaros,

    search bar is now in correct place and working perfectly :), thank you so much for your time!,

    best wishes,

    Saco.

Viewing 15 posts - 1 through 15 (of 16 total)

This 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