Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-09 19:36:13

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

if override?

Hi all,
I am wondering whether there is any conditional statement that will let me output code based on the url structure. (I know if_section exists, but is there something that will let me check whether there is anything after the dash behind the section…. (…com/section/blurb)
I know that expression engine has segment_# parameters; is there anything similar for textpattern.
Thanks ,dl33

Offline

#2 2007-02-09 22:30:31

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: if override?

Offline

#3 2007-02-09 22:54:13

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: if override?

Thanks for the help but I do not think that this will work for me.
I have an artice list (txp:article), which I would prefer to output if the url structure is like this: /sectionname
However, I do want to output it if the url structure is like this: /sectionname/otherStuff. Effectivly I only want the article list to be visible, when I am looking at single articles (which are defined by the url overriding my original txp:article tag…)
Any ideas?

Offline

#4 2007-02-10 01:05:30

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: if override?

Have you played with the If_individual_article and If_article_list conditionals?

Offline

#5 2007-02-10 10:10:55

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: if override?

bingo.. that works… thanks for the help

Offline

#6 2007-08-25 14:33:48

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: if override?

I am working on another site now and I am wondering whether it is possible to get the last bit or url (after the dash or just some variable) and use in the code. Basically, if the url is equal to /gallery/detail/6, I want to be able to create a variable that I can use throughout my form which echoes ‘6’… (I need to use the variable to display uploaded images, one at a time. Or to say it differently, I am building a custom image gallery.)

Offline

#7 2007-08-25 18:58:42

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: if override?

<txp:article_url_title />

Cheers!

Offline

#8 2007-08-26 11:14:09

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: if override?

Thanks for the reply, but I am afraid that <txp:article_url_title /> would give me ‘detail’ and not the number behind the dash. I could use a url structure like /gallery/detail?i=6 together with php $_GET('i'); but that would get rid of my clean urls… Any ideas?

Offline

#9 2007-08-26 17:32:19

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

Re: if override?

<txp:article_id />? Or do I misunderstand you and is ‘detail’ your article title? In that case maybe you can use a custom field: <txp:custom_field name="..." />.

Last edited by els (2007-08-26 17:35:05)

Offline

#10 2007-08-26 20:59:23

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: if override?

Jep, detail is my article title and the number behind it is just some random number. I resolved it now using a php variable and $_GET, even if that gets rid of my clean urls… Thanks anyway…

Offline

Board footer

Powered by FluxBB