Phoca Documentation and Multiple Article Categories

Phoca Documentation - creating documentation in Joomla! CMS
propolis
Phoca Member
Phoca Member
Posts: 49
Joined: 09 Sep 2009, 09:17

Phoca Documentation and Multiple Article Categories

Post by propolis »

Hi,

I use an extension CW Multicats that allows me to add an article to more than one category.

Now I installed Phoca Documentation (which is perfect for what I want it to do) and when I look at the categories, it only lists the first article that's listed in the article category section. Its ignores the second category - does phoca documentation uses its own database query to get an article list?

Eddie :)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Documentation and Multiple Article Categories

Post by Jan »

Hi, no, it just load all articles which are included in asked category :idea:

Jan
If you find Phoca extensions useful, please support the project
propolis
Phoca Member
Phoca Member
Posts: 49
Joined: 09 Sep 2009, 09:17

Re: Phoca Documentation and Multiple Article Categories

Post by propolis »

Hi Jan,

Thanks for the reply. Can you please verify what I have is correct so that I then can rule out the problem with Phoca Documentation.

One of the chaps from the sailing community emailed me the following but not sure if its relevant and if its pointing to Phoca Documentation or 3rd party software:

The point is, that it load articles with condition ...WHERE catid = $searched_category_id... which leads to fact that if catid is with multicategories lets say “2,6,23”, it will interpret it as integer – therefore just “2”, therefore it loads only from first assigned category. It will be needed to change the model of database query to WHERE FIND_IN_SET($catid, catid) ..which will search the searched_category_id in all assigned categories.
That is my guess.


Below setup on my site.

Here is my Joomla Categories:
Image


Here is my Phoca Documentation Categories:
Image


Here is my 1st article category selection:
Image


Here is my 2nd article category selection:
Image


Here is the list in my news section on my site:
Image


When I click on European Class News, this is what I see (this belongs to 2 categories):
Image


When I click on SFS News, this is what I see (this article belongs to 2 categories):
Image


When I click on All News, this is what I see:
Image

'All News' is the second Category for the 2 articles, if I swap the order around of the categories in the articles, then All News works, but not the 2 secondary categories.

Its as if it only recognizes the first article.

Thanks

Eddie
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Documentation and Multiple Article Categories

Post by Jan »

Hmm, I think, when you use some external extension for this, the code needs to be customized for it, I think :idea:

Jan
If you find Phoca extensions useful, please support the project
propolis
Phoca Member
Phoca Member
Posts: 49
Joined: 09 Sep 2009, 09:17

Re: Phoca Documentation and Multiple Article Categories

Post by propolis »

Hi Jan,

Thanks for the reply.

I am still not sure if this is an issue with Phoca Documentation or not.

Does this mean Phoca Documentation cant read Multiple Categories?

Thanks

Eddie
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Documentation and Multiple Article Categories

Post by Jan »

Hi, as written above, Phoca Documentation reads the Joomla! categories and displays articles which belong to this category. If you are using some external extension for some specific feature, then such needs to be solved in external extension.
If you find Phoca extensions useful, please support the project
propolis
Phoca Member
Phoca Member
Posts: 49
Joined: 09 Sep 2009, 09:17

Re: Phoca Documentation and Multiple Article Categories

Post by propolis »

Hi Jan,

Going back and forth between Phoca Documentation and 3rd party software this is the outcome:

Trying 2 different extensions to allow me to use Multiple categories, Phoca Documentation still would not read multiple categories. As this is now 2 extensions, I started looking at Phoca Documentation again and with some help from a friend we have done the following:

In 'components/com_phocadocumentation/models' we had to modify the category.php file :( and then it all worked :D .

See below changes that were made:

Code: Select all

//$wheres[]	= ' c.catid= '.(int)$categoryId;        
$wheres[]	= ' FIND_IN_SET('.(int)$categoryId.',c.catid)';
Can you please verify that the changes we made wont break anything else in Phoca Documentation

Thanks

Eddie
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Documentation and Multiple Article Categories

Post by Jan »

Hi, thank you for the info, for now I cannot confirm it as I need to do tests :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply