Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2008-10-17 15:25:40

maxvoltar
Member
From: Machelen, Belgium
Registered: 2007-08-16
Posts: 76
Website

Re: [plugin] [ORPHAN] chh_if_data

Nevermind, I’m such an idiot… Great work!

Last edited by maxvoltar (2008-10-17 15:32:38)


Textpattern projects: Maxvoltar, Made by Elephant, Twunch

Offline

#38 2009-02-09 17:08:18

nabrown78
Member
From: Boston, MA, USA
Registered: 2006-10-04
Posts: 291
Website

Re: [plugin] [ORPHAN] chh_if_data

Similar to some earlier comments in this thread, I’d love to be able to use this around multiple txp tags, and specify which one to check for data. In my case, I only want to check the <txp:article /> tags. The plugin code looks so short and simple, but I don’t know where to begin to achieve something like that…can anyone help? Or is there another plugin that might serve this function?

Edit: Okay, simple except for this:

$f = '/<txp:(\S+)\b(.*)(?:(?<!br )(\/))?'.chr(62).'(?(3)|(.+)<\/txp:\1>)/sU';

Any experts care to break that down?

Last edited by nabrown78 (2009-02-09 17:12:10)

Offline

#39 2009-02-09 19:34:35

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

Re: [plugin] [ORPHAN] chh_if_data

Have you tried to achieve what you want with the variable and if_variable tags?

Offline

#40 2009-02-14 15:41:01

nabrown78
Member
From: Boston, MA, USA
Registered: 2006-10-04
Posts: 291
Website

Re: [plugin] [ORPHAN] chh_if_data

Hmm…okay, I see that maybe I could output some piece of the article into a <txp:variable />, and then check for data in that variable…is that what you’re thinking? I’ll try it out.

Offline

#41 2009-02-14 19:11:37

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

Re: [plugin] [ORPHAN] chh_if_data

nabrown78 wrote:

…is that what you’re thinking?

Yes. Similar to the code in this TXP Tip.

Offline

#42 2011-02-10 16:12:53

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

Re: [plugin] [ORPHAN] chh_if_data

It should work, what’s your code?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#43 2011-02-10 16:16:06

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Re: [plugin] [ORPHAN] chh_if_data

Gracias Maniqui por responder tan rápido.
Tenía mal la sintaxis en mi código.
(Por eso borré mi mensaje, hasta que lo descubrí)
:P

Offline

#44 2011-02-14 19:45:51

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Re: [plugin] [ORPHAN] chh_if_data

Help again.
I´ve created this form but when I hide this article (or delete all text), whom calls to this form, the static texts display anyways.
Any idea?

<txp:chh_if_data>
<div class="module06">
<h2>SERVICES</h2>
<div class="contenido">
<txp:article_custom form="resume" pgonly="0" limit="1" section="services" sort="Posted asc" status="5" />
<div class="bt01"><a href="<txp:site_url />services">See all</a></div>
</div>
</div>
</txp:chh_if_data>

Thanks

Offline

#45 2011-02-14 19:56:01

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

Re: [plugin] [ORPHAN] chh_if_data

That’s because <txp:site_url /> will always return something (some ‘data’), so it will make chh_if_data to evaluate to true…
You could simple do:

<a href="/services">...

if your TXP site lives on the root of your domain.
Or:

<a href="/folder/services">...

If it lives in /folder/.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#46 2011-02-14 20:03:39

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

Re: [plugin] [ORPHAN] chh_if_data

<txp:variable name="has-services-article" value='<txp:article_custom section="services" limit="1" status="5">yes</txp:article_custom>' />

<txp:if_variable name="has-services-article" value="yes">
<div class="module06">
<h2>SERVICES</h2>
<div class="contenido">
<txp:article_custom form="resume" limit="1" section="services" sort="Posted asc" status="5" />
<div class="bt01"><a href="<txp:site_url />services">See all</a></div>
</div>
</div>
</txp:if_variable>

Last edited by els (2011-02-14 20:04:36)

Offline

#47 2011-02-14 20:14:53

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Re: [plugin] [ORPHAN] chh_if_data

Yes, You´re right. Thanks to both
I´m feeling a dumb xP
Thanks // Gracias

Offline

#48 2015-08-04 03:20:53

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,357
Website

Re: [plugin] [ORPHAN] chh_if_data

adi_if_content released.

Offline

Board footer

Powered by FluxBB