Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] glx_if: some conditional tags
hehe, always fun to do something ppl appreciate and your new idea wouldnt be to much work to do, i see what i can do with it tomorrow.
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
> osei wrote:
> hehe, always fun to do something ppl appreciate and your new idea wouldnt be to much work to do, i see what i can do with it tomorrow.
you are a darling. ‘looking forward to that one, too…
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Great plugin, but I have a small problem:
Using the if_section_frontpage
tags work fine, but when using if_category_list
tag, I get the following error:
Warning: Missing argument 2 for glx_if_category_list() in /home/username/public_html/textpattern/publish.php(769) : eval()’d code on line 2013
Liberal. Geek.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
hmm, how do you use the tag? I can reproduce the same error when I don´t end the tag. for example only <code><txp:glx_if_category_list /></code> and make sure it is spelled correctly at the end or else it would be occur in a error you describe too.
You have to use it like below
<code>
<txp:glx_if_category_list>
<p>Category list</p>
</txp:glx_if_category_list>
</code>
Hope this could be of help.
Johan Nilsson
Offline
#17 2004-11-01 08:03:36
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [plugin] [ORPHAN] glx_if: some conditional tags
> alicson wrote:
>so you could have “this article is filed in thoughts”
but if it has no category, then it wouldn’t print the “this article….”
^ that’s what i’m really looking to be able to do.
It’s an old post so I don’t know if it will be useful, but first thought is you could combine the plugin as it is with pseudo class :before
Anyone tried this ?
Last edited by davidm (2004-11-01 08:03:50)
.: Retired :.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
New version 0.6.1 now includes
- glx_if_comments_count
With this tag you have to use the attributes <code>operator</code> and <code>value</code>
For the 3 above example lee requested use it like this
0 comments
<code>
<txp:glx_if_comments_count operator=“equal_to” value=“0”>
<p>No comments yet, you could be the first.</p>
</txp:glx_if_comments_eq>
</code>
1 comment
<code>
<txp:glx_if_comments_count operator=“equal_to” value=“1”>
<p>There is only one comment</p>
</txp:glx_if_comments_eq>
</code>
More than 2 comments
<code>
<txp:glx_if_comments_count operator=“greater_than” value=“2”>
<p>There are more than two comments</p>
</txp:glx_if_comments_eq>
</code>
Values that work with operator is
- equal_to
- not_equal_to
- less_than
- greater_than
- less_than_or_equal_to
- greater_than_or_equal_to
Edit: I renamed the tag glx_if_comments_eq to glx_if_comments_count, that´s the only diff from 0.6 and 0.6.1
Last edited by osei (2004-11-01 14:04:38)
Johan Nilsson
Offline
#19 2004-11-01 14:50:52
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Brilliant brilliant brilliant. Loads of appreciation coming your way.
Lee
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
thanks, now i just hope it will work too :D
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
johan, i love this plugin! and the ‘glx_if_not_frontpage’ is awesome.
i know there was reference made that it “is the same as ‘if_individual_article’” but i couldn’t get that to work and this is so much more universal. i would love to see the if_section_frontpage’s counter part ‘glx_if_not_section_frontpage’
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
jase: how are you using glx_if_not_frontpage? :)
and have a look at this version and see if glx_if_not_section_frontpage works like you want it too. or describe how you want it to work and i see what i could do.
Last edited by osei (2004-11-01 19:14:09)
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
johan,
i have forms set up to accommodate header and footer includes
sample page code
< txp:output_form form=“template_header” / >
< txp:article limit=“1” / >
< txp:output_form form=“template_footer” / >
and in template_header, i’m loading a “home” link if not on “frontpage”
< txp:glx_if_not_frontpage >
< div id=“crumb”>< a href=”/” >home< /a >< /div >
< /txp:glx_if_not_frontpage >
thanks for the new version, i installed it and tried this on the page template for a section:
—————
< txp:glx_if_section_frontpage >
< h4 class=“archive” >photo story archives< /h4 >
< txp:mdn_section_archive section=“archive_photos” headclass=“archive-cal” ulclass=“archive” / >
< /txp:glx_if_section_frontpage >
< txp:glx_if_not_section_frontpage >
< txp:article form=“photo_blog” limit=1 / >
< /txp:glx_if_not_section_frontpage >
—————
but all i see with that is the archive list, even when the url is pointing to an article (clean url mode)
basically, i’m trying to get away from having to make “fake” sections to house an archive list (index page of sorts) for each section and just make the section’s page template distinguish between displaying the section root, or an article.
am i approaching this all wrong?
Last edited by jase (2004-11-01 20:07:14)
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Jase see if this version works, or else i give up on that tag :)
_basically, i’m trying to get away from having to make “fake
Johan Nilsson
Offline