1
djlowes
Adding a custom page
  • 2009/7/6 3:17

  • djlowes

  • Just popping in

  • Posts: 20

  • Since: 2009/6/29


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.

2
ghia
Re: Adding a custom page
  • 2009/7/6 7:17

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


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.

3
djlowes
Re: Adding a custom page
  • 2009/7/6 7:34

  • djlowes

  • Just popping in

  • Posts: 20

  • Since: 2009/6/29


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.

4
djlowes
Re: Adding a custom page
  • 2009/7/6 10:53

  • djlowes

  • Just popping in

  • Posts: 20

  • Since: 2009/6/29


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.

5
ghia
Re: Adding a custom page
  • 2009/7/6 11:19

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


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

6
djlowes
Re: Adding a custom page
  • 2009/7/7 2:29

  • djlowes

  • Just popping in

  • Posts: 20

  • Since: 2009/6/29


Thankyou

7
webweaver
Re: Adding a custom page
  • 2009/7/7 22:39

  • webweaver

  • Just popping in

  • Posts: 64

  • Since: 2009/3/24


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

8
djlowes
Re: Adding a custom page
  • 2009/7/8 5:58

  • djlowes

  • Just popping in

  • Posts: 20

  • Since: 2009/6/29


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?

9
ghia
Re: Adding a custom page
  • 2009/7/8 8:14

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


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

10
djlowes
Re: Adding a custom page
  • 2009/7/8 14:50

  • djlowes

  • Just popping in

  • Posts: 20

  • Since: 2009/6/29


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.

Login

Who's Online

164 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

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

Latest GitHub Commits