By cesartovic on
Hello, I have created a module that is form and I want to change the posible choices in the select element without making changes in the module, is this possible?How can I do that?Taxonomy?
Thanks
Hello, I have created a module that is form and I want to change the posible choices in the select element without making changes in the module, is this possible?How can I do that?Taxonomy?
Thanks
Comments
Is taxonomy your solution to
Is taxonomy your solution to everything?
Just teasing...I can't see how taxonomy is related to the 'select' element. Did you create your own module? The 'form', is this an add content page? The 'select element', is this a drop down menu for assigning the content to a category? And is that why you are thinking about taxonomy?
I'd like to help. Can you give more information please?
_____________________________________________________________________________
WILBA ¦ what's it like to...?
Drupal Forum: It's impossible to give a clear answer to an unclear question! Give an example!
select
I have created my own module and the form is a tipical form with labels of Name, City, Hobbies... The authenticated user can complete it, and I (in the role of administrator) want to add posible choices for Hobbies. For example if possible choices are:"Reading","Sports", "Music" I want to add a new hobby for example "Dancing" and then the possible choices will be "Reading","Sports", "Music" and "Dancing" and the user can choose one of them. Hobbies is a select element.Do you understand me now?
I say taxonomy as a solution because a friend said it to me and I read about taxonomy and I don't know how I can do that. I don't know if there is a possible solution.What so you think?
Thanks a lot
I think taxonomy SHOULD be your answer
Because then you get lots of free functionality like indexing, metadata, grouping and cross-indexing on the various topics.
But I don't think you should create your own 'module' if you are not actually adding functional code.
There are many different types of modules created for many reasons. Although you don't explain, I guess you have made your own node type, although it sounds like you should have just used Flexinode.
The way to add new topics is exactly the same way you got the existing topics in there - but you don't say how you did that in the first place.
Taxonomy IS a better solution as you should create a vocabulary listing all 'hobbies' then add this vocab as applying to your node type. There are some drawbacks when you come to format the results, but the end result is much better than inventing yet another database table and your own personal way of accessing it.
It sounds (so far) like you should have just turned on the profile.module and used that.
.dan.
http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Yep, and this pretty much
Yep, and this pretty much echoes my answer to you in your other post.
You have asked the same question in two posts...:-)
_____________________________________________________________________
WILBA ¦ what's it like to...?
Drupal Forum: It's impossible to give a clear answer to an unclear question!
I try to explain better
I have my "own" module created by me.The functionality of this module is a menu to the authenticated user,When you enter the menu the first page is a form that has two select elements and a submit element I want to limit the number of choices that the user could choose in both cases. You choose some of the choices and then you click the submit element and I make a lookup to a table thatI have created and I make some calculations and I present the solutions to the user.For this reason I need my "own" module and I think that taxonomy and flexinode is nos a good solution(I don't know how I can use them with my own module). Whta do you think??
Thanks
Why do you need your own
Why do you need your own module?
_____________________________________________________________________
WILBA ¦ what's it like to...?
Drupal Forum: It's impossible to give a clear answer to an unclear question!
I need it for my work
I need to create my module because the functionality that I need is not given by any module of Drupal so I have to devlop it. In my work I need a module because we need a modular structure
Thanks
Please help me
Please help me and novice in Drupal and I need de answer and help for my work
Thanks
Ad dman said
Yes you can use taxonomy.
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.
But I don't know how I can use it
Hi again!
I don't know how can I use taxonomy in the php code. There isn't a menu called taxonomy or things like that in DRupal.
Thanks
Misunderstood your original question
Perhaps I misunderstood your original question. I initially thought you wanted to allow extra data added to the select box without needing to hard code the data in the module.
Now I believe you're actually asking how to change the data without touching the module you currently have. Is that correct?
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.
Yes, is correct
Yes, is correct.I don't want to change the php code because the final user of my application don't know about php so he can't develop a new module.I need a simple functionality that allow him to change the number of choices without knoweledge about php.
Thanks a lot
The menu item is called 'categories'
You make a list of terms in there, by, eg creating a new vocabulary called 'hobbies'
Then, it's possible, in your code, which you still haven't explained at all, to maybe call
_taxonomy_term_select("Hobbies", "hobbies", array(), 1, 'Choose from a list of hobbies', TRUE, TRUE);
in your form. Where 1 is the id of your new vocabulary.
Although this isn't the most graceful approach, and calling an _underscore _function() is bad programming practice, it sounds like you've got much bigger problems than worrying about coding ettiquite.
You could probably contract the job out to someone who knows PHP and SQL to get the job done right. Module development isn't for non-coders.
.dan.
http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards