|
|
Members: 10,140
Threads: 38,830
Posts: 159,367
Online: 41
Newest Member:
Xoote |
|
|
|
 |
 |
|
 |
22.02.2005, 17:11
|
#1
|
|
Baby Mamber
Join Date: Feb 2005
Posts: 22
|
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.
|
|
|
22.02.2005, 17:26
|
#2
|
|
Mamber
Join Date: Aug 2004
Location: Oppland, Norway, Europe
Posts: 99
|
Re: Main body
The mainbody is no module position, but it is the mainbody..
|
|
|
22.02.2005, 18:14
|
#3
|
|
Baby Mamber
Join Date: Feb 2005
Posts: 22
|
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
|
|
|
22.02.2005, 20:03
|
#4
|
|
Professional Mamber
Join Date: Apr 2004
Location: Northern Germany
Posts: 713
|
Re: Main body
Hello,
check this one:
if ($GLOBALS['_MOS_OPTION']['buffer']) {
// mainbody has content
}
hth
ZorkHH
|
|
|
22.02.2005, 22:07
|
#5
|
|
Baby Mamber
Join Date: Feb 2005
Posts: 22
|
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
|
|
|
22.02.2005, 22:14
|
#6
|
|
Professional Mamber
Join Date: Apr 2004
Location: Northern Germany
Posts: 713
|
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
|
|
|
22.02.2005, 22:50
|
#7
|
|
Baby Mamber
Join Date: Feb 2005
Posts: 22
|
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.
|
|
|
03.04.2005, 00:57
|
#8
|
|
Guest
|
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");
}
|
|
|
|
22.08.2005, 21:47
|
#9
|
|
Baby Mamber
Join Date: Jul 2005
Posts: 10
|
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
|
|
|
18.05.2006, 17:37
|
#10
|
|
Guest
|
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.
|
|
|
|
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 12:31.
|
|
|
|