Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
Re: if override?
Offline
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
Re: if override?
Have you played with the If_individual_article and If_article_list conditionals?
Offline
Re: if override?
bingo.. that works… thanks for the help
Offline
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
Offline
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
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
Pages: 1