1
laide234
How do you add buttons to the main menu?
  • 2007/10/8 1:52

  • laide234

  • Just popping in

  • Posts: 1

  • Since: 2007/10/8


I just installed XOOPS and I have looked through the forms but can find instructions on how to add buttons to the main menu (like under the Home button). Can anyone help?

2
stefan88
Re: How do you add buttons to the main menu?
  • 2007/10/8 7:18

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi

MainMenu lists the modules - when you install module, the buttons are added. If you want to have your own button, you may edit the main menu template or use a menu module (iMenu or MultiMenu).

for iMenu go here: http://dev.xoops.org/modules/xfmod/project/?formulize
Multimenu: https://xoops.org/modules/repository/singlefile.php?cid=62&lid=1423

To edit the main menu template, you need first to clone the default template set in admin -> system admin -> templates and an iction hit clone, enter new name and hit submit. Then you need to tell hops to use the new template set: go to admin -> system admin -> Preferences -> general settings and hit edit, find the "Default template set" option and from drop down menu selet new template, scroll down and hit "Go!"
Now you can edit the code : go in admin -> system admin -> templates and for the new template, next to system click "list", find the row "system_block_mainmenu.html" and click edit, make the changes and submit.

Or you can edit the template file in /modules/system/templates/blocks/system_block_mainmenu.html and then update the system module in admin -> system admin -> modules. also you need to delete all files except index.html in templates_c folder. Keep a backup of system_block_mainmenu.html file in case there are problem with your changes ...



Learn more about templates here: https://xoops.org/modules/smartfaq/category.php?categoryid=17

And here is another answer for this question ... https://xoops.org/modules/smartfaq/faq.php?faqid=536
..

3
anemic
Re: How do you add buttons to the main menu?
  • 2007/10/10 6:47

  • anemic

  • Just popping in

  • Posts: 36

  • Since: 2006/12/6


Hi,

I've got a related question..how timely I saw this thread.

I am integrating a large standalone app into xoops. The application is not XOOPS aware. What I'd like to do is have some logic run in the XOOPS framework so that every time the menu is drawn I can do a database query, a little logic in php and then draw the menu. I want a couple of menu elements to be dynamically changed..but not in the modules instead in the code that created the menu. I cannot figure out exactly where mainmenu is called. I've grepped through my source tree and could not find one spot it's called from. Anyone care to point me at a location in source code?

Thanks, anemic

4
nachenko
Re: How do you add buttons to the main menu?
  • 2007/10/10 8:24

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


You can include PHP code in your templates. I think this is the cleanest way, as you're adding your stuff keeping the XOOPS code safe.

This is the way:

<{php}>
Put your PHP code here
<{/php}>

5
anemic
Re: How do you add buttons to the main menu?
  • 2007/10/10 17:19

  • anemic

  • Just popping in

  • Posts: 36

  • Since: 2006/12/6


Wow that's just about what I want. Can I reference XOOPS smarty variables inside the inline php? I have some variables to lookup based on the userid and these are used in the computation of menu items.

Thanks VERY everyone for the quick reply. anemic

6
jegelstaff
Re: How do you add buttons to the main menu?
  • 2007/10/22 12:30

  • jegelstaff

  • Module Developer

  • Posts: 518

  • Since: 2004/7/2 2


You can reference smarty variables inside the PHP code inside a template, but they are embedded inside a long array. I don't remember the exact syntax or name of the array, but the easiest way to figure out how to refer to them is to look at any of the compiled templates in your templates_c folder. Open one of those up and look for a reference to a smarty variable and you will see what the "internal" PHP name of the variable is. You can use that in the PHP code inside your templates.

Good luck,

--Julian
Technical Architect - Freeform Solutions
Formulize - custom registration forms, ad hoc forms and reports

7
jegelstaff
Re: How do you add buttons to the main menu?

Quote:

FYI...

http://www.freeformsolutions.ca/formulize has the latest files now. dev.xoops.org seems to be down again (still).

--Julian
Technical Architect - Freeform Solutions
Formulize - custom registration forms, ad hoc forms and reports

Login

Who's Online

324 user(s) are online (219 user(s) are browsing Support Forums)


Members: 0


Guests: 324


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