Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • larenz Friend
    #145913

    Hello again! I was looking for a code who disables the breadcrumbs menu on frontpage. I´ve seen in other of your templates you do. Was testing with one code but it doesn´t work. This is the error:


    Fatal error: Call to a member function isFrontPage() on a non-object in C:xampphtdocscomtech.com.nitemplatescomtechv2layoutsblocksmainnav.php on line 19

    I was thinking this code doesn´t works because of your framework, maybe it causes some incompatibilities.

    I know you may be wondering why is at the file mainnav.php on line 19, its due I added breadcrumbs in there. This is what I did:

    [php]
    <div id=”ja-mainnav” class=”claro”>
    <div class=”main clearfix”>
    <?php if (($jamenu = $this->loadMenu())) $jamenu->genMenu (0); ?>
    </div>
    </div>

    <?php if ($this->hasSubmenu() && ($jamenu = $this->loadMenu())) : ?>
    <div id=”ja-subnav” class=”wrap”>
    <div class=”main clearfix”>
    <?php $jamenu->genMenu (1); ?>
    </div>
    </div>
    <?php endif;?>

    <ul class=”no-display”>
    <li><a href=”<?php echo $this->getCurrentURL();?>#ja-content” title=”<?php echo JText::_(“Skip to content”);?>”><?php echo JText::_(“Skip to content”);?></a></li>
    </ul>

    <?php if(!$tmpTools->isFrontPage()) : ?>
    <div class=”ja-navhelper wrap”>
    <div class=”main clearfix”>

    <div class=”ja-breadcrums”>
    <strong>Usted está aquí:</strong> <jdoc:include type=”module” name=”breadcrumbs” />
    </div>

    <ul class=”ja-links”>
    <li class=”layout-switcher”><?php $this->loadBlock(‘usertools/layout-switcher’) ?> </li>
    <li class=”top”><a href=”#top”>Ir Arriba</a></li>
    </ul>

    <ul class=”no-display”>
    <li><a href=”<?php echo $this->getCurrentURL();?>#ja-content” title=”<?php echo JText::_(“Skip to content”);?>”><?php echo JText::_(“Skip to content”);?></a></li>
    </ul>

    </div>
    </div>
    <?php endif ; ?>
    [/php]

    I hope you can help to disable breadcrumbs only in frontpage.

    larenz Friend
    #323143

    Me again… but now I´m gonna share with you a “temporal” solution (because I don´t know if the code is right due I´m not php understanding) of showing or not breadcrumbs in frontpage. Take a look at the code I was using before:

    [php]
    <?php if(!$tmpTools->isFrontPage()) : ?>
    <div class=”ja-navhelper wrap”>
    <div class=”main clearfix”>

    <div class=”ja-breadcrums”>
    <strong>Usted está aquí:</strong> <jdoc:include type=”module” name=”breadcrumbs” />
    </div>

    <ul class=”ja-links”>
    <li class=”top”><a href=”#top”>Ir Arriba</a></li>
    </ul>

    </div>
    </div>
    <?php endif ; ?>
    [/php]

    With the code above it showed me an error. But touching some lines I edited the code as it follows:

    [php]
    <?php if((!$tmpHelper = $this->isFrontPage())) : ?>

    <?php endif; ?>
    [/php]

    Now with the complete code modification:

    [php]
    <?php if((!$tmpHelper = $this->isFrontPage())) : ?>
    <div class=”ja-navhelper wrap”>
    <div class=”main clearfix”>

    <div class=”ja-breadcrums”>
    <strong>Usted está aquí:</strong> <jdoc:include type=”module” name=”breadcrumbs” />
    </div>

    <ul class=”ja-links”>
    <li class=”top”><a href=”#top”>Ir Arriba</a></li>
    </ul>

    </div>
    </div>
    <?php endif ; ?>
    [/php]

    Curiously if I use <?php if((!$tmpHelper = $this->isFrontPage())) : ?> or <?php if((!$tmpTools = $this->isFrontPage())) : ?> or even <?php if((!$helper = $this->isFrontPage())) : ?> it works anyway.

    Why? The fact is I don´t know because I can´t understand (for now) about php, I mean I don´t know nothing about php but sometimes I get a solution from this way, touching over there, refreshing, seen changes, etc….

    Due anyone could help or didn´t write nothing I decided to post the way I fixed.

    PD: Once again sorry for my english because I´m from Nicaragua and we speak spanish.

    korb Friend
    #323360

    The correct isFrontpage function call is this <?php if(!$this->isFrontPage()) : ?> . Example:


    <?php if(!$this->isFrontPage()) : ?>

    <div class="ja-navhelper main">
    <div class="main clearfix">
    <div class="ja-breadcrums">
    <strong><?php echo JText::_('You are here')?></strong> <jdoc:include type="module" name="breadcrumbs" />
    </div>
    <ul class="ja-links">
    <li class="layout-switcher"><?php $this->loadBlock('usertools/layout-switcher') ?> </li>
    <li class="top"><a href="<?php echo $this->getCurrentURL();?>#Top" title="Back to Top">Top</a></li>
    </ul>

    <ul class="no-display">
    <li><a href="<?php echo $this->getCurrentURL();?>#ja-content" title="<?php echo JText::_("Skip to content");?>"><?php echo JText::_("Skip to content");?></a></li>
    </ul>

    </div>
    </div>
    <?php endif ; ?>

    jhonathan Friend
    #326881

    Thanks lorenz and korb, it was just what I was looking for. 🙂
    I don’t undestand so good, both of codes works fine but second is more clear.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 3 voices, and was last updated by  jhonathan 14 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum