SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Menu to it's own File

Started by Burke ♞ Knight, June 21, 2013, 02:38:59 PM

Previous topic - Next topic

Burke ♞ Knight

I read the idea about the menu being in the database, and thought that if that did not work out, how about how a lot of website template do it. They have the pages divided. Header.php Menu.php Footer.php

All other pages have includes to call them up. (All we need is the menu section, but I'm posting the whole to show better.)

<!-- Start Of Header Section. -->
  <? include ("header.php"); ?>
<!-- End Of Header Section. -->

<!-- Start Of Menu Section. -->
  <? include ("menu.php"); ?>
<!-- End Of Menu Section. -->

<!-- Start Of Main Section. -->
  This is where the site coding goes on each page.
<!-- End Of Main Section. -->
<!-- Start Of Footer Section. -->
  <? include ("footer.php"); ?>
<!-- End OF Footer Section. -->

This way, the menu can be it's own file, in the sources dirtectory, most likely, and then gets called for by the index.template or subs file. This will make editing the menu easier and faster for modders and new people to using SMF.

Just an idea I was thinking about.


It is already in Sources (Subs.php).
It is already easy to edit for mods (there is a hook to do that doesn't even require editing the file).
It's quite easy for people to edit too (they just don't want to read how to do it :P)
It's already called in index.template.php and in any page that uses it.

Did I miss anything? :P

Take a peek at what I'm doing! ;D

Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Burke ♞ Knight

Maybe so, but there are still a lot of people who mess it up... Probably would my way, too, I guess.
I guess the best way to make menu editing easiest would be having something like Menu Editor being a part of SMF.


I don't see a lot of people messing it up. I see people that have questions about how to do things with it. I agree on the menu editor being part of the admin. But it needs to be done right.  The code you posted for an example though, IMO is hideous. lol
IchBin™        TinyPortal

Burke ♞ Knight

The code I posted is just an example of how the calls are done.
It's the same code that gets used in html whenever a page includes another page into it.

The code was not meant to be seen as one to use, just to show the point I was making about includes.


separating it into a file would be a step BACK, IMO.

Either it should stay as it is - or get moved into the database, with the method of adding new items standardized for hooks and mods

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


It will be moved into the database in 3.0.

Thanks for the suggestion, though.