7 years ago
1
Topic

If I have the following example category structure

fruit

veg

meat

and want to add an article to the fruit category called apples I would like the article name to read fruit-apples. I thought I could accomplish this using the concatenate function and I had some luck in concatenating catid to article name, but can not work out how to get the prepend the category name as part of the article name. If anyone could share some ideas that would be helpful.

Thanks,

e0f

Get a VIP membership
1283 Posts
Bucklash
7 years ago
0
Level 1

Hi

In these sort of examples my answer is always use beforestore or afterstore. 

Using beforestore concat values yourself and then have that stored. ie

$someConcatValue = $fields['art_title']->value.'-'.$fields['cat_title']->value;

$config['some_table']['some_column']['some_value'] = $someConcatValue;

or even just something like:

$fields['art_title']->value = $fields['art_title']->value.'-'.$fields['cat_title']->value;

it is up to you how you get the category title rather than id..... many ways to skin a cat....

Get a Book for SEBLOD