Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2006-04-02 08:15:22

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: [plugin] [ORPHAN] glx_if: some conditional tags

Yeah, it’s so I can style them different. In fact for my section homepages I’d like an entirely different layout – including showing some articles in full. In the year list page, a simple list is fine, with a header saying this is an archive page or similar.

Offline

#98 2006-06-19 06:28:38

mhulse
Plugin Author
From: Eugene Oregon
Registered: 2005-01-21
Posts: 200

Re: [plugin] [ORPHAN] glx_if: some conditional tags

This below code did not work:

<code> <txp:if_section name=“links”>

<!— Links section. Determine if section-front: —> <txp:glx_if_section_frontpage> <p>Welcome to the links section, please use the left-hand links sub-navigation to view the content.</p> </txp:glx_if_section_frontpage>

<txp:glx_if_not_section_frontpage> <!— Not Links section-front: —> <txp:article /> </txp:glx_if_not_section_frontpage>

</txp:if_section>
</code>

I had to change the “glx_if_section_frontpage()” function (as stated on previous page) to this:

<code>
function glx_if_section_frontpage($atts, $thing)
{ global $pretext, $is_article_list; $condition = (empty($pretext[“c”]) && $is_article_list == true) ? true : false; return parse(EvalElse($thing, $condition));
}
</code>

And now I can use the code like so:

<code> <txp:if_section name=“links”> <!— Links section. Determine if section-front: —> <txp:glx_if_section_frontpage> <p>Welcome to the links section, please use the left-hand links sub-navigation to view the content.</p> <txp:else /> <!— Not Links section-front: —> <txp:article /> </txp:glx_if_section_frontpage> </txp:if_section>
</code>

I am using the latest version of TXP and the plugin.

I would prefer not to hack the plugin, but I actually like that I can use <txp:else /> inside of the tag… how hard would it be to add this functionality to all functions?

Great plugin btw! Thanks!
Cheers,
Micky

Last edited by mhulse (2006-06-19 06:30:31)

Offline

#99 2006-09-26 22:27:31

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

Re: [plugin] [ORPHAN] glx_if: some conditional tags

These really ought to be in core. I know, I know — “but you can just install the plugin.” But I always install this plugin. I even have a hacked version that remove the glx_ prefix so I can pretend like it’s already in core. That’s how much it should be in core.

Offline

#100 2006-09-27 01:34:32

alicson
Member
Registered: 2004-05-26
Posts: 465
Website

Re: [plugin] [ORPHAN] glx_if: some conditional tags

This is one of the first plugins I put in every single of my Textpattern installations also.
They’re essential tags/functions.

One nice thing about having non-standard tags is that you can then nest them with the built-in tags.


textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation

Offline

#101 2006-11-21 09:53:21

argentorange
Member
Registered: 2006-10-09
Posts: 12

Re: [plugin] [ORPHAN] glx_if: some conditional tags

Ok newbie question coming up :)

How would I use this plugin to make one of my sections take the place of “Default” and be my Front Page?

Offline

#102 2007-01-06 22:59:21

nighthawk
Archived Plugin Author
From: Frankfurt, Germany
Registered: 2005-11-05
Posts: 87
Website

Re: [plugin] [ORPHAN] glx_if: some conditional tags

Hi,
three lines of comment in your code cause the plugin to fail, killing the entire TXP system (site doesn’t respond anymore). The problem is that there were special chars in your code (see below) which got replaced by ‘?‘s. The parser stops at the first special char and doesn’t accept the rest of the plugin.

Would you mind removing these lines from your plugin/translate them into English? The rest works fine; a great help for every TXP site. Thanks!

Erroneous comments in code:
// ---- neee g?r nog utan kolla om pretext[s] ?r samma som i glx_hl
// kolla f?rst om section ?r true
// kolla sen s? att det inte ?r en article list

Offline

#103 2007-01-07 09:40:17

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,064
Website GitHub Mastodon Twitter

Re: [plugin] [ORPHAN] glx_if: some conditional tags

Are you sure that you posted this in the right thread?… They look more like glx_hl_current comments


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#104 2007-01-07 13:01:45

nighthawk
Archived Plugin Author
From: Frankfurt, Germany
Registered: 2005-11-05
Posts: 87
Website

Re: [plugin] [ORPHAN] glx_if: some conditional tags

Yep, the code certainly is in this very plugin (don’t even know the other one).

Offline

#105 2007-01-11 00:04:36

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: [plugin] [ORPHAN] glx_if: some conditional tags

nighthawk wrote:

three lines of comment in your code cause the plugin to fail, killing the entire TXP system (site doesn’t respond anymore). The problem is that there were special chars in your code (see below) which got replaced by ‘?‘s. The parser stops at the first special char and doesn’t accept the rest of the plugin.

Same prob here!

Last edited by nardo (2007-01-11 00:05:27)

Offline

#106 2007-02-05 09:21:50

azw
Member
Registered: 2007-01-29
Posts: 279

Re: [plugin] [ORPHAN] glx_if: some conditional tags

Will these conditionals work in the head section of the default page template?

Example:

<title><txp:glx_if_frontpage> <title><txp:site_name /> </txp:glx_if_frontpage />

When ever I try that, no pages on the site will display, so I assume that something goes wrong on the server when it tries to interpret the template.

Or maybe this plug-in is simply not working any more?

Also, is it possible to nest the glx conditionals inside the usual txp conditionals?

Is there an <txp:glx_else /> ?

Last edited by azw (2007-02-05 09:23:03)

Offline

#107 2007-02-16 13:49:33

gemal
Member
From: Copenhagen, Denmark
Registered: 2007-01-09
Posts: 107
Website

Re: [plugin] [ORPHAN] glx_if: some conditional tags

osei wrote:

Version: 0.7
Download: glx_if

Any chance for a:
if_prev (check if there’s a previous article
and
if_next (check if there’s a next article)
and
if_older (check if there any older articles)
and
if_newer (check if there any newer articles)

Offline

#108 2007-02-16 17:18:12

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

Re: [plugin] [ORPHAN] glx_if: some conditional tags

>gemal

This plugin, although a gem, and worthy of rolling into the core IMHO, has not been updated in a while, so I wouldn’t count on the inclusion of those features, but…

You can achieve what you want by using chh_if_data in the following way…

<txp:chh_if_data>
   <p>It appears we have older articles</p>  
   <txp:older/>
<txp:else/>
  <p>Nope! Not a sausage...</p>
</txp:chh_if_data>

This should work although I haven’t tried it. I love that damn chh_if_data.

Last edited by mrdale (2007-02-16 17:19:29)

Offline

Board footer

Powered by FluxBB