11
Quest
Re: How to put a link in the main-menu 'generated' by a module?
  • 2006/5/19 13:49

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


I'm not positive but I believe in the xoopsversion.php where the (has main ="1") or something like that,(in a hurry, sorry). If changed to has main="0" then it will not initially create the main menu link. But can be changed later if the user wants in the admin/system/modules.

For the other stuff. Haven't even a clue.

12
woeps
Re: How to put a link in the main-menu 'generated' by a module?
  • 2006/5/19 15:14

  • woeps

  • Just popping in

  • Posts: 8

  • Since: 2006/5/17


@Quest: Thanks to give it a try...
But i had figured that allready out.. But for the beginning it's the right way to think

@wizanda: of course I could play with some existing Modules and change there anything I want.. But where would be the excitement which comes up when you install your new module and you are going to run it the first time..

I hope maybe someone other can help me out, 'cause my question (Where is the code which actually generates the main-menu everytime an index.php-file of XOOPS gets loaded?) isn't answered by now..

My last thoughts were: "Maybe the code I'm searchin for is in the Core-code.. I don't know and I couldn't locate the Code I'm searchin' for yet.."

So.. maybe.. is somebody out there who can help me?

Thanks,
Woeps

13
DeLorean
Re: How to put a link in the main-menu generated by a module?
  • 2006/5/19 15:41

  • DeLorean

  • Just popping in

  • Posts: 1

  • Since: 2004/11/13


file xoops_version.php:

· $modversion['name'] = _MI_TITLE;

the constant _MI_TITLE is defined in the language/english folder, but you may just hard-code the name with a literal string ( = "Module Name"; ).

­· $modversion['hasMain'] = 1;

this tells XOOPS to add a link to the module in the main menu, and the text is the name of the module.
You shouldn't modify the XOOPS core just to add a link to a module.

When your module is open, you can show a submenu in the main menu with links to other pages in your module:

­· $modversion['sub'][1]['name'] = _MI_SUBMENU_A;
­· $modversion['sub'][1]['url'] = "page_a.php";
­· $modversion['sub'][2]['name'] = _MI_SUBMENU_B;
­· $modversion['sub'][2]['url'] = "page_b.php";
­· $modversion['sub'][3]['name'] = _MI_SUBMENU_C;
­· $modversion['sub'][3]['url'] = "page_c.php";
­· $modversion['sub'][4]['name'] = _MI_SUBMENU_D;
­· $modversion['sub'][4]['url'] = "page_d.php";
­· $modversion['sub'][5]['name'] = _MI_SUBMENU_E;
­· $modversion['sub'][5]['url'] = "page_e.php";
­· $modversion['sub'][6]['name'] = _MI_SUBMENU_F;
­· $modversion['sub'][6]['url'] = "page_f.php";
­· $modversion['sub'][7]['name'] = _MI_SUBMENU_G;
­· $modversion['sub'][7]['url'] = "page_g.php";
­· $modversion['sub'][8]['name'] = _MI_SUBMENU_H;
­· $modversion['sub'][8]['url'] = "page_h.php";

... and so on.

14
stefan88
Re: How to put a link in the main-menu generated by a module?
  • 2006/5/19 16:07

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

I'm not shure about that 100%, but I think the menu is created dynamicaly - XOOPS reads version file each time. So you need to make menu part conditional:

IF CONDITION {
HASMAIN = 1;
SUB 1;
SUB 2

IF SOMEOTHERCONDITION
{
SUB3
}
....
}
ELSE

HASMAIN = 0

Have a loook at MyAlbum-P's xoops_version.php

..

15
woeps
Re: How to put a link in the main-menu generated by a module?
  • 2006/5/20 12:13

  • woeps

  • Just popping in

  • Posts: 8

  • Since: 2006/5/17


Well, I'm quite sure XOOPS creates the main-menu dynamically and because of this I want to find this part of code, so i could see the relations between modules and creation of the menu.
The most content-modules have it solved like you said DeLorean but it would be great (in my opinion) if you can put more links(each with subs) for the same module in the main-menu..
So user would easyly find static-content like an impressum or thinks like that.. cause most user are used to "normal" Websites.. and its sometimes very confusing to find the things you 're searchin' for on XOOPS (not every user uses the search-function.. and so they would leave the website without the information they had looked for, even if the information was just in a submenu..)..
so I thought it would be a good idea if I would be able to manage to write a module which do this.. but for this I have to know which things do actually matter during the menu-creation-action.. and till someone can tell me this, i have to search for the code which creates the menu..

But allthough I'm searchin for this special code,.. Thanks for your help.. I even didn't know that 's possible to create subs in the xoops_version.php and controll them with if conditions..

So thanks.. but maybe someone other have an idea where I could find the code which is used to create the (main-)menu(s)..

Thanks,
Woeps

16
wizanda
Re: How to put a link in the main-menu generated by a module?
  • 2006/5/20 12:19

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Isn't that multimenu anyways? or edito? as edito you can add static and adds links for you?
Or cjaycontet...
or wfcontent...
Yet really the main menu is a pain in away, as you can't seperate bit like you can with multimenu..

17
stefan88
Re: How to put a link in the main-menu generated by a module?
  • 2006/5/20 13:34

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


mainmenu is block from system module, so have a look at modules/system/blocks/system_blocks.php and mudules/system/templates/blocks/system_block_mainmenu.html
..

Login

Who's Online

517 user(s) are online (399 user(s) are browsing Support Forums)


Members: 0


Guests: 517


more...

Donat-O-Meter

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

Latest GitHub Commits