Have you ever want your frontpage articles not shown up on the frontpage as you already have a module like Minifrontpage or BreakingNews for the articles presentation? I believe you do and you give it a try by setting up the Home Menu Item parameters or by deselect all frontpage articles from the Frontpage Manager. It works but you get this warning message on your frontpage - No Items to display....

I've just read this article on How to remove No Items to display warning tips from Joomla Panel.

This solution is only partially fixed the issue. There's another one. If our mainbody or component page is 'wrapped' around with some kind of border - rounded or not, then this border will still in there if we don't make any condition to be checked whether there's a component output or not. So, depends on your template design, find what's the css definition for this component wrapper.

Read on for some example...

As an example here, I will take a code from one of TP's collection - estore plazza - which has a rounded corner wrapped it's mainbody or component section.

<!-- MAINBODY started here -->
<div id="roundwrapper">
<?php if($this->params->get('showComponent')) : ?>
<div class="roundtopleft">
<span class="sfix"></span>
</div>
<div class="roundcontent">
<jdoc:include type="component" />
</div>
<div class="roundbottomleft">
<span class="sfix"></span>
</div>
<?php endif; ?>
</div> <!-- end roundwrapper -->

I think this template tried to provide an option to show or not component output on Home menu item, but obviously it will only make all component output not shown up everywhere.

Here's what it'll looks like when there's no contents or no warning for empty blog.

 

 

 

 

 

 

 

so the solution is that we need to make another condition to check to remove this rounded border.
As we only need to hide the frontpage articles on the 'Home' menu item which is we know that this Home menu item has a non-sef URL in this form http://your-site/index.php?option=com_content&view=frontpage&Itemid=1, then we can get a variable from this URL as our condition checking, in this case we can choose the view variable.

frontpage non sef url format

Here's how to get a variable from the URL,

 

$view =& JRequest::getVar('view');

 

Then we need to check whether this view variable is contain the 'frontpage' keyword.

 

<?php if ($view=='frontpage') {
// then dont show the component wrapper
}
?>

 

So, for the eStore plazza case, the code will looks like this,

 

<!-- MAINBODY started here -->
<?php

// place the line below before the head tag of the template
$view =& JRequest::getVar('view');

// mainbody / component section start here
// if menu choosen is not afrontpage or Home menu then show the wrapper
// else leave it empty
if ( $view!='frontpage') :
?>
<div id="roundwrapper">
<div class="roundtopleft"><span class="sfix"> </span></div>
<div class="roundcontent">
<jdoc:include type="component" />
</div>
<div class="roundbottomleft">
<span class="sfix"> </span>
</div>

</div> <!-- end roundwrapper -->
<?php endif; ?>

 

The result is will look like this image below,

component wrapper is gone on the frontpage

Try it with your site template and see if that works too. Not so idiot's trick, isn't it?

 

Hire Me

  • Email: erwin [at] joomla-labs.com
  • Skype: anginudara
  • Yahoo: rwin_schro

Blogroll

Do not pay retail prices: cheap coach handbag Save up to 80%
Women
Custom Joomla Template by J!Labs.
The Joomla (TM) name is used under a limited license from Open Source Matters the worldwide trademark holder.
Create an account
Contact
Login

Login



Register

Create an account

Question

Contact