Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2004-11-01 07:57:17

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

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

#18 2004-11-01 13:48:15

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

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

#20 2004-11-01 14:54:57

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

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

thanks, now i just hope it will work too :D


Johan Nilsson

Offline

#21 2004-11-01 16:54:27

jase
Member
Registered: 2004-10-25
Posts: 10
Website

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

#22 2004-11-01 19:13:37

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

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

#23 2004-11-01 20:06:55

jase
Member
Registered: 2004-10-25
Posts: 10
Website

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

#24 2004-11-03 13:35:07

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

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

#25 2004-11-07 20:13:42

jase
Member
Registered: 2004-10-25
Posts: 10
Website

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

hi johan,

i apologize for my tardiness in reply… things got a bit busy lately.

i installed that new vesion, thank you, but i still could not get glx_if_not_section_frontpage to work right. i have since persued another route and surrendered the idea of tidy sectioning…for now. thanks for your help. this plugin makes the other things i’ve done so much easier.

———

just as a side note, i added this to the function list for your plugin to account for certain things i was trying to do on my search page in the event of a search NOT having been attempted:

function *glx_if_not_search*($atts, $thing)
{ global $pretext; return (empty($pretext[“q”])) ? parse($thing) : “”;
}

Offline

#26 2004-11-19 18:01:02

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

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

thank you jase! i was just about to ask for this feature!

and thanks osei, for this indispensible plugin in the first place.


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

Offline

#27 2004-11-21 04:40:24

kevinashworth
Member
From: Massachusetts
Registered: 2004-07-30
Posts: 26
Website

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

I’m confused: Let’s say you have a section page with lots of articles, some with comments closed and some with comments that are disabled because time has elapsed according to site preferences. Is there a way to treat these differently? Is there a way to deal with disabled comments instead of just with closed comments?

Offline

#28 2004-11-21 07:29:17

sivni
Gone, but not forgotten
From: Norway, Hamar
Registered: 2004-10-27
Posts: 39

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

osei, your current 0.6.3 version made the glx_if_not_section_frontpage work. Awsome!

he he. I guessed the url for it. Sorry if that was a bit rude.

Offline

#29 2004-12-20 23:32:28

garrett
New Member
From: Brooklyn, NY
Registered: 2004-12-20
Posts: 3
Website

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

Just a note—this plugin does not handle DB name prefixes. I had problems until I dug through it and realized you specify table names without adding the PFX definition before them.

Example:

<code>
$rs = getRow(“SELECT COUNT AS num_of_comments FROM txp_discuss LEFT JOIN textpattern ON txp_discuss.parentid = textpattern.ID WHERE textpattern.ID = $id AND textpattern.Annotate = 0”);
</code>

Should be:

<code>
$rs = getRow(“SELECT COUNT AS num_of_comments FROM “.PFX.“txp_discuss LEFT JOIN “.PFX.“textpattern ON “.PFX.“txp_discuss.parentid = “.PFX.“textpattern.ID WHERE “.PFX.“textpattern.ID = $id AND “.PFX.“textpattern.Annotate = 0”);
</code>

This needs to be done in each of your SQL queries otherwise anyone who specifies db prefixes won’t be able to use your stuff accurately.

Edit: You actually only need to do it in that one case because you use safe_row() and such for the other queries which adds the prefix properly.

Hope this helps, great plugin.

Last edited by garrett (2004-12-20 23:37:01)

Offline

#30 2004-12-21 07:39:25

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

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

garrett, thanks for pointing that out, i update the plugin later and will then add jases new function to it aswell.


Johan Nilsson

Offline

Board footer

Powered by FluxBB