Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#169 2005-08-08 19:05:09

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: mem_glinklist: Grouped Link List

Would <code>category=”<txp:c />”</code> work?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#170 2005-08-08 19:27:52

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: mem_glinklist: Grouped Link List

no, I don’t think so. I am using this with type=“link” and I want it to show only the sub-categories that have the current category as a parent.

Unless you know how I can do this with your example.

Offline

#171 2005-08-08 19:47:59

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: mem_glinklist: Grouped Link List

Ahh. No it won’t work for “link”. Sorry about that. :(


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#172 2005-08-25 21:36:27

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: mem_glinklist: Grouped Link List

I am using mem_if_category_empty. What I would like to be able to do is have an attribute like greaterthan=“1”. So that I can put a certain number of things in the category being checked and it still comes up as empty.

For example: I have 1 article in category “Land” I use that as a category description. But I want to use something like <code><txp:mem_if_category_empty argname=“c” greaterthan=“1”>blah…<txp:else />blah…</txp:mem_if_category_empty></code> so that it will come up as empty unless I put more articles in “Land”.

Can anyone show me how I can hack this together if Manfre doesn’t want to add it as a feature?

Last edited by tinyfly (2005-08-25 21:36:48)

Offline

#173 2005-08-25 22:02:21

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: mem_glinklist: Grouped Link List

This will do in a pinch.

I changed the line (around 385) from this <code>$condition = mem_get_cat_count($type,$name)==0;</code> to this <code>$condition = mem_get_cat_count($type,$name) < 2;</code>

Offline

#174 2005-08-26 00:03:32

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_glinklist: Grouped Link List

Here’s a cleaner approach that allows you to indicate how accurate the value has to be. This probably won’t be in the plugin releases.

<pre><code>
function mem_if_category_empty($atts,$thing)
{ extract(lAtts(array( ‘type’ => ‘link’, ‘name’ => ‘’, ‘argname’ => ‘’, ‘tolerance’ => 0, ),$atts));

if (empty($name)) { if (!empty($argname)) $name = gps($argname); else return; }

if (!is_numeric($tolerance)) $tolerance = 0;

$tolerance = abs(intval($tolerance));

$count = mem_get_cat_count($type,$name) – $tolerance;

$condition = $count<=0;

return parse(EvalElse($thing, $condition));
}
</code></pre>

Offline

#175 2005-08-30 17:04:00

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: mem_glinklist: Grouped Link List

Thanks Manfre, works perfectly.

Offline

#176 2005-11-05 23:37:53

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: mem_glinklist: Grouped Link List

Hi,

I love this plugin! Thanks so much Manfre!

I do have a little problem The Uncategorized links are not working. I’m not sure if I’m the culprit or if there is a problem with the plugin. I’m running Textpattern version: 4.0.1 (r888) I read through all of the help document… was a bit confused… tried to make my mem_glinklist tag as “default” as possible though.

This is an example of the code that mem_glinklist outputs for one of my categorized links:

<code>
<div class=“mem_list”><div class=“mem_list_head”>Art Related Links</div>
<ul class=“mem_list_column”> <li> <div class=“link_title”><a href=“http://www.artsnashville.org/index.html”>Metro Nashville Arts Commission</a></div> <div class=“link_desc”></div> </li>
</ul>
</div>
</code>

This is an example of what happens to a link when it is uncategorized:

<code>
<div class=“mem_list”><div class=“mem_list_head” />
<ul class=“mem_list_column”> <li> <div class=“link_title”><a href=“http://www.photonomad.com”>Photonomad</a></div> <div class=“link_desc”>A link to Stacey Irvin’s site.</div> </li>
</ul>
</code>

The tag that calls mem_glinklist on my links page:

<code>
<txp:mem_glinklist form=“Links” columnwraptag=“ul” />
</code>

I also tried it with uncategorized=“Other” and the same thing happens.

<code>
<txp:mem_glinklist form=“Links” columnwraptag=“ul” uncategorized=“Other” />
</code>

This is the “Links” form:

<code> <li> <div class=“link_title”><txp:link /></div> <div class=“link_desc”><txp:link_description /></div> </li>
</code>

Thanks in advance and sorry if I’ve just missed something obvious.

- Stacey

Offline

#177 2005-11-15 09:56:34

Anton
Plugin Author
From: Alingsås, Sweden
Registered: 2004-11-16
Posts: 138
Website

Re: mem_glinklist: Grouped Link List

I posted this at textpattern.org earlier, but if it was unnoticed, here my question is again:

Would it be possible to exclude certain categories from the listing? I have a case where I want to list 50+ categories at once and then later in the template just one (“Other”). The problem is that Other shows up in the big listing too, not ideal..

TIA,

/Anton

Offline

#178 2005-11-15 14:03:45

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: mem_glinklist: Grouped Link List

I like to use stw_category_tree in the cases where I want specific categories to show. I’m not sure if mem_glinklist can do what you ask.

Offline

#179 2005-11-15 14:24:41

Anton
Plugin Author
From: Alingsås, Sweden
Registered: 2004-11-16
Posts: 138
Website

Re: mem_glinklist: Grouped Link List

me too. but even that plugin has exclude ability, AFAIK. the trouble is not to show what I want, but to hide a specific category. there’s a subtle difference there, in my case at least. :)

Offline

#180 2005-11-18 19:08:58

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_glinklist: Grouped Link List

@anton, I’ll add support to exclude items. It may be in the form of an tag attribute or an if tag. Not sure yet, but i’ll let you know. No eta, but adding to the to-do list.

@stacey, that appears to be a bug and will be fixed.

Offline

Board footer

Powered by FluxBB