Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2009-03-25 20:07:13

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

Re: Come on, make if_data core

Yes, I know I’m repeating myself :)

<txp:variable name="if_caption" value='<txp:upm_img_caption />' />

<div class="imgInfo"><cite><txp:upm_img_alt /></cite><txp:if_variable name="if_caption" value=""><txp:else />, <txp:upm_img_caption /></txp:if_variable></div>

Offline

#26 2009-03-25 20:24:03

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Come on, make if_data core

Forgive me Els – :)

chh_if_data version
<div class="imgInfo"><cite><txp:upm_img_alt /></cite><txp:chh_if_data>, <txp:upm_img_caption /></txp:chh_if_data></div>

vs.

if_variable version
<txp:variable name="if_caption" value='<txp:upm_img_caption />' />

<div class="imgInfo"><cite><txp:upm_img_alt /></cite><txp:if_variable name="if_caption" value=""><txp:else />, <txp:upm_img_caption /></txp:if_variable></div>

Seems to me that chh_if_data would take this round.

:)


T

Last edited by renobird (2009-03-25 20:24:38)

Offline

#27 2009-03-25 22:55:35

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

Re: Come on, make if_data core

Bing! Yep I beleive no-one has a problem with using if variable per-se.

It’s just a big, ugly chunk of code to use in numerous places on your site. And no-one has yet addressed the issue of precedent. That is, if we add an ulra-specific tag like if_article_image why not add a tag that is actually 900 times more useful and can still handle the initial problem? But I’m officially out of breath, here.

I’ll continue to install chh_if_data till it doesn’t work, then I’ll use twice the code with the ugly hack that uses the if_variable tag. YAY!

Last edited by mrdale (2009-03-25 22:57:22)

Offline

#28 2009-03-25 23:47:53

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

Re: Come on, make if_data core

renobird wrote:

Forgive me Els – :)

Of course :) I just love the variable and if_variable tags so much that I can’t stop talking about them… ;)

Offline

Board footer

Powered by FluxBB