Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-03-14 09:33:31

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 581

Using messy sections and categories

I’m working on a windows server for my latest project and I’m having some trouble figuring out how to use sections and categories together. Would the following code be the correct way to go about it?

<a href="<txp:site_url />?s=foo?c=bar">Hello World!</a>

Thanks.

Offline

#2 2011-03-14 09:46:48

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: Using messy sections and categories

I think it s correct, but the only way to be sure is to test it ;)

Offline

#3 2011-03-14 09:52:43

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 581

Re: Using messy sections and categories

I keep getting 404 errors but that maybe in relation to other code I have in my page. I just wanted to get a quick second opinion.

—Edit—
I can get it to work fine when I use ?s=foo or ?c=bar but as soon as I combine them together to produce ?s=foo?c=bar that’s when I stat getting for 404 errors

Last edited by Algaris (2011-03-14 10:01:29)

Offline

#4 2011-03-14 10:02:48

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: Using messy sections and categories

how about:

<txp:category name="bar" section="foo">Hello World!</txp:category>

~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#5 2011-03-14 10:07:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,944
Website GitHub

Re: Using messy sections and categories

Algaris wrote:

<a href="<txp:site_url />?s=foo?c=bar">Hello World!</a>

When combining attributes, separate them with ampersand.

<a href="<txp:site_url />?s=foo&c=bar">Hello World!</a>


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2011-03-14 10:11:53

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 581

Re: Using messy sections and categories

Ah of course, thanks Stef. I’m guessing that I could use &amp; to avoid validation errors?

Offline

#7 2011-03-14 10:19:25

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: Using messy sections and categories

ooh sorry i havent noticed the second “?” in the link!!

Offline

#8 2011-03-14 10:34:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,944
Website GitHub

Re: Using messy sections and categories

Algaris wrote:

I’m guessing that I could use &amp; to avoid validation errors?

Yep. Pesky standards :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#9 2011-03-14 21:41:24

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Using messy sections and categories

But why wouldn’t Kemie’s suggestion work?

Offline

Board footer

Powered by FluxBB