11 years ago
7
Topic

Hi all,

i want to set two or more categories for an article. For now i use the CW Multicategories component which works perfektly for the standart Joomla article view, but not for the Seblod article view. 

I've tried to save multiple categories with the "category" and the "select - dynamic" type, but there is a restriction which won't allow me to save multiple category id's inside the Standart -> Article -> catid. 

I tested the functionality of the CW Multicategories component if the id's are written directly in the database, it works. So, all i need is to make Seblod save multiple entries. 

My Question: How can i remove the restriction which won't allow me to save multiple category id's?

I know of the possibility to add an additional field called category that has another storage (for example: standard -> article -> category), then use a multi-select field in order to select several categories and use a search type in order to retrieve these articles, but that is not a solution for this project.

greetings, hauger

Get a Book for SEBLOD
11 years ago
2
Level 1

Hello @hauger


sorry, it's not possible to use multicategories because Joomla is not multi categories. If you stay on Joomla standard fields, you can only do what Joomla can do.


SEBLOD is multicategories, and you have describe well how to to that. It's the only way.


Regards.

Lionel

11 years ago
1
Level 2

@Lionel

I know that it's possible to use multiple categories in Joomla by standard, but I extended the Joomla categories and i works perfectly on the Joomla layer. The only problem is the restiction of Seblod to save multiple categories. I'm 99.9% sure that there is such a restiction, because the multi categories function works on the Joomla article view and it also works by direct insert into the datatbase.

The only thing i need to know is, where this restiction is located to remove oder rewrite it.

Edit: thank you for your reply

11 years ago
0
Level 3

Hello hauger,

natively, Joomla is not a Multi categories CMS.

SEBLOD is built to run on Joomla without hack, it works just like Joomla and has no more restrictions than Joomla have.


Now, SEBLOD can't implement all hack from all extensions or all developer.


Regards.

Lionel

11 years ago
0
Level 1

If you are using J! 3.x you could use the tag system to categorise your content.

Or set up a tag system with SEBLOD.

11 years ago
0
Level 1

i have the same issue.

my trick is that i override the model of articles and add extra filter that read the additional categories field

11 years ago
1
Level 1

Hi,

Thank you all for your reply, 

mdhugol: could you explain me where and how you set the extra filter (Path and code). 

11 years ago
0
Level 2

Let me tell you that this is a core hacking, so you need to do this every time you do an update.

1. Create simple select field with some values, and set storage format/object as standart -> free -> _content -> name_of_new_column   choose alter, varchar (255), and select add column to table

2. edit a root/components/com_content/models/articles.php

find 'urls', 'a.urls', and add 'name_of_new_column', 'a.name_of_new_column',

find 'a.hits, a.xreference, change to 'a.hits, a.name_of_new_column, a.xreference,

find // Filter by featured state, after the switch statement add

// Override New Column
     $daerah = $this->getState('filter.name_of_new_column');
     switch ($daerah)
     {
       case 'value1':
         $query->where('a.name_of_new_column = \'Value1\'');
         break;

       case 'value2':
         $query->where('a.name_of_new_column = \'Value2\'');
         break;

       case 'value3':
         $query->where('a.name_of_new_column = \'Value3\'');
         break;

       case 'value4':
         $query->where('a.name_of_new_column = \'Value4\'');
         break;
       default:
         
         break;
     }


For now on, every time you trying to filter an article based on the joomla category and the new category simply add

a.name_of_new_column to list.select statement and add

$model->setState('filter.name_of_new_column', $params->get('name_of_module_paramenter', 'default_value_of_parameter'));

Get a Book for SEBLOD