xoops forums

RicoCali

Not too shy to talk
Posted on: 2003/12/3 19:41
RicoCali
RicoCali (Show more)
Not too shy to talk
Posts: 120
Since: 2002/7/29
#1

How do I do this without hacking the core?

I am working on horizontal menu system in the form of a template tag. The template tag will be "<{xoops_hmenu}>" This tag can be placed in your theme.html it will dynamically generate a horizontal menu with pulldowns just like the "main menu" but going horizontal. The only problem is I would have to hack the "header.php" file to do this. I don't want to touch the "header.php" file. Does anyone have a clean way to do this without code hacking the "header.php" file?
Posted on: 2003/12/3 20:14
wtravel
wtravel (Show more)
Posts: 987
Since: 2003/8/27
#2

Re: How do I do this without hacking the core?

Hi,

I built in a few things in a new file. If you include the file into one of the files that are always included you can manage it. The only thing you need to remember is to adjust that file again upon possible upgrade

Regards,

Martijn

RicoCali

Not too shy to talk
Posted on: 2003/12/3 21:00
RicoCali
RicoCali (Show more)
Not too shy to talk
Posts: 120
Since: 2002/7/29
#3

Re: How do I do this without hacking the core?

Thats exactly what I'm doing right now and thats exactly what I want to avoid.

Thank you...

Mithrandir

XOOPS is my life!
Posted on: 2003/12/3 21:14
Mithrandir
Mithrandir (Show more)
XOOPS is my life!
Posts: 6320
Since: 2003/6/21
#4

Re: How do I do this without hacking the core?

Can't see how you can include something one every page on the site without adding it to one of the files included in the core.

As long as you just have that extra file, you include in header.php it should be easy enough to update when XOOPS is updated.

RicoCali

Not too shy to talk
Posted on: 2003/12/3 21:25
RicoCali
RicoCali (Show more)
Not too shy to talk
Posts: 120
Since: 2002/7/29
#5

Re: How do I do this without hacking the core?

Yes I agree but 1 turns into 2 and 2 turns into 4 and 4 turns into 8 and so on. As simple as it may sound, it gets complicated to remember all this when you recieve an update. As simple as it is to do anything, I just hate to kludge. PHPNuke is nothing but that...a kludge. If the developers would add something in the header.php file such as:

include "extra.php";

...we can have extra flexibility to add template variables to the the theme without mucking with the original file

zaax

Just popping in
Posted on: 2003/12/3 21:36
zaax
zaax (Show more)
Just popping in
Posts: 21
Since: 2002/12/17
#6

Re: How do I do this without hacking the core?

hello RicoCali..,

is´nt it as esay to place
<{include file="themname/theme_navigation.html"}>
before e.g. your first table ??
direktly in the theme.html or do i misunderstand the problem ?

michael

mvandam

Quite a regular
Posted on: 2003/12/3 21:42
mvandam
mvandam (Show more)
Quite a regular
Posts: 253
Since: 2003/2/7 2
#7

Re: How do I do this without hacking the core?

Quote:

If the developers would add something in the header.php file such as:

include "extra.php";

...we can have extra flexibility to add template variables to the the theme without mucking with the original file

Something like this is probably a good idea for themes which include stuff that is normally part of a block etc. Though instead of "extra.php" a better name might be "theme_init.php" or something, where this file would be located in the directory of the particular theme you are using.

RicoCali

Not too shy to talk
Posted on: 2003/12/3 22:03
RicoCali
RicoCali (Show more)
Not too shy to talk
Posts: 120
Since: 2002/7/29
#8

Re: How do I do this without hacking the core?

Quote:

mvandam wrote:
Though instead of "extra.php" a better name might be "theme_init.php" or something, where this file would be located in the directory of the particular theme you are using.


I agree...Thats why you are the annointed core developer and I'm not . But yes that is excellent. Very descriptive.

RicoCali

Not too shy to talk
Posted on: 2003/12/3 22:05
RicoCali
RicoCali (Show more)
Not too shy to talk
Posts: 120
Since: 2002/7/29
#9

Re: How do I do this without hacking the core?

Quote:

zaax wrote:
hello RicoCali..,

is´nt it as esay to place
<{include file="themname/theme_navigation.html"}>
before e.g. your first table ??
direktly in the theme.html or do i misunderstand the problem ?

michael


B I N G O ! ! ! Thats it zaaz! I wish I was smart as you .