TinyPortal

Development => Support => Topic started by: DonaldDasher on October 25, 2008, 05:11:50 PM

Title: Best way of adding navigation to categories and other areas of the site?
Post by: DonaldDasher on October 25, 2008, 05:11:50 PM
Is there a navigation package anybody would recommend using or it it best to hard code it in?
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: JPDeni on October 25, 2008, 05:25:13 PM
I would do it by hand. I did it by hand. :)

There is no way that any mod, even one as wonderful as TP, can give everyone exactly what they want. The only way to have complete control is to do it yourself, with TP as the framework.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: DonaldDasher on October 25, 2008, 05:26:25 PM
Any pointers as a best way to start?
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: IchBin on October 25, 2008, 05:35:19 PM
You have any ideas on what you want? Would help if you gave us an idea of what you're looking for. If you have any sites or anything that have examples I'm sure we can do something similar or close.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: DonaldDasher on October 25, 2008, 05:43:24 PM
Here's the site in question:

http://www.pre-cert.co.uk

It has two back end databases in which we store information on old UK and Australian video releases:

http://www.pre-cert.co.uk/cgi-bin/cms/search

http://www.pre-cert.co.uk/cgi-bin/au/cms/search

as well as a selection of TP articles:

Consumer Mag articles:
http://www.pre-cert.co.uk/index.php?cat=10134

Trade Mag articles:
http://www.pre-cert.co.uk/index.php?cat=10120

Newspaper articles:
http://www.pre-cert.co.uk/index.php?cat=10136

Collecting:
http://www.pre-cert.co.uk/index.php?cat=10133

Site info:
http://www.pre-cert.co.uk/index.php?cat=10118

Trade Mag ads:
http://www.pre-cert.co.uk/index.php?cat=10135

Video History:
http://www.pre-cert.co.uk/index.php?cat=10129

More may be added...

And of course the forum and a contact area.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: IchBin on October 25, 2008, 05:48:36 PM
I'm not talking about your site. I'm saying that you should find an idea on someone elses site where you like the navagation, then we can make the same thing for you. Otherwise you're asking us to design your site for you, which most of the time doesn't work out because people like different looks and stuff.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: DonaldDasher on October 25, 2008, 05:50:36 PM
I'm wary of doing too much as I'm waiting for the next version of TP to come along that works with SMF 2.

I like the drop down menu option most sites seem to have (including this one).
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: espressoguy on October 25, 2008, 06:00:51 PM
 Like JPDeni, I also did it by hand; in fact she gave me some advice which turned out to be quite useful; she mentioned that there are some good css dropdown menus at www.cssplay.co.uk.

In general, I would recommend sticking with the Default theme or with variants of it which change only the colors but not the basic code.  Alternatively, if you go over to the "Tips and Tricks" subforum on SMF:

http://www.simplemachines.org/community/index.php?board=72.0

...you can find two good threads by "*erhan" on adding Drop-down menus to any theme or to the DilberMC theme.  

Good luck!


Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: JPDeni on October 25, 2008, 06:07:14 PM
Oh, I'm so pleased that you rememberd cssplay.co.uk, espressoguy! :D There's a lot of good stuff there.

Donald, the way I did mine -- http://www.morethanspike.com (very top of the page) -- was to create an html page with a sample menu in it. Then I could see how it looked first to see what it looked like, without having to worry about syntax errors in php. Once I got an html page that looked the way I wanted, I was able to transfer it over to my theme.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: DonaldDasher on October 25, 2008, 06:11:42 PM
Thanks everybody - much appreciated.

What I'm worried about is if I hard code one into the forum will it affect any future/TP forum upgrades etc? And will it work with other themes?

I must admit that this is my major concern.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: JPDeni on October 25, 2008, 06:48:31 PM
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.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: Ianedres on October 25, 2008, 08:31:43 PM
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.
Title: Re: Best way of adding navigation to categories and other areas of the site?
Post by: ianus on October 26, 2008, 06:24:40 AM
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 (http://www.dynamicdrive.com/style/csslibrary/item/suckertree-menu-vertical/) but at the moment I think about a switch to All Levels Navigational Menu (http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/index.htm))

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.