Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2014-04-28 13:59:18

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: resolved: category cloud that leads to articles ? I checked plugins

@GugUser, I have added yours, and it still returns empty categories.

I moved both to the top of the page so scrolling to the bottom isn’t necessary.

Offline

#14 2014-04-28 14:16:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,172
Website GitHub Mastodon Twitter

Re: resolved: category cloud that leads to articles ? I checked plugins

Following Oleg’s suggestion (good catch Oleg), you can try

<txp:category_list wraptag="" break=",">
<txp:variable name="hasarticles" value='<txp:article_custom category=''<txp:category />'' limit="1" />' />
<txp:if_variable name="hasarticles" value="">
<txp:else />
<txp:category title="1" link="1" />
</txp:if_variable>
</txp:category_list>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#15 2014-04-28 14:18:27

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: resolved: category cloud that leads to articles ? I checked plugins

JimJoe wrote #280441:

@GugUser, I have added yours, and it still returns empty categories.

In my sites it works fine, since years.

Offline

#16 2014-04-28 14:33:04

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: resolved: category cloud that leads to articles ? I checked plugins

GugUser wrote #280444:

In my sites it works fine, since years.

I have no idea why that is.

Offline

#17 2014-04-28 14:36:00

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: resolved: category cloud that leads to articles ? I checked plugins

GugUser wrote #280440:

I meant to replace the container tag variable with the single tag variable.

This works and filters the categories with articles.

<txp:variable name="hasarticles" value='<txp:article_custom category=''<txp:category />'' limit="1" />' />...

I recopied it, it is the middle one on my site at the top of the page. Still shows empty categories.

Offline

#18 2014-04-28 14:36:48

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

Re: resolved: category cloud that leads to articles ? I checked plugins

JimJoe wrote #280439:

Page loading time is slower as you mention. Only returns one article, but I hesitate in increasing the limit to all of the articles.

If you use only Category1 (or Category2) for classification, this should be faster (and produces a weighted cloud):

<txp:etc_query wraptag="p" break=","
	data="SELECT name, title, count
	FROM (SELECT COUNT(*) count, Category1 FROM textpattern WHERE Status=4 GROUP BY Category1 HAVING count!=0) c
	JOIN txp_category ON name=c.Category1 WHERE type='article'
	ORDER BY title"
>
	<a href='<txp:category name="{name?}" section="" url="1" />' style="font-size:{$max({count?}|5)./5}em">
		{$htmlspecialchars({title?})}
	</a>[{count?}]
</txp:etc_query>

Offline

#19 2014-04-28 14:42:46

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: resolved: category cloud that leads to articles ? I checked plugins

etc wrote #280447:

If you use only Category1 (or Category2) for classification, this should be faster (and produces a weighted cloud):

<txp:etc_query wraptag="p" break=","...

I have labelled thiso ne on my site as ‘Third One’. I get a blank area, no listing.

Offline

#20 2014-04-28 14:45:15

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

Re: resolved: category cloud that leads to articles ? I checked plugins

JimJoe wrote #280448:

I have labelled thiso ne on my site as ‘Third One’. I get a blank area, no listing.

Have you installed etc_query (it’s a plugin)?

Offline

#21 2014-04-28 14:56:05

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: resolved: category cloud that leads to articles ? I checked plugins

etc wrote #280449:

Have you installed etc_query (it’s a plugin)?

I went to that link, downloaded, and pasted it into the Install Plugin part of admin and it gave an error. Said it was a ‘badly formed or empty plugin code’.

Offline

#22 2014-04-28 15:03:34

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

Re: resolved: category cloud that leads to articles ? I checked plugins

JimJoe wrote #280450:

I went to that link, downloaded, and pasted it into the Install Plugin part of admin and it gave an error. Said it was a ‘badly formed or empty plugin code’.

Weird, I’ve just checked, and it went smooth. Could it be a download problem?

Offline

#23 2014-04-28 15:09:59

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: resolved: category cloud that leads to articles ? I checked plugins

I redownloaded it three times. Copied and pasted 3 times, same error.

Offline

#24 2014-04-28 15:16:30

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: resolved: category cloud that leads to articles ? I checked plugins

I went to another of my textpattern web sites and tried to install it there, same error.

Offline

Board footer

Powered by FluxBB