Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#145 2009-08-26 00:18:53

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Well, let me add to the confussion:
<txp:if_article_list> inside <txp:article_custom /> always return true

Last edited by maniqui (2009-08-26 00:19:29)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#146 2009-09-04 16:22:05

hoho
Plugin Author
Registered: 2009-04-05
Posts: 11

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

maniqui wrote:

Could this be a bug?
<txp:if_article_id> on article list context is not being evaluated

I definitely consider it a bug. :) However, it was all the same in previous versions, 4.0.8 at least, and the code of this tag suggests this behaviour is on purpose.

Anyway, I would really like to see this element to evaluate to false instead of being dropped in article list context. It would be more intuitive and more convenient for typical use, imho. There is no reason this tag’s functionality should overlap with that of if_individual_article.

I’m going to replace lines 1477-1480 of publish/taghandler.php as follows:

return parse(EvalElse($thing, $id and in_list($thisarticle['thisid'], $id)));

Last edited by hoho (2009-09-04 19:16:20)

Offline

#147 2009-09-04 16:29:51

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

^^ submit a patch to the devs!

Offline

#148 2009-09-05 15:40:23

hoho
Plugin Author
Registered: 2009-04-05
Posts: 11

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Patch submitted. I just had to think more thoroughly about it to base my argumentation on more solid basics than ‘intuition’. :) Here’s the core.

As far as I can tell, the if_article_id tag is the only TXP tag that
differentiates between a single article context and an article list context
in the sense that the tag does something in one context and does absolutely
nothing in the other.

Moreover, the tag is unique :) among other conditional TXP tags: it is the
only conditional tag that can evaluate neither clause without reporting an
error. Indeed, I haven’t seen such an if-statement in any other programming
language. :)

Having said all this, I would recommend changing semantics of the
if_article_id tag so that the condition evaluates to false if no value of
the ‘id’ can be determined. That’s exactly what the patch does.

The other option – reporting an error – would introduce a new type of error
in TXP which is not desirable in terms of simplicity of the overall
semantics, is it?

P.S. The change is not backward-compatible but if you think it through,
casulties should be rather limited – it should affect only the unlikely
(imho) cases when one uses an else-clause while relying on the fact that
the tag is ignored in an article list context.

Last edited by hoho (2009-09-06 21:29:01)

Offline

#149 2009-09-06 16:00:08

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Setting up multi-site manager on Media Temple’s Grid Server.

Last edited by Walker (2009-09-06 17:02:12)

Offline

#150 2009-09-19 22:26:42

sarah
Member
Registered: 2009-08-13
Posts: 46

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Hi, I’ve just upgraded to the new textpattern version.

However, I’ve noticed that there is absolutely no colour in the background, unlike version 4.0.8. Why is that?

Thanks!

Offline

#151 2009-09-19 22:49:45

sarah
Member
Registered: 2009-08-13
Posts: 46

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Perhaps I need to install a theme?

Offline

#152 2009-09-20 11:48:40

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Press CTRL+F5 to reload the page. Perhaps it’s caused by an old cached CSS file.
Then again, I haven’t seen anything but white as background color in TXP as far as I remember.

Offline

#153 2009-09-20 14:01:14

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

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Just noticed that using this tag incorrectly does not bring up any error message in either Testing or Debugging:

<txp:article limit="1" > – (lacks closing />

Offline

#154 2009-09-20 14:55:14

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Of course not.
The parser is built for speed. If you want to debug, use the tag trace.
The parser doesn’t know which tags must be self-closed and which can or must be used as container tags.
If I remember correctly, txp:article can be a container tag in recent TXP versions.

Offline

#155 2009-09-20 16:38:00

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

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

That’s my point, there are no error messages when in debugging mode.

Offline

#156 2009-09-20 17:56:15

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

Re: Feedback to: Textpattern CMS 4.2.0 Release Candidate: Help us test!

Jonathan, as far as I know Txp has never displayed error messages for typos like that… remember my mistake here?

(Though I admit it would be nice if it did…)

Last edited by els (2009-09-20 17:57:11)

Offline

Board footer

Powered by FluxBB