Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-28 04:42:15

vickilh
Member
Registered: 2007-10-30
Posts: 96

if_article_id problem

Hello!

I’ve set up an article that is formatted differently than the other articles or categories in my section. — It works fine when the article is displayed in context, in its category.

The problem would happen if someone did a search and pulled up the article by article id; http://mysite.org/txp/?id=259. I had specified that a right sidebar be excluded if the id is 259, but it shows up when the article is pulled up by id.

Here’s the code:
—————————————————————-
<txp:if_individual_article>
<txp:if_article_id id=259> <p> <else />
<div id=“sidebar”>
<?php include(‘../_sidebar.inc’); ?>
</div>
</txp:if_article_id>
</txp:if_individual_article>
————————————————————-

Am I doing something wrong? Thanks!! Vicki

Offline

#2 2007-12-28 04:46:50

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: if_article_id problem

p.s.
That code is in the page template for the section.

Offline

#3 2007-12-28 08:51:53

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: if_article_id problem

I don’t know about your code, but I noticed that you have php tags in there. You can use them, but they must be wrapped properly, like in this FAQ entry.

Offline

#4 2007-12-28 13:35:42

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: if_article_id problem

When I did that, the sidebar stopped being included altogether!

Thanks, Vicki

Offline

#5 2007-12-28 13:42:03

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: if_article_id problem

p.s.
Plus the code, with the regular “<?php …” DOES work when the article appears within its section/category context (when url is /txp/?s …. &c….). It just doesn’t work when the article is displayed on its own (when url is /txp/?id=259).

Offline

#6 2007-12-28 15:44:29

vickilh
Member
Registered: 2007-10-30
Posts: 96

Re: if_article_id problem

Whoa! Just fixed it.

I changed the <else /> to <txp:else /> and voila! — Odd that it worked in some cases without this, and other case needed this.

thanks! Vicki

Offline

#7 2007-12-28 16:17:06

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

Re: if_article_id problem

vickilh wrote:

I changed the <else /> to <txp:else /> and voila! — Odd that it worked in some cases without this, and other case needed this.

There must have been another reason that it seemed to work, because <else /> does not exist as a tag :)

Offline

Board footer

Powered by FluxBB