TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 317
  • Total: 317

Best way of adding navigation to categories and other areas of the site?

Started by DonaldDasher, October 25, 2008, 05:11:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

You would probably have to make the changes in every theme that you have available on your site. Every theme must have an index.template.php file and the menu changes would be in that file.

You could do an alteration where you had a separate menu.template.php file and then, in the index.template.php file for each of your themes, you would have it pull in the data from the menu.template.php file instead of printing out the menu. It would require altering of each of the themes, but not much and only once. If you wanted to change the structure of the menu, you'd only have to alter the one menu file.

Upgrades? It's hard to know. It depends on what is changed in the process of the upgrade.

I only use one theme and probably my response is best for those who also only use one theme.

Ianedres

I use two separate script files on my site- one for a horizontal menu using CSS (highly recommended), and the other for a vertical menu in the left column. Though I only use one theme, I call the scripts (as per JPDeni's suggestion) so that I can use them again should I swap themes in the future. I actually use the vertical menu in a blog site to mimic the look and feel of my main site.

Not to cloud the issue, but SMF 2.0 has a different menu building scheme (from 1.x) that I looked at last night. It involves an array of options (which looks to be very efficient while confusing) that calls a function to build the options dynamically. That being said, it may possible to build your own menu array and call the function through your theme or included file once SMF 2.0 is on a stable release candidate. You would have the advantage of using permissions through SMF to design the menu.

ianus

Greetings!

In my humble opinion â€" an easy menu system is a feature which is necessary for a webside in general and for a support board as special case.

My solution is an script from dynamicdrive.
(I choose a multi level menu which only needs a html list. SuckerTree Vertical Menu but at the moment I think about a switch to All Levels Navigational Menu)

Than I create an navigation.html and put the css, js and the list in it.

<li><a href="your link to category.html">Category A</a>
<ul>
<li><a href="link to article.html">Article 1</a></li>
<li><a href="link to article.html">Article 2</a></li>
</ul>
</li>
<li><a href="your link to category.html">Category B</a>
<ul>
<li><a href="link to article.html">Article B1</a></li>
<li><a href="link to article.html">Article B2</a></li>
</ul>
</li>


Finally I create a block and include the navigation.html via php.
Done, a nice menu

For each board I like to have another menu which shows the important threads.
I use the same script and create a “board1navigation.html”, “board2naviagtion.html”, and so on.
Than I put an array in a block to call the menu file only at a specific board.

$ board1 = array('18');
$ board2 = array('76','77','79');


if (isset($context['current_board']) && in_array($context['current_board'], $board1))
include ("../path/to/board1navigation_nav.html");

elseif (isset($context['current_board']) && in_array($context['current_board'], $board2))
include ("../path/to//board2navigation.html");

(With the latest TP you can skip this and define where a block should be show or hidden.)

Pros:
You have to create only one block for the navigation.
If you be carefull with the css most of the smf style.css could be used and this way the menu have always the colors of your theme.
Blockcode is theme independent and finally your menu is theme independent.

Cons:
You have to create a html file for each menu.
You have to put links into this file by hand (download, add, upload)
(There is an extension for Firefox which allows to copy a link with url and name in html format. So it is easy to create a thread, copy the link with two klicks and put it into the list with a third klick. Plus one klick for download the html file, one to open it, one to close it and a last one to upload it you will need seven klicks to add a new menu entry.)

Future:
Find a script that allow to put an link into a file or database and another script to create a simple list. I’m not able to write the code, so this is only a dream.
(Could be a create idea for some modwriters  ::))

You can see the menus in action on my site and I hope that this tend to help you a little bit to create your own navigation.

This website is proudly hosted on Crocweb Cloud Website Hosting.