Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
Re: resolved: category cloud that leads to articles ? I checked plugins
Offline
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
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
Re: resolved: category cloud that leads to articles ? I checked plugins
etc wrote #280447:
If you use only
Category1
(orCategory2
) 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
Offline
Offline
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
Re: resolved: category cloud that leads to articles ? I checked plugins
I redownloaded it three times. Copied and pasted 3 times, same error.
Offline
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