Textpattern Forum

You are not logged in. Register | Login | Help

#1 2004-06-15 21:12:57

greenrift
Plugin Author
Registered: 2004-03-08
Posts: 186
Website

[archived] mdp_SectionMenu

Notice: This thread is archived, there is a native txp tag now: <txp:section_list>.

**********************************************************

I wrote up this little plugin yesterday night, it takes all your section’s and output’s them as links to the highest level of that section (/section_name). Using wrap and break tags you can make them output as anything you want (div within a blockquote if you wanted!), and there are a few other options as well. Best example I can give is on my site, the menu you see on the side and top uses my plugin. Its default settings create’s an unordered list that include every section in alphabetical order.

Enjoy, post/email any comments or suggestions.

mdp_SectionMenu v0.1

wow, the title of this thread got really messed up.

Last edited by greenrift (2004-06-15 22:53:48)

Offline

#2 2004-06-15 22:48:02

slabanosa
Member
From: Belgium
Registered: 2004-06-01
Posts: 49
Website

Re: [archived] mdp_SectionMenu

http://greenrift.textdrive.com/ could not be found … ):

Offline

#3 2004-06-16 05:31:59

eightounces
New Member
From: Philadelphia
Registered: 2004-04-27
Posts: 7
Website

Re: [archived] mdp_SectionMenu

I know this may be inproper BB use, but I just wanted to say I left a topic for you (greenrift) here, and I couldn’t find any way to contact you through this or your site. Again, sorry for the irrelevent post.

Offline

#4 2004-06-17 14:31:17

ryan
New Member
Registered: 2004-05-13
Posts: 3

Re: [archived] mdp_SectionMenu

I installed this yesterday and it’s working like a charm. I made a hack on it to make the Home link functionality stop requiring the special “home” addition to the url. Basically, if it is rendering the special home item, it links to the site root.

Change the line:

$tagatts[] = ‘ href=”’.$pfr.$sval.’”’;

to the block:

if($sval != “home”) { $tagatts[] = ‘ href=”’.$pfr.$sval.’”’; } else { $tagatts[] = ‘ href=”/”’; }

Thanks for the great plugin!

Last edited by ryan (2004-06-17 14:32:18)


when you’re following an angel, does it mean you have to throw your body off a building? – tmbg

Offline

#5 2004-06-17 16:44:19

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [archived] mdp_SectionMenu

how is this any different than <code><txp:section_list /></code>

Offline

#6 2004-06-17 17:26:02

greenrift
Plugin Author
Registered: 2004-03-08
Posts: 186
Website

Re: [archived] mdp_SectionMenu

> tinyfly wrote:

> how is this any different than <code><txp:section_list /></code>

Section List will just output all of your sections in alphabetical order. It’s an all or nothing kind of thing. My plugin lets you rearrange the order, remove certain sections, and a link to your root directory. It’s section_list with some additional functionality.

Offline

#7 2004-06-17 17:31:08

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [archived] mdp_SectionMenu

Sounds Great! This is what I have been wanting for awhile now

Offline

#8 2004-06-25 15:00:12

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: [archived] mdp_SectionMenu

This is a nice plugin, I am wondering though:

- why do you use a “span” for each li in the generated html code? As far as I can see, a span is not needed there.
.
- how could I use an “id” option, instead of the “class” option?

Last edited by marco (2004-06-25 15:03:40)

Offline

#9 2004-06-25 15:24:22

KidFiction
New Member
Registered: 2004-04-24
Posts: 5

Re: [archived] mdp_SectionMenu

nice one! I was just using a linked list giving the sections their own catagory but no longer will I need to do that!

Offline

#10 2004-06-25 17:36:34

greenrift
Plugin Author
Registered: 2004-03-08
Posts: 186
Website

Re: [archived] mdp_SectionMenu

> marco wrote:

> This is a nice plugin, I am wondering though:

> why do you use a “span” for each li in the generated html code? As
> far as I can see, a span is not needed there.

I use the span tags around the text of the link so that if someone wanted to use FIR or similiar method they could.

> how could I use an “id” option, instead of the “class” option?

There is none currently, but you could edit the source (click on the plugin link, and edit it using the textarea) and where it says “$class = (!empty($atts[‘class’])…” replace the part following it ‘ class=”’.$atts[‘class’]’”’ with ‘ id=”’.$atts[‘class’].’”’ (make sure to include that space before “id”).

I’ll add a real ID option and post it up later today.

Offline

Board footer

Powered by FluxBB