Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: Burke ♞ Knight on June 21, 2013, 02:38:59 PM

Title: Menu to it's own File
Post by: Burke ♞ Knight on June 21, 2013, 02:38:59 PM
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.
Title: Re: Menu to it's own File
Post by: emanuele on June 21, 2013, 02:46:14 PM
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 (http://wiki.simplemachines.org/smf/Buttons_-_How_do_I_add_buttons_to_SMF_2.0))
It's already called in index.template.php and in any page that uses it.

Did I miss anything? :P
Title: Re: Menu to it's own File
Post by: Burke ♞ Knight on June 21, 2013, 02:58:43 PM
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.
Title: Re: Menu to it's own File
Post by: IchBin™ on June 23, 2013, 09:37:14 PM
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
Title: Re: Menu to it's own File
Post by: Burke ♞ Knight on June 23, 2013, 09:40:35 PM
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.
Title: Re: Menu to it's own File
Post by: Kindred on June 24, 2013, 09:58:52 AM
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
Title: Re: Menu to it's own File
Post by: Arantor on November 10, 2013, 05:48:30 PM
It will be moved into the database in 3.0.

Thanks for the suggestion, though.