Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-17 05:17:44

damienbuckley
Member
From: Brisbane, QLD, AU
Registered: 2006-02-24
Posts: 138
Website

Generate non-linked category list for contact form?

A site I’m building requires a form select field housing a variety of services for clients to choose from. Using zem_contact_reborn this is straightforward. However, I’d prefer to have this list auto-generate a non-linked list of categories so that when the site owner adds categories the select options update automatically. The list needs to be non section dependent and able to output a nested list from a parent category.

The basic <txp:category_list /> tag works except that it produces a linked list – not valid html!

I’ve gone through all the available category list plugins etc I can see and so far none match the functionality.

Any ideas?

Offline

#2 2008-03-17 05:24:00

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Generate non-linked category list for contact form?

I would cannibalize category_list (from taghandlers.php) into a plugin – just remove the href and other features you don’t need.

Offline

#3 2008-03-17 05:33:19

damienbuckley
Member
From: Brisbane, QLD, AU
Registered: 2006-02-24
Posts: 138
Website

Re: Generate non-linked category list for contact form?

Sounds great! How do you do that?

Offline

#4 2008-03-17 05:57:20

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Generate non-linked category list for contact form?

Copy function category_list into a plugin template, then compile and install it (series).

Or just copy/paste this :).

H4sIAAAAAAAAA+VUXW/aMBR9Tn7FlYfmINEAoazUFNaq3R4m7WXde2QSU1yFGNlOKSr89/na 
Satu/QeLFMX3+Nyv4+twNh6xF8MuGHkS2khVk7lhE0ZG6RhXXxjhjd0ojcZ4xsgPVZ/9lMWG 
iwruRFVK7+CCtLy80RKRzCEba3dsOHzclp6YFmo79OwxI6UwhZY722WcMnIDxjY7UZeqMdUB 
dhWXNRTcigelD1BJY1OknjNiDztB5pKNglnzrehyumR555MrH9+0XhtR7Twtc32sihSujKhE 
YQH9F6TzIss4urLPO/ZRqOEyvhoGt2UcH/MUbqzVctVYAWjdiTVvKgtPvGoC8r2pC3SFY3yE 
a/FcVE0pruEIZ+79FsyuSylMoBmlLXKusTS4ub9F496BoHQpdCChCohzbWVRuWxw24mFW3Bs 
+y5U6eW5mGSMxOuuno/aS3rcWtOPX+JIPFvNC5tUrkGTcK35IYmjiLYdUPDPYgmUDhDHklvw 
HY6lvMfbenG7P4CQsT+P46iHMWABpbqvuNkk3vY7cg1Jr83cjyNXXtSZnp/jdLwx5u/3H5Ws 
E0IHlAzeYnfcv8mE16WfCKiVBedIu03aJ457wkK1cUzD1yLXam9yY11PCUWvAVhpsTmgboZe 
BfZa+Ll1jpSkr2Ug1E8JhX/SlmGUXNlaKUv78FpkmIHVAUgaNIKvEL4MaDcx1HfmhdOm00w1 
qC+l2PN+I93QuBN3SO1O+5fae6rjevLrBPS4P4MoBMP4SAkcd2ZOhd/YMipida6Fu7iFSOhn 
QBE+f5rM5rjqeV282m0h6QIsf0jeIjh6mEN0DFdoQWjqU6aU0OB8isOrhW10DRjKH8spxiGf 
hXuea77/7+66+21vy6lfuZs+XolJtppOylE2mZ6P1peXl9k0ExdjB/FZkZH56Q9kDr5R/gUA 
AA==
<select name="foo">
	<txp:jmd_category_options/>
</select>

Produces:

<select name="foo">
	<option value="hope-for-the-future">Hope for the Future</option>
	<option value="meaningful-labor">Meaningful Labor</option>
	<option value="reciprocal-affection">Reciprocal Affection</option>
</select>

Offline

#5 2008-03-17 06:19:25

damienbuckley
Member
From: Brisbane, QLD, AU
Registered: 2006-02-24
Posts: 138
Website

Re: Generate non-linked category list for contact form?

Wow, thats awesome. Thanks so much. Is there a quick way to add a ‘parent’ parameter to this?

Offline

#6 2008-03-17 06:58:19

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Generate non-linked category list for contact form?

# jmd_category_options v0.2
# A stupendously plain category list.
# Jon-Michael Deldin
# http://jmdeldin.com/

# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................

H4sIAAAAAAAAA+1VTW/bMAw927+C04LJATLHSZa1cJquxT4OAwYM6+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

damienbuckley
Member
From: Brisbane, QLD, AU
Registered: 2006-02-24
Posts: 138
Website

Re: Generate non-linked category list for contact form?

Thanks Jon, works a treat.

Offline

#8 2008-03-17 07:14:31

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Generate non-linked category list for contact form?

No problem. If you need more features, just copy/paste code from textpattern/publish/taghandlers.php.

Offline

#9 2009-05-14 20:26:46

cris10shercc
New Member
Registered: 2009-05-14
Posts: 8

Re: Generate non-linked category list for contact form?

How would you link Hope for the Future, for example?

Offline

Board footer

Powered by FluxBB