Page 1 of 1
Show only certain categories in CompanyDirectory?
Posted: Sun Feb 13, 2011 11:59 pm
by beherenow_uk
Hi,
Using CompanyDirectory, is it possible to show only certain categories of companies on different pages in the categorylist view?
Something like {CompanyDirectory action="categorylist" category="Category 1, Category2, Category5" }
would show:
Page 1
• Category1
• Category2
• Category5
And {CompanyDirectory action="categorylist" category="Category3, Category4, Category6" } on page 2 would show:
Page 2
• Category3
• Category4
• Category6
I know this can be done in the new module using browsecategory, and then specifying which ones to show in a comma seperated list. But i'd like to try and achieve this with company directory too.
Any help would be much appreciated.
Thanks.
Re: Show only certain categories in CompanyDirectory?
Posted: Mon Feb 14, 2011 6:05 am
by Dr.CSS
I think the category call is in the Help...
Re: Show only certain categories in CompanyDirectory?
Posted: Mon Feb 14, 2011 9:36 am
by beherenow_uk
Well, there is a selectcategory="0" param, but that shows all of the categories with a submit button. This is a perfect solution apart from I'd like to specify which categories show up in that drop down list.
I tried this alongside the category="" param but it didn't work as I hoped. Perhaps there's something that I've missed?
thanks.
Re: Show only certain categories in CompanyDirectory?
Posted: Mon Feb 14, 2011 8:06 pm
by Dr.CSS
It looks like selectcategory is for a drop down or something where you can select what category you want or ?...
(optional) selectcategory="0" - If this parameter is set, then a form will be generated allowing users to interactively filter company records on a single category. This flag should not be used in conjunction with the 'category' parameter.
(optional) category="" - When used in the default summary mode, this parameter, which should match the name of an existing category will be used to display only those companies that are in that category. (a comma seperated list can be supplied).
Re: Show only certain categories in CompanyDirectory?
Posted: Mon Feb 14, 2011 11:28 pm
by beherenow_uk
Yes you're right, the selectcat param shows the dropdown with all categories in the dropdown and the 'category' param allows you to show only certain categories, bur not in a dropdown. Putting these together would seemingly be perfect but unfortunately u can't use them together.
The result in trying to achieve is like this:
http://www.qs-csa.co.uk/subpage.cfm?pageName=projects
Perhaps I should ask for commercial help on this one? I have a little bit of budget, so if you could maybe quote me Dr CSS?, or perhaps point me towards another dev that could? Really need to get the same functionality as the URL I show. CompanyDirectory is almost perfect for my needs, just this last issue is slightly beyond my knowledge.
I have a test site I can give access to if required.
Thanks!
Re: Show only certain categories in CompanyDirectory?
Posted: Tue Feb 15, 2011 2:38 am
by jmcgin51
I think you might have to build the dropdown manually, based on your filtered list of companies from the CD call
something like this (UNTESTED)
{capture assign='filtered_list'}{cms_module module='CompanyDirectory' category='1,2,3,4,5'}{/capture}
then parse the resulting $filtered_list array using a foreach statement and putting each item into a dynamic <select> list.
Obviously sponsoring the feature would be more elegant, but if you need to get this done now, I think it can be done as I've outlined above.