Is it possible to prepopulate a content taxonomy field?

CommentFileSizeAuthor
#3 prepopulate.png99.89 KBalexbk66-

Comments

kompressaur’s picture

I think it should be possible tp but it's not quite as straight forward as i had hoped. Im using 6.2.1 and i have set up a content taxonomy autocomplete field. Ive tried a few things examples to follow but i can't get it to work. My field is called xxx. Here's the code

 <label for="edit-field-xxx-value">xxx: </label> 
 <input type="text" maxlength="255" name="field_xxx[value]" id="edit-field-xxx-value" size="60" value="" class="form-text form-autocomplete" /> 
</div> 
<input class="autocomplete" type="hidden" id="edit-field-xxx-value-autocomplete" value="http://onlinebanter.com/content_taxonomy/autocomplete/field_xxx" disabled="disabled" />  </div> 

i will go try a few things....

node/add/footballteam?edit[field_xxx]=music (nope)
node/add/footballteam?edit[edit-field-xxx-value]=music (nope)
node/add/footballteam?edit[field_xxx][value]=music (ah hah success :) - i think)

as the instructions say it's just the 'name=' bit that needs to be entered.

kompressaur’s picture

Im having probs trying to prepop a content taxonomy select list.

<div class="form-item" id="edit-field-section-value-wrapper">
 <label for="edit-field-section-value">Section: </label>
 <select name="field_section[value][]" multiple="multiple"  class="form-select" id="edit-field-section-value" ><option value="859">Betting</option><option value="7"> - Football Betting</option><option value="867"> 

node/add/story?edit[field_section][value]=Betting - nope

errrrr must be to do with them option values....

node/add/story?edit[field_section][value]=867 - yip :) bloody hell im a genious!!!

alexbk66-’s picture

Title: content taxonomy? » content taxonomy tree?
StatusFileSize
new99.89 KB

@kompressaur (genious!!!) and others, more interesting case - I'm using 'content taxonomy tree' which creates an 'input' field with the same name "field_hobby_tree[value]" for each radio button in the tree (see attached screenshot). So the HTML generated:

<input type="radio" name="field_hobby_tree[value]" id="edit-field-hobby-tree-value-914-checkbox" value="914"   class="form-radio" /> Art</label>
<input type="radio" name="field_hobby_tree[value]" id="edit-field-hobby-tree-value-914-children-919-checkbox" value="919"   class="form-radio" /> Dancing</label>

etc.

So I tried http://www.hobbyblob.com/node/add/blog?edit[field_hobby_tree][value]=914

Doesn't work :( Any idea?
HobbyBlob.com

scuba_fly’s picture

Issue summary: View changes
Status: Active » Closed (outdated)