Entry Count for Categories/Subcategories?
Moderator: Thorsten
Entry Count for Categories/Subcategories?
Hi,
When you click on a top-level category that doesn't have a question, it says "No entries available" - some people might think that this means there are no entries available in the sub-categories as well, and won't bother to check them.
Is it possible to add some code that lists the sub-categories and the number of entries available in them?
I'm currently using v1.4.8 but can upgrade to a RC4 1.5.
Thanks! Love the software!
ETA: I've installed a test version of RC4 1.5 but I wanted to move the "Newest Questions" and "Ten Most Viewed" to the main template rather than the index. It was easy enough to do in v1.4.x but not so much now that the templates have been written... could someone help me out with that as well?
When you click on a top-level category that doesn't have a question, it says "No entries available" - some people might think that this means there are no entries available in the sub-categories as well, and won't bother to check them.
Is it possible to add some code that lists the sub-categories and the number of entries available in them?
I'm currently using v1.4.8 but can upgrade to a RC4 1.5.
Thanks! Love the software!
ETA: I've installed a test version of RC4 1.5 but I wanted to move the "Newest Questions" and "Ten Most Viewed" to the main template rather than the index. It was easy enough to do in v1.4.x but not so much now that the templates have been written... could someone help me out with that as well?
Hi,
you're right, the number of entries in the categories is a good idea.
About the newest questions and the TopTen:
This will be changed in 1.5.1, I've got a great patch for this problem.
bye
Thorsten
you're right, the number of entries in the categories is a good idea.
About the newest questions and the TopTen:
This will be changed in 1.5.1, I've got a great patch for this problem.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Thanks Thorsten.
to Line 25 of main.php fixed the problem for me. Then I added
and
to wherever I wanted "Newest Header" and "TopTenHeader" to appear in main.tpl
Hope that you'll consider adding the number of entries in the sub-category feature to later versions of the software!
If anyone else is impatient for a quick 'n dirty patch for this now, I found that inserting:Thorsten wrote:About the newest questions and the TopTen:
This will be changed in 1.5.1, I've got a great patch for this problem.
Code: Select all
"writeTopTenHeader" => $PMF_LANG["msgTopTen"],
"writeTopTenRow" => generateTopTen(),
"writeNewestHeader" => $PMF_LANG["msgLatestArticles"],
"writeNewestRow" => generateFiveNewest()
));
Code: Select all
<div class="content">
<div id="latest">
<h3>{writeNewestHeader}</h3>
{writeNewestRow}
</div>
</div>
Code: Select all
<div class="content">
<div id="topten">
<h3>{writeTopTenHeader}</h3>
{writeTopTenRow}
</div>
</div>
Hope that you'll consider adding the number of entries in the sub-category feature to later versions of the software!
Mhmm, what do you exactly mean by "inserting to Line 25 "
In line 25 i have
Should i replace that with what you posted?. I have tryed many ways but can't get it working, i'm doing something wrong.
Thanks for your help
In line 25 i have
Code: Select all
$tpl->includeTemplate('writeContent', 'index');
Thanks for your help
Hi,
main.php has to look like this:
bye
Thorsten
main.php has to look like this:
Code: Select all
<?php
/**
* $Id: main.php,v 1.2.2.2 2005/08/24 13:36:27 thorstenr Exp $
*
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @since 2002-08-23
* @copyright (c) 2001-2005 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the 'License'); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an 'AS IS'
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
$tpl->processTemplate ('writeContent', array(
'writeTopTenHeader' => $PMF_LANG['msgTopTen'],
'writeTopTenRow' => generateTopTen($LANGCODE),
'writeNewestHeader' => $PMF_LANG['msgLatestArticles'],
'writeNewestRow' => generateFiveNewest($LANGCODE),
'writeNewsHeader' => $PMF_CONF['title'].$PMF_LANG['msgNews'],
'writeNews' => generateNews($LANGCODE),
'writeNumberOfArticles' => $PMF_LANG['msgHomeThereAre'].generateNumberOfArticles().$PMF_LANG['msgHomeArticlesOnline']));
$tpl->includeTemplate('writeContent', 'index');
?>
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Hi Alberto,
what patch do you want to see with a top-level category with no entries?
bye
Thorsten
what patch do you want to see with a top-level category with no entries?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Entry Count for Categories/Subcategories?
I hope i'm talking about the same thing and that my english isn't so bad
the sub-category with the number of entries.
btw, great program!
Best Regards
Vanessa wrote: ...
Is it possible to add some code that lists the sub-categories and the number of entries available in them?
...
so instead to display "no entries" on the top-level category it will displayThorsten wrote: ...
you're right, the number of entries in the categories is a good idea.
...
the sub-category with the number of entries.
btw, great program!
Best Regards
workaround for "no entries"
I simply did like this:
http://www.webyog.com/faq/category24.html
http://www.webyog.com/faq/category24.html
Hi Vanessa,
we introduced this in 1.5.5.
bye
Thorsten
we introduced this in 1.5.5.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
just update ...
@vanessa
what I did with 1.5.0-1.5.4 was simply to add one single article to each empty catetory. The article had a header but no body!
But I just deleted these 'dummy' entries since the FAQ system itself now handles it OK.
what I did with 1.5.0-1.5.4 was simply to add one single article to each empty catetory. The article had a header but no body!
But I just deleted these 'dummy' entries since the FAQ system itself now handles it OK.