Bienvenue, Invité
Nom d'utilisateur : Mot de passe :


I have developed a range of add-ons for webtrees available only from my kiwitrees.net web site: kiwitrees.net/simpl-add-ons/. For any queries related to those items contact me direct from that site.

SUJET : Simpl_menu configuration

Simpl_menu configuration il y a 7 ans 8 mois #1

  • Jvovillia
  • Portrait de Jvovillia
I'm simply attempting to link a blog to my webtrees site.

I was able to configure it nicely as I just wanted the menu without sub-menus that linked to the blog. It works well except that I get some errors. I'm not a programmer or anything so I'm sure it's a small edit but any help is welcome.

ERROR 8: Undefined variable: menu
0 Error occurred on line 67 of file module.php in function getMenu
1 called from line 540 of file MenuBar.php in function getModuleMenus
2 called from line 126 of file header.php in function require
3 called from line 271 of file Base.php in function pageHeader
4 called from line 32 of file forum.php in function include
5 called from line 80 of file module.php in function modAction
6 called from line 33 of file module.php

Notice: Undefined variable: menu in /home/jvovillia/webapps/webtrees/modules_v3/simpl_menu/module.php on line 67

My module.php section that I think I messed up


// Implement WT_Module_Menu
public function getMenu() {
global $WT_IMAGES, $GEDCOM, $SEARCH_SPIDER, $controller;

// CHANGE YOUR CHOICES FOR TITLES:
$mainmenu = WT_I18N::translate('Blog'); //Main menu title


if ($SEARCH_SPIDER) {
return null;
}
//-- main menu item
$menu = new WT_Menu($mainmenu.'<style type="text/css">#menu-menu {background:url

('.WT_MODULES_DIR.$this->getName().'/'.WT_THEME_URL.'menu.png) no-repeat 50% 50% !important;}</style>',

'module.php?mod=simpl_menu&mod_action=index&page='.$submenu1, 'menu-menu');
$menu->addClass('menuitem', 'menuitem_hover', 'submenu');



return $menu;
}

// Extend WT_Module
public function modAction($mod_action) {
switch($mod_action) {

default:
include 'forum.php';// REPLACE THIS WITH SOMETHING ELSE
}
}

}
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Simpl_menu configuration il y a 7 ans 8 mois #2

  • kiwi
  • Portrait de kiwi
  • Hors Ligne
  • Platinum
  • Messages : 4968
Jo

You've deleted lines that are redquired. I don't recall saying anything in the instructions about deleting ANYTHING :-) Although you are correct in removing the second and third sub-menus.

Put these lines back:
$submenu1 = WT_I18N::translate('Documentation'); //Sub-Menu title 1
$submenu2 = WT_I18N::translate('Forums'); //Sub-Menu title 2
$submenu3 = WT_I18N::translate('Cookbook'); //Sub-Menu title 3

Directly under these two:
// CHANGE YOUR CHOICES FOR TITLES:
$mainmenu = WT_I18N::translate('Blog'); //Main menu title

Then replace "Documentation" with "Blog"... and before you ask, yes, that will give you two entries for "Blog", the main menu and one sub-menu. That's how all webtrees menus work.

It doesn't matter what you give $submenu2 and 3 - they will not be used in your case.

I hope to have a new version of this add-on available soon, that will make configuring it a lot easier, and require no touching of php files :-) Sorry that its not really as "simpl" as it should be for now.
Nigel

www.our-families.info

Hosted at:
Follow me at:
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Simpl_menu configuration il y a 7 ans 8 mois #3

  • Jvovillia
  • Portrait de Jvovillia
Thanks Nigel,

I just thought I would be able to make the menu tab the link itself instead of having a sub-menu.

I'll take what I can get for now. Thanks for developing the simpl add-ons.
-Jeff
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Simpl_menu configuration il y a 7 ans 8 mois #4

  • kiwi
  • Portrait de kiwi
  • Hors Ligne
  • Platinum
  • Messages : 4968
It is possible (and easy with the next version).

If you send me your file module.php, I'll fix it so there is no need for the sub-menus.
Nigel

www.our-families.info

Hosted at:
Follow me at:
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Simpl_menu configuration il y a 7 ans 1 mois #5

  • Jvovillia
  • Portrait de Jvovillia
Hi Nigel,

I upgraded my simpl_menu to simple_menu2. You had previously set me up with a nice custom configuration where I only had a link to my blog without any drop down menu. Now that I've upgraded, both simpl_menu and my rural theme, I get strange behavior on my simpl_menu2 where it's difficult to click the link.

Maybe I'm missing something on custom configuration?

Thanks in advance.
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Simpl_menu configuration il y a 7 ans 1 mois #6

  • kiwi
  • Portrait de kiwi
  • Hors Ligne
  • Platinum
  • Messages : 4968
If you want to use this on a custom theme such as Rural, you will need to add a Rural theme folder within the module (similar to the existing ones there) and provide menu images of the correct size, and different css to set the size and position of the menu elements. I'm afraid life does get a little more complex if you use ad-ons with add-ons :-)

Currently the new menu is using its default webtrees theme menu icon, sizing and position, resulting in the problems you see.
Nigel

www.our-families.info

Hosted at:
Follow me at:
L'administrateur a désactivé l'accès en écriture pour le public.
Propulsé par Kunena