xoops forums

djlowes

Just popping in
Posted on: 2009/7/6 3:17
djlowes
djlowes (Show more)
Just popping in
Posts: 20
Since: 2009/6/29
#1

Adding a custom page

Hi,

I am a newbie to XOOPS and the programming world. My question involves adding a custom page that isn't a module, or do all pages need to be modules? I can't seem to get my head around this.

Currently, I have a forum, blog, news and 'my profile' modules acting dynamically on the left hand side of my page. I also have buttons for 6 pages that I wish to act statically up the top of the page, but my problem is, I don't know how to link them and integrate them into xoops.

I read on a separate file that someone used the coding -

<?php
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); // display right blocks
$xoopsTpl->assign('xoops_showlblock', 0); // display right blocks
?>
<p>my html content here</p>
<?php
include(XOOPS_ROOT_PATH . "/footer.php");
?>

However I'm not sure that applies to what I want to do or even where to put that coding if it does.

Any help would be greatly appreciated.

Cheers, Dave.

ghia

Community Support Member
Posted on: 2009/7/6 7:17
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#2

Re: Adding a custom page

Quote:
My question involves adding a custom page that isn't a module, or do all pages need to be modules?
In principle yes. Mosttimes custom blocks are used on the front page for things like a welcome message.
Quote:
I also have buttons for 6 pages that I wish to act statically up the top of the page, but my problem is, I don't know how to link them and integrate them into xoops.
You mean a kind of menu buttons in the header? These are defined in the theme.html and you must edit it for giving the buttons the URL of your pages. I assume these are pages with html content?
Quote:
However I'm not sure that applies to what I want to do or even where to put that coding if it does.
You must save this example code as mypage1.php and replace
<p>my html content here</p>
by the html code that is in your pages between the body tags.
This way you get the XOOPS header, footer and columns around your content.
If you want these kind of pages also in your main menu, then you must edit the template file for it and add the links.

djlowes

Just popping in
Posted on: 2009/7/6 7:34
djlowes
djlowes (Show more)
Just popping in
Posts: 20
Since: 2009/6/29
#3

Re: Adding a custom page

Thanks ghia,

I'm so silly, the reason it wasn't working is because my URL was about_us.html and not about_us.php!

This probably won't be the first time I need help, I'm still getting a feel for it all but thoroughly enjoying it in the process.

Thanks a lot for your swift response.

djlowes

Just popping in
Posted on: 2009/7/6 10:53
djlowes
djlowes (Show more)
Just popping in
Posts: 20
Since: 2009/6/29
#4

Re: Adding a custom page

Just fiddling around with the site now, I realized that I can only access the custom pages through the 'home' link, and not through any of the other modules (forum, news etc).

How can I fix this?

Cheers.

ghia

Community Support Member
Posted on: 2009/7/6 11:19
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#5

Re: Adding a custom page

Use absolute paths (starting with http or /) in your links in stead of relative (starting with a name).

djlowes

Just popping in
Posted on: 2009/7/7 2:29
djlowes
djlowes (Show more)
Just popping in
Posts: 20
Since: 2009/6/29
#6

Re: Adding a custom page

Thankyou

webweaver

Just popping in
Posted on: 2009/7/7 22:39
webweaver
webweaver (Show more)
Just popping in
Posts: 64
Since: 2009/3/24
#7

Re: Adding a custom page

In one of the other forums here, there is a link to some good beginner's forums.

I haven't gone through them end to end yet but I have found some useful stuff here.

In the tutorial "XOOPS for Dummies" (2004) there is an area that deals with content that will explain how to do what you outlined at the beginning of this thread. It is reasonably straight forward to implement.

For my initial page, I used a custom block.

Good luck

djlowes

Just popping in
Posted on: 2009/7/8 5:58
djlowes
djlowes (Show more)
Just popping in
Posts: 20
Since: 2009/6/29
#8

Re: Adding a custom page

Thanks for that. I've managed to navigate my way around the application fairly well, and have had a nice read of a couple of the tutorials.

I can't however solve this problem associated with the modules - after attempting to install a module I get the "Module File Not Found" message and consequently am unable to install what appears to be nothing.

I have visited - https://xoops.org/modules/smartfaq/faq.php?faqid=268

but that hasn't helped, not sure what to do with this?

ghia

Community Support Member
Posted on: 2009/7/8 8:14
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#9

Re: Adding a custom page

What module are you trying to instaall? Check always readme and other files for installation instructions.

djlowes

Just popping in
Posted on: 2009/7/8 14:50
djlowes
djlowes (Show more)
Just popping in
Posts: 20
Since: 2009/6/29
#10

Re: Adding a custom page

Initially I installed CBB 3.08, then I uninstalled it and tried to install 4 on there and it came up with that error. I will be mindful to do that in the future. I also have 2 other "Module File Not Found' modules from modules I tried to install at the start that I would love to get rid of but have no idea how to.. Very frustrating.. I'm sure i'll figure it out soon.