Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] glx_if: some conditional tags
errrr, I wish it did ;)
but maybe I didn’t explain myself too well in the first place
I understand how <code><if_section name=”“></code> could be useful, but what I’m really after is being able to diiferentiate in my template between these two URLs
- root/section aka the section frontpage (?)
- root/section/year this is still a list page (generated by rss_suparchive) but its not the section frontpage, so I was hoping the glx_if plugin could spot the difference.
does that make any more sense?
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Is there any reason why you can’t send the year list from the plug-in to it’s own section and template?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
It’s possible to do that without rss_suparchive, but I understood the point of the plugin (or at least it’s main strength that I could see) was that you could create (yearly & monthly) archives within each section with nice semantic URLs.
In a site with many different sections – each with different content types – which all need archiving, I think its a bit clunky to have to stuff lots of different content within a single distinct ‘archive’ section. But maybe I’m on my own there, cos this is becoming a bit of a goose chase for me ;)
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
You just be careful those geese aren’t sneezing. ;) It’s been a while since I stopped using rss_suparchive but I’m sure there would be a way to create a link to the archive which only showed a specific /section/year listing. I know it could be done for months. Would something like that suit?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
oh yep, you can create those URLs easy enough, but as they generate list pages they have to use the same template as the default section page. My dream is that one day I will be able to give each scenario a different layout! – hence I’ve wandered hopefully into the glx plugin thread
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Well as you said earlier, as they are both lists, I don’t think this plug-in can tell the difference. So explain to me why you need the segregation. Is it because you don’t want them both appearing at the same time or is it because you want to apply a different style/format?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
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
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
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
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
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
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