1. jimmywiddle
  2. RO CSVI
  3. Wednesday, 08 June 2016
  4.  Subscribe via email
Hi,
Id like your advice on setting up a category_path as follows;

It just needs to be 'a_set_folder_name/[field_from_import]', to clarify the parent folder will be the same for all k2 articles imported and the child will be a field from the import.

Im aware I have to use a combine, but im a little confused about exactly how to achieve this.

Many thanks in advance!
Accepted Answer Pending Moderation
Hello,

What you are doing wrong is not specifying all the fields in your import file. You now have only 4 fields defined in your import template. Basically what you are saying is that the import file only has 4 fields. That is not the case is it? How would CSVI know which columns to pull in? You added 4 fields, so CSVI pulls in the first 4 columns.

You must add all the columns in your import file. The ones you don't want to import you choose the fields skip so that CSVI will skip them.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hey Jimmy,

Before applying the patch I linked, did you also apply the patch posted in the thread at the top of the page? This is the main patch, the second one is a fix to that. Give that a try.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Jimmy,

Glad to hear all is finally solved. You are fast becoming a CSVI Expert ;)

Perhaps you can help me out and post a review at the Joomla! Extension Directory
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello Jimmy,
It just needs to be 'a_set_folder_name/[field_from_import]', to clarify the parent folder will be the same for all k2 articles imported and the child will be a field from the import.

The rules you need to apply are based on the category_path field value, if your category_path field is empty in your import file and you are creating one with a field from import file then you need to apply two rules as explained below but if your category_path has a value and you are just trying to replace its value with a_set_folder_name then you need only rule 2 to be applied.
1.create a combine rule where source field will be category_path,[field_from_import] and target field is category_path with combine character /. Apply this rule on category_path field. So if your category_path is empty it would become /[field_from_import]
2. create a replace rule where you set the Find text as the one you need CSVI to find say for example product1, in the replace field you can say it as 'a_set_folder_name/product1' and apply this rule on to same category_path field.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hi, Thanks for your response.

I have 1 problem with step (2) in your example you use 'product1' for my import this will be a unique code and in the future new codes will be added to the import by my client. Basically its far from ideal for my client or myself to have to setup a replacement rule each time.

Is there another solution to this?
Many thanks in advance!
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hello,
Is there another solution to this?

The only option i can think of now is that you have one more field in your import file with the a_set_folder_name same for all the rows and use a combine rule. You can set the source fields to be field name having a_set_folder_name value and field name having your unique codes, target field will be category_path field and combine character /. Apply this rule on category_path field. You can set the set the field with a_set_folder_name to skip so it is not taken in import. Try it and let me know how it goes.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hi, Thanks for your help/response.

Currently the CSV import file is minimal ideally I dont want to have to explain to my client why this extra column is in there, for such a relatively small detail, is there really no alternative, i see the 'default value' within the field settings, could i not somehow use this?
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hello Jimmy,

What you call a minor detail is not what I consider a minor detail. This is actual data being imported, so it must be important.

There is going to be a place where someone will have to set this value to what you want. You can actually use the default value by adding that field to your import template and you can leave the column out from the import file.

Just when the value changes, you or your customer will have to update that default field. The advantage of having it in the import file is that you have maximum control over it and can see which value is used rather than having to find out where the value is and what it is set to.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hi Roland,

Ok great thanks! Yes this value definetly wont change.

So, could you possibly please explain to me exactly how to setup the category_path using this method, I have tried but im not having much luck!

Or if you are happy to, i have a feeling it might be quicker all round if I can just send you access, I have the path perfect except its not putting all the subcategories in the set parent folder, I dont know if the issue is the field order of something I saw something about combine fields having to be in sequential order, but I have many other combine fields setup and didn't want to tamper with the order just incase.

Thanks again!
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello Jimmy,
You can try doing this, try with one combine field first, if it is good then you can add more

1. Create a combine template field with default value which you said wont change.
2. Create a combine rule with source fields combine,unique code field name and target field as category_path, combine character as /
3. Apply the rule on category_path template field.
4. Try doing the import. If everything is set correct you can see category_path in preview.

Try this and if you are still not able to fix it, send me a private message with Joomla administrator login details and the fields you need to be combined. I will take a look at it.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hi, Thanks again for your reply and help!

It now importing into the correct subcategory, but when importing now of the k2 extra fields are being populated, and when i go into edit the k2 items extra fields in joomla it tells me 'Notice: Please select a category first to retrieve its related "Extra Fields"...' although the category is selected fine (and also showing correctly on the import preview), after looking I found this due to the subcategory when created didn't inherit the following options from the parent, and somehow I need to set the following to values when a subcategory is created on import.

- Inherit parameter options from category
- Associated "Extra Fields Group"
- (Category item layout) Select template

Your assistance would once again be much appreciated!
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Hello Jimmy,
- Inherit parameter options from category
- Associated "Extra Fields Group"
- (Category item layout) Select template

You cannot import these fields when creating a subcategory during k2 item import since these fields are related to category but you can do a k2 category import and update these by adding category_path,params and extraFieldsGroup fields, params field value would be like {"inheritFrom":"","theme":""} where inheritFrom is parent category id and theme is for select template, extraFieldsGroup is for extra fields group. You can do a K2 category export with these fields, update the values and import them back.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello Jimmy,
To make your work more easy we have added theme as a normal available fields and the patch is attached with this message. You need to apply the patch file and Instead of params explained in my previous post you can add inheritFrom field which is already an available field along with extraFieldsGroup to your import and CSVI will convert inheritFrom and theme values to params field automatically. It is the same with export, you can try to export inheritFrom and theme directly instead of params field. Try it and let me know how it goes.

patch-k2-2016_06_09.zip
Attachments (1)
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Many thanks for this much appreciated, I applied/uploaded the patch but I have to say Im slightly confused as to where I set this inheritFrom and the params field? I looked within the template fields but I couldn't spot anything related to inheritFrom, any help would be very much appreciated thanks!
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Hello,
I applied/uploaded the patch but I have to say Im slightly confused as to where I set this inheritFrom and the params field?

As i said earlier it is a available field for K2 category import and export and not for K2 item. To update these fields for a category, do a category export with category_path, inheritFrom,theme and extraFieldsGroup fields, edit them and import them back. You need to also update your available fields after applying the patch if you don't see these fields.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 15
Accepted Answer Pending Moderation
Hi Thanks again, trying this but getting confused again, im getting to the 'Select fields' section of the export, i select Group fields I can see inheritFrom but there seems only a facility to add this fields, I see nowhere to add settings inherit from theme etc.

Also can I ask my client will be adding new categories via the main import file, will this process be necessary everytime new categories are added.

Once again your help is much appreciated, many thanks!
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Hello,
Hi Thanks again, trying this but getting confused again, im getting to the 'Select fields' section of the export, i select Group fields I can see inheritFrom but there seems only a facility to add this fields, I see nowhere to add settings inherit from theme etc.

Check the K2 category params export and K2 category params import tutorial to know how to do import and export process.

Also can I ask my client will be adding new categories via the main import file, will this process be necessary everytime new categories are added.

Yes because these are category settings and cannot be edited or updated while doing item import. You need to do it with category import only.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 17
Accepted Answer Pending Moderation
I think UNFORTUNETLY it will be easier to have my client add the category and set the parameters manually in the admin (which they will not be happy about!).

As your method will mean, running the item import (which creates the new category) then running the k2 category params import, and then running the item import again (which will populate the extra fields etc) right?

This 100% cant be done on the same import? As all the parameters will remain the same for all subcategories added and will be the same as the parent category.

Once again many thanks!
  1. more than a month ago
  2. RO CSVI
  3. # 18
Accepted Answer Pending Moderation
Jimmy,

I think UNFORTUNETLY it will be easier to have my client add the category and set the parameters manually in the admin (which they will not be happy about!).
You simply can't update your complete website with 1 import. You can of course put all the fields into 1 file and use this 1 file for both imports.

Your logic is the wrong way around. First you run the category import (if you have any new categories) and then you run the item import.

Just the templates you configure you will need to add all the fields and set the ones you don't want to use to skip.
Your customer, will have to enter the category details somewhere.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 19
Accepted Answer Pending Moderation
Hi, Im back on this task again and getting there. Thanks again for your help, great support!

So ive made the export, and have created the import template, im just preparing the import file (im using 1 import file for both the k2 item and categories as you advised), just 1 question please...

The category_path currently (on my item import) this is made up from a 1 field (not named category_path) the import copys it to category_path and adds a rule which places a_root_folder/ (a folder and a slash) at the begining. Ideally id like to keep it like this for the category import, but just looking at the category import available fields, im not sure its possible to use the other fields on my import file although i spotted custom field?

(I really want to avoid having to ask my client to enter data for this column also, i need to keep the process as simple as possible)

Once again your help is very much appreciated, thanks again!
  1. more than a month ago
  2. RO CSVI
  3. # 20
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
Be one of the first to reply to this post!