Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#76 2005-08-11 20:15:42
- xmerokox
- New Member

- Registered: 2005-08-09
- Posts: 3
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Yes, it’s a recent download. It’s fixed now since I’ve edited the plug-in with the code posted by <b>osei thêta</b>. Thanks for your help! :D
However, there is still one problem. On my frontpage of the site, stuff for the section frontpage still shows up.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
The glx_if plug in looks very interesting, giving you simple control over some of the default parameters. Essential really, if you want a site with some individualised pages – not a site where every page uses the same template.
However, the options in the plug in dont give me what I need. I need something like if_article_is_called_then_blahblahblah
Presumably this could be added to the plug in quite easily?
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Isnt this available as a generic tag?
<a href=“http://textpattern.net/wiki/index.php?title=Txp:if_individual_article”>if_individual_article</a>
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Updated to 0.6.6
I just updated this plugin to 0.6.6, this update comes with zero documentation, this is just a test update to see that this plugin stil works with the latest stable release. (Textpattern 4.0.1) Please report bugs or fixes back to me.
get 0.7 instead: download link
Last edited by osei (2005-10-15 15:35:55)
Johan Nilsson
Offline
#80 2005-09-30 04:46:41
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Johan
I have installed 0.6.6 on a TXP 4.0.1 site (std r888) and have tested the following tags of the plugin:
- if_frontpage
- if_section_frontpage
- if_not_section_frontpage
- if_category_list
All of these seem to work just fine :)
SH
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Thanks for updating! No problems as of yet…….
Jamie
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
if_not_section_frontpage no longer works for me R1090
OK so it works gotta remember the glx_ prefix.
stoopid, stoopid, stoopid.
Thanks Osei
Last edited by mrdale (2005-11-14 23:26:47)
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
johan – I added a few functions to the plugin for my site (I was using 0.6.4, so if these are already in there sorry!).. I needed additional functionality for paging – if you would like the code, here it is…
function glx_if_first_page($atts, $thing){
global $pretext;
return (empty($pretext[“pg”]) || $pretext[“pg”] == “1”) ? parse($thing) : “”;
}
function glx_if_not_first_page($atts, $thing){
global $pretext;
return (!empty($pretext[“pg”]) && $pretext[“pg”] != “1”) ? parse($thing) : “”;
}
and also I added and if not category list
function glx_if_not_category_list($atts, $thing)
{
global $pretext, $is_article_list;
return (empty($pretext[“c”]) && $is_article_list == true) ? parse($thing) : “”;
}
feel free to add it, thanks!
-rbe
sorry for the edit, the code tags got messed up
Last edited by rbe (2006-02-23 17:59:31)
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Hi guys,
I don’t think certain of the conditionals are working as expected. The code I have at present consists of:
<code>
<txp:glx_if_comments_open><txp:comments_invite/></txp:glx_if_comments_open>
<txp:glx_if_comments_closed_comments><txp:comments_count />Comments</txp:glx_if_comments_closed_comments>
<txp:glx_if_comments_closed ignorecomments=“false”>Comments are closed for this article</txp:glx_if_comments_closed>
</code>
<br />
The output on the main page is either “Comment [1]” or “Comments are closed for this article” which is correct. However when going into perma-view, the output when a comment has been left is “” (i.e. there is no output). I would like the output to be “1 Comment”.
<br />
To see an example, visit my site
Any help appreciated (using the latest version of the plugin).
Saj
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
But what version of TXP are you using? I’m not sure you need this plug-in. Check out the existing “if_comments” native TXP tags.
Last edited by thebombsite (2006-03-18 02:29:11)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
I’m currently using version Textpattern · 4.0.3.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Did you look at the “if_comments” conditionals in the link I gave above?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Can anyone explain how <code>glx_if_section_frontpage</code> and <code>glx_if_not_section_frontpage</code> differ from <code><txp:if_individual_article></code> and <code><txp:if_article_list></code>?
I ask because the rss_suparchive plugin generates root/section/year archive pages within a section and I’d like to distinguish these pages in my page template from the section frontpage. I thought this plugin might do that, but the root/section/year URLs still display as if they were the section frontpage.
Can anyone suggest a way to use/hack glx_if to get that result?
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Hmm, it seems that this plugin doesn’t recognise /section/?c=categoryname urls as being different from the section frontpage either.
Can anyone confirm that being the case, or does it suggest I’m using it wrong somehow?
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Well <code><txp:if_individual_article></code> and <code><txp:if_article_list></code> can be used in any section not just the “default” section which means they don’t necessarily indicate THE front-page, but they would point to the front or back page of the section they were being used in. On the other hand the <code><txp:if_section name=”“></txp:if_section></code> tags would target the default section so we are half-way there. If you combined that with the other tags like so:-
<code>
<txp:if_section name=”“>
<txp:if_article_list>
This is THE front-page
<txp:else />
This is the comment page of the default section
</txp:if_article_list>
</txp:if_section></code>
<br />
you can target THE front-page specifically. Did that make any sense?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline