1
BentFX
homepage content block
  • 2008/1/4 8:42

  • BentFX

  • Just popping in

  • Posts: 9

  • Since: 2007/12/26


Can I add content to the default content block on the homepage. By default it has the Site name / Slogan for your site as set in general preferences. I simply want to add static content to that block, not install more modules, or create custom blocks.

Yes or No... can it be done?

2
script_fu
Re: homepage content block

The short answer... No

You must add at least a custom block or a module to display any custom content on the home page.

3
script_fu
Re: homepage content block

I know this is not what you asked for.

However you can add custom pages that the XOOPS default search feature will not pick up.

if (file_exists("mainfile.php")) {  
    include(
"mainfile.php");  
}  
elseif(
file_exists("../mainfile.php")) {  
    include(
"../mainfile.php");  
}  
else {  
    include(
"../../mainfile.php");  
}  
include(
XOOPS_ROOT_PATH "/header.php");  
$xoopsTpl->assign('xoops_showrblock'1); // 1 to display right blocks, 0 to hide  
$xoopsTpl->assign('xoops_showlblock'1); // 1 to display left blocks , 0 to hide 
///////  
echo "Your code";  
///////  
include(XOOPS_ROOT_PATH "/footer.php");  
?>



Related posts

4
BentFX
Re: homepage content block
  • 2008/1/4 9:08

  • BentFX

  • Just popping in

  • Posts: 9

  • Since: 2007/12/26


Thanks for the quick reply...

So I assume that in order to remove that empty block I must set another module as the home page?

It would be no big thing, except the theme I've just written makes it very obvious that block is EMPTY!

5
script_fu
Re: homepage content block

Quote:

BentFX wrote:
Thanks for the quick reply...


No problem

Quote:

So I assume that in order to remove that empty block I must set another module as the home page?


Your wording is off just a lil. Its not an empty block your looking at. Its just the home page with no content added. When you do add content from blocks admin then the homepage would be showing either a module block, system block or custom block or combination of the three. You can add as many of these blocks on the front page as you wish.

As you add more and more blocks your site will slow down make sure you cache the blocks some. But thats another topic...

Quote:

It would be no big thing, except the theme I've just written makes it very obvious that block is EMPTY!


You could use the "set module as homepage" to give you a url of yourdomain/modules/yourmodule so content will show.

In blocks admin you can see each block that a module can display. Its better to use that and display the content from the module blocks on the home page or in other module pages that you wish. So you have a proper url of yourdomain.com with content displayed.

I hope that makes sense...

Edit to better clarify please read again.

6
BentFX
Re: homepage content block
  • 2008/1/4 9:52

  • BentFX

  • Just popping in

  • Posts: 9

  • Since: 2007/12/26


Yeah, I'm with you all the way there. I understand about using blocks administration.

My issue is about my theme, and the empty brackets under that "Site name / Slogan for your site" block.

In the theme.html there is code which adds title and content for each page... news, forum, etc.

The other pages all look fine in my theme. But given how the theme displays blocks, that block looks out of place... it has no content!

I can and will add blocks to the main page, yet that block will still be there, unless I script a way to hide it in theme.html.

Again thanks for the quick reply, and for your input.

Yet my problem remains... the "Site name / Slogan for your site" block is visually distracting. Because it is a block with no content!

7
Will_H
Re: homepage content block
  • 2008/1/4 11:49

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


sounds like your module content has graphic borders. idk, a link would help to assure we all know what you are talking about.

However, if you just want to get rid of that if there is no module content to display you need to wrap the content loop in an if statement.

8
script_fu
Re: homepage content block

I think I understand what your asking for now...

Look for <{$xoops_sitename}> - <{$xoops_pagetitle}> - <{$xoops_slogan}> inside the body tags of your theme.html. You can remove the code and that content will be gone. You can also put any content you want into your theme at that location and it will display on every page.

I hope this solves the problem.

9
BentFX
Re: homepage content block
  • 2008/1/4 20:54

  • BentFX

  • Just popping in

  • Posts: 9

  • Since: 2007/12/26


Thanks for all the input ScriptFu!

Without talking it out here I don't think we'd have come onto the answer...

Simply wrap the content portion of theme.html in...
<{if $xoops_contents}>
code here
<{/if}>


That supresses the contents block on any page that doesn't have it's own content.

Problem solved!!!

Thanks again for you timely responses, and effort!

Skip

[edit]
changed 'custom content' to 'its own content'
better verbology
[/edit]

10
script_fu
Re: homepage content block

Quote:

BentFX wrote:


<{if $xoops_contents}>
code here
<{/if}>




Will and Chris having a discussion.

<{if $xoops_contents}>
<
div id="content">
<{
$xoops_contents}>
div>
<{/if}>

Login

Who's Online

350 user(s) are online (69 user(s) are browsing Support Forums)


Members: 0


Guests: 350


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits