Keyword

How to add other data to Database

More
11 years 3 months ago #109809 by Jakc
How to add other data to Database was created by Jakc
Hello!
I'm working on a website for Joomla Lessons and I need to do 1 function.


I have to Add Checkboxex to the article's manager which will add the values 1 or 0 into the Database.
For example if there is extension compatible with Joomla 2.5 only, i will check only 2.5 checkbox and this information will be added to the Database.

I found how to add this Checkboxes into the Template, but didn't find how to send this data to the Database. Need your help!

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

More
11 years 3 months ago #109810 by jean-philippe
Replied by jean-philippe on topic Re: How to add other data to Database
Hi Jakc,

I just want to know... what is the real problems with K2 ?

if you do a form using K2... you need to submit to a custom component who can process what you do..

so, you can maybe read the Developing a MVC Component 2.5 - Basic Component

If it's not what you want... I'm sorry to don't answer your question... just maybe explain more :-)


Best regards,

Emond, Jean-Philippe

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

More
11 years 3 months ago #109811 by Jakc
Replied by Jakc on topic Re: How to add other data to Database
Actually, it is not a problem. I just want to add 1 useful function.

Look, I'm working on a website for Joomla lessons and I would like to add Checkboxes which will be displayed in the artcile editor:
Joomla 1,5 ; Joomla 2,5 ; Joomla 3,0

When I check Joomla 1;5 (lesson for Joomla 1,5) this information have to be written to the database (value=0 if not checked, value=1 if checked)

Then in the K2 template I will connect to Database and get this information. If value=1 (Checked) there will be displayed icon of Joomla 1.5, if value=0 (default) nothing will be displayed.

So the reason is that my visitors will be able to see - For what version of Joomla the lesson is.

Ofcourse I can do it on Html for every lesson (just make pictures), but it is not easy, then there are 1000 lessons. That why i need to create these checkboxes inside the K2 Content editor, which will save these information in MYSQL.

Hope somebody will help me!
Thank you!

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

More
11 years 3 months ago - 11 years 3 months ago #109812 by jean-philippe
Replied by jean-philippe on topic Re: How to add other data to Database
Hi Jakc,
You may use the "Extra field" to insert a "checkbox".

inside your templates you get your extrafield !

i've found a tuto : how to use ExtraField
any question plz reply :-)


Best regards,

Emond, Jean-Philippe

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

More
11 years 3 months ago #109813 by Jakc
Replied by Jakc on topic Re: How to add other data to Database
The problem is that there is no Checkbox. There is only Multiselect list.

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

More
11 years 3 months ago #109814 by jean-philippe
Replied by jean-philippe on topic Re: How to add other data to Database
Hi Jakc,

True... Sorry... humm.. you Maybe use 3 "radio button" [Yes / No]

Maybe K2 team will create a feature to us and we will be able create our own "type" in ExtraField :-/


Best regards,

Emond, Jean-Philippe

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

More
11 years 3 months ago - 11 years 3 months ago #109815 by Maik Kaune
Replied by Maik Kaune on topic Re: How to add other data to Database - checkbox
Just found the following links and workarounds (hacks):

1.) "transform" the MultiSelect into checkboxes (May 2012)


2.) New field type:
Hack: Checkboxlist as a new ExtraField type (March 2012)


3.) Alternative: Might be possible to change the markup on client-side with jQuery / javascript. Similar result to 1.), but without K2 core modifications.

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


Powered by Kunena Forum