Members: 16,996
Threads: 38,846
Posts: 159,391
Online: 22

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 22.02.2005, 18:11   #1 (permalink)
Baby Mamber
 
Join Date: Feb 2005
Posts: 22
rickylau is on a distinguished road
Default Main body

What is the name of the module position for the main body? Is there any way to get the count on the main body like you can with modules with mosCountModules? I am trying to display the mosMainBody() only if there is anything in the main body, if its possible.
rickylau is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Old 22.02.2005, 18:26   #2 (permalink)
Mamber
 
august's Avatar
 
Join Date: Aug 2004
Location: Oppland, Norway, Europe
Posts: 99
august is on a distinguished road
Default Re: Main body

The mainbody is no module position, but it is the mainbody..
__________________
August Lilleaas
august is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 22.02.2005, 19:14   #3 (permalink)
Baby Mamber
 
Join Date: Feb 2005
Posts: 22
rickylau is on a distinguished road
Default Re: Main body

So, is there any way to tell if there is anything inside the mainbody? I know its a weird question, since there should always be something in the mainbody, but I am trying to make a front page with all modules and no main body, so I need to know in the template if the mainbody has anything before calling it.

Thanks
rickylau is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 22.02.2005, 21:03   #4 (permalink)
Professional Mamber
 
zorkhh's Avatar
 
Join Date: Apr 2004
Location: Northern Germany
Posts: 713
zorkhh is on a distinguished road
Default Re: Main body

Hello,

check this one:

if ($GLOBALS['_MOS_OPTION']['buffer']) {
// mainbody has content
}

hth

ZorkHH
__________________
News and stories around Joomla! PlanetJoomla.com
For individual Joomla-AddOns visit Joomlaexpert.com
zorkhh is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 22.02.2005, 23:07   #5 (permalink)
Baby Mamber
 
Join Date: Feb 2005
Posts: 22
rickylau is on a distinguished road
Default Re: Main body

I tried echoing $GLOBALS['_MOS_OPTION']['buffer'] and I get the 'There are no items to display' string, so the code

if($GLOBALS['_MOS_OPTION']['buffer'])

does not return false even if there is no item in the mainbody, so is there another way to find out if body is empty? Or just point me to where the message 'There are no items to display' is set on $GLOBALS['_MOS_OPTION']['buffer'].

Thanks
rickylau is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 22.02.2005, 23:14   #6 (permalink)
Professional Mamber
 
zorkhh's Avatar
 
Join Date: Apr 2004
Location: Northern Germany
Posts: 713
zorkhh is on a distinguished road
Default Re: Main body

Hi,

$GLOBALS['_MOS_OPTION']['buffer'] is the variable, where the maincontent is "in". That's what you wanted to know... I don't know, what you mean, when you say "anything inside the mainbody".

So, what is it, you want to check for?!?

ZorkHH
__________________
News and stories around Joomla! PlanetJoomla.com
For individual Joomla-AddOns visit Joomlaexpert.com
zorkhh is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 22.02.2005, 23:50   #7 (permalink)
Baby Mamber
 
Join Date: Feb 2005
Posts: 22
rickylau is on a distinguished road
Default Re: Main body

I think I figured it out. I just created I new global variable if the main body is empty. Basically its hacked to get it to work.

To zorkhh, the thing I was trying to do was to determine if there is content when I call the mosMainBody() function, instead of getting the output 'There are no items to display' becuase I did not put anything in the front page. So now I only call mosMainBody() when there are items to display.

Thanks for the help though.
rickylau is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 03.04.2005, 01:57   #8 (permalink)
Baby Mamber
 
Join Date: Apr 2005
Posts: 1
duforudesign is on a distinguished road
RedCross Re: Main body

Quote:
Originally Posted by rickylau
I think I figured it out. I just created I new global variable if the main body is empty. Basically its hacked to get it to work.

To zorkhh, the thing I was trying to do was to determine if there is content when I call the mosMainBody() function, instead of getting the output 'There are no items to display' becuase I did not put anything in the front page. So now I only call mosMainBody() when there are items to display.

Thanks for the help though.
I use the following dirty hack:

Code:
if (!substr_count($GLOBALS['_MOS_OPTION']['buffer'],"no items "))
{
	mosMainBody(); 
} else {
	mosLoadModules("user5"); 
}
duforudesign is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 22.08.2005, 22:47   #9 (permalink)
Baby Mamber
 
Join Date: Jul 2005
Posts: 10
enandret is on a distinguished road
Default Re: Main body

Sorry if I write to you but I have your same problem!!

I use mambo 4.5.2 and I would like not visualize the mainbody when its is empty or in my case is the same doesn't visualize mainbody in homepage .

How can I do???

Thanks for all suggestion.

Enzo
enandret is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 18.05.2006, 18:37   #10 (permalink)
Baby Mamber
 
Join Date: May 2006
Posts: 1
greensweater is on a distinguished road
Default Re: Main body

Late follow up, but I found this page looking for the solution so I'm posting this...

To hide this on the front page (but keep it inside on empty blog pages) put this in your template where the mosMainBody() function is called (I included a DIV for styling):

Code:
<?php if(!($option == com_frontpage && ereg(_EMPTY_BLOG,$GLOBALS['_MOS_OPTION']['buffer']) !== FALSE )) { ?>
<div class='mainbody'>
  <?php mosMainBody(); ?>
</div>
<?php } ?>
As long as your body doesn't contain the exact phrase "There are no items to display" or whatever you set it to in your language file, this will work.
greensweater is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Main Menu Hack... Anyone have an idea about this? Thanks! meek Module 'How Do I' Questions 1 27.02.2005 01:41
Probleme mit zOOm Media Gallery Suby Komponenten 2 18.01.2005 20:27
3 Level deep Main menu thomas9 Mambo 4.5.1 'How Do I' Questions 4 15.12.2004 00:33
warning, main body errors. pls help. skope Module 'How Do I' Questions 2 26.10.2004 03:04
linking direct from main menu to main body mikeh1980 Mambo 4.5 'How Do I' Questions 7 17.06.2004 16:52


All times are GMT +2. The time now is 05:33.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.