Keyword

Extra Fields more Columns...

  • Periklis
  • Periklis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago - 11 years 8 months ago #110975 by Periklis
Extra Fields more Columns... was created by Periklis
Hello,
i am new to the community, not new to joomla ;)

I have to admit that K2 is an excellent tool that keeps things organized.

I create a website that is about Heat and Cool Systems. There are a lot of categories and of course a lot of items (products) inside them. Every item (product) has specifications like the Tank Capacity, Working Autonomy etc. So far so good...

A lot of these items (products) has different versions. That is to say, there is An Item that has 3 models. First model 10KW, second model 20KW and the third one 30KW.

We are thinking that would be better to have one item (product) and having the Extra Fields (as specifications) in four columns like the example below.

Specifications10KW20KW30KW
Tank Capacity (Kg)405060
Working Autonomy (h)506070
Voltage (Volt)220220220

Is this a way to accomplished that, using extra fields of course, in oder to avoid building an HTML table in Content area...

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 8 months ago #110976 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Extra Fields more Columns...
I think this is possible, by using multiselect/checkbox fields as sepcifications.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

  • Periklis
  • Periklis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #110977 by Periklis
Replied by Periklis on topic Re: Extra Fields more Columns...
Thank you for the reply, but i am afraid you misunderstand my issue. I need a way to show all three columns to the front end not a way to have multiple choices in back end for the administrator.

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 8 months ago #110978 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Extra Fields more Columns...
The way to show three columns is to use template overrides feature of K2.

You can diplay extra fields by alias in the template file like this:
$this->item->extraFields->alias

If you think this is not something you can't do and need paid work, I can help to implement this for a fair price.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

  • Periklis
  • Periklis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #110979 by Periklis
Replied by Periklis on topic Re: Extra Fields more Columns...
I am afraid this is not only appearance issue. It is more complicated. The administrator should have the option to add extra columns in the item editing options and these extra options should be saved in database.

The how-to procedure in order to appear these options from the database, seems more easy to be accomplished.

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 8 months ago #110980 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Extra Fields more Columns...
Hi,

My imagination for how to implement the example you explained in the first post is:

For each one from the first column, you will create a multiselect field, with all the probable values it can have.

Then, while editing, choose the appropriate values for each field, and save.

At the frontend, you will display each field by alias as described before, and you will need to separate its values to show them one by one in a table for example.

Does it make sense for you?

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

  • Periklis
  • Periklis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #110981 by Periklis
Replied by Periklis on topic Re: Extra Fields more Columns...
Thank you for your time and patience my friend.

If i have understand you well, you say to enter for example the three values in a multiselect element and at front end to show all three values in the same order side by side.
It's clever enough.

I am trying to figure out a way to save an extra column of extraFields in database but i have difficulties to read the values back from database...

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 8 months ago #110982 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Extra Fields more Columns...
No problem Periklis.

I don't know why do you need the additional extrafield column in the database, but I want to say that k2 extrafields are not saved directly in the database, they are converted to JSON format before saving.

According to MVC pattern, you will find the database manipulation in the model classes, which are inside the directories components/com_k2/models and administrator/components/com_k2/models

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

  • Periklis
  • Periklis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #110983 by Periklis
Replied by Periklis on topic Re: Extra Fields more Columns...
That's why i have a headache... :sick:

I am searching the way i can read or write the extrafields in database, two days now. I need an extra column, for example "extrafields2", in order to save the extra column of specifications.
(as i described above, i need two columns of extra fields, for the same item. Not multiple choices and select one of them. I need 3 choices and i need to show all the three values simultaneous)

Please Log in or Create an account to join the conversation.

  • Periklis
  • Periklis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #110984 by Periklis
Replied by Periklis on topic Re: Extra Fields more Columns...
To help better understanding, i upload an image of Extra Field area in item editing, trying to visualize what i am trying to do...

(The fields name are in Greek)
Attachments:

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum