I am hoping that this can be done.
I would like to use the news module to do 3 different things on the site I am building. This means having 3 categories and several sub categories to handle the task. So far, no problems.
Where I can see the problems starting is that I want the 3 categories to list separately in the nav menu and show the sub cats when that category is expanded, as per what the nav system is doing at the moment.
The site is http://gemfields.org.au . It is still basically a shell at the moment to test everything live. It will at least show which nav menu I am using.
I have gone through the help section of the module and the documentation on the news module but could not see anything regarding showing the categories or sub cats in the menu bar.
Is this possible and would it be able to automatically add sub cats as they are included?
Thanks for your time.
Separating News module categories - is this possible?
Re: Separating News module categories - is this possible?
It might be tricky to put it into the menu manager. If you went the more "static" menu route using a GCB or UDT it should be relatively(see problem below) easy. If you use the same class structure the css for hiding and displaying is already done.
Yes when you add subcategories they will automatically showup in the menu.
Problem: I have reported a bug in the news module that when you are browse a subset of categorys (which is what you want to do) when you select the specific category all the articles in the subset are displayed not just the specific category.
Here is the bug report and how to fix it: http://dev.cmsmadesimple.org/bug/view/3526
Warning: you will be hacking the files which will limit/cease any help we can give you on this board. Proceed at your own risk
Jeff
Yes when you add subcategories they will automatically showup in the menu.
Problem: I have reported a bug in the news module that when you are browse a subset of categorys (which is what you want to do) when you select the specific category all the articles in the subset are displayed not just the specific category.
Here is the bug report and how to fix it: http://dev.cmsmadesimple.org/bug/view/3526
Warning: you will be hacking the files which will limit/cease any help we can give you on this board. Proceed at your own risk
Jeff
Re: Separating News module categories - is this possible?
Thanks for the reply.
That was my line of thought also. Was hoping someone had an easy fix.
I really don't want to start hacking the code as I am basically doing a love job for this community and there are no funds for ongoing support. I will update the script for them, so I don't want to start altering code every time.
I am going to use cataloger as well for something else on the site but seem to be running into the same problem again.
Back to the think tank. This and FEU self registration is the only thing holding back the finishing of this site. Will find a way somehow.
That was my line of thought also. Was hoping someone had an easy fix.
I really don't want to start hacking the code as I am basically doing a love job for this community and there are no funds for ongoing support. I will update the script for them, so I don't want to start altering code every time.
I am going to use cataloger as well for something else on the site but seem to be running into the same problem again.
Back to the think tank. This and FEU self registration is the only thing holding back the finishing of this site. Will find a way somehow.
Re: Separating News module categories - is this possible?
I check on IRC to see if i can find out when the bug will be fixed.
Have you started another post about your problems with Self Registration?
Have you started another post about your problems with Self Registration?
Re: Separating News module categories - is this possible?
Thanks again for your time. Much appreciated.
No I haven't yet. I am going to stick with trying to work it out myself on the test server for a while. I think it is my misunderstanding of the group permissions that is mucking me up. There may be a post in a few days. See how I go.ajprog wrote: Have you started another post about your problems with Self Registration?
Re: Separating News module categories - is this possible?
Thanks for the bug report/suggested fix ajprog. I had the same problem, ie when clicking on a sub-category, the News module lists all the articles from the nominated top level category.
I'm not keen on hacking files so created this workaround using the browsecat template and a UDT (until it's fixed properly) that replaces the top level category name with the current node category name in the generated link.
1. Create a UDT called 'topcat':
2. Change the browsecat template to:
Now when a sub-category link is clicked, only a summary the news articles from that category are displayed.
HTH
psy
I'm not keen on hacking files so created this workaround using the browsecat template and a UDT (until it's fixed properly) that replaces the top level category name with the current node category name in the generated link.
1. Create a UDT called 'topcat':
Code: Select all
// finds the top News category to remove from the news category auto-generated URL
global $gCms;
$smarty = &$gCms->GetSmarty();
if ($params['nodeurl'] && $params['nodeurl'] != '')
{
$arr = parse_url($params['nodeurl']);
$arr = explode ("=",$arr['query']);
$arr = explode("&",$arr[2]);
$smarty->assign ( "topcat", $arr[0] );
}
else
{
return;
}
Code: Select all
{if $count > 0}
<ul class="list1">
{foreach from=$cats item=node}
{if $node.depth > $node.prevdepth}
{repeat string="<ul>" times=$node.depth-$node.prevdepth}
{elseif $node.depth < $node.prevdepth}
{repeat string="</li></ul>" times=$node.prevdepth-$node.depth}
</li>
{elseif $node.index > 0}</li>
{/if}
<li class="newscategory">
{if $node.count > 0}
{* call the topcat UDT *}
{topcat nodeurl=$node.url}
{* assign the name of this category to a var *}
{assign var='thiscat' value=$node.news_category_name|escape:htmlall}
{* replace the top level category name with this category name *}
<a href="{$node.url|replace:$topcat:$thiscat}">{$node.news_category_name}</a> ({$node.count})
{else}
<span>{$node.news_category_name} (0)</span>{/if}
{/foreach}
{repeat string="</li></ul>" times=$node.depth-1}</li>
</ul>
{/if}
HTH
psy