0vote

Dynamic dropdown

Alright let me try to put this question so it's understandable. I am doing that Band database and in fact I am able to do majority of the band related content in my band plugin but there is one that I can't and it's albums. So what I am doing is that I made a plugin for albums which contains the whole discography of each band.

I have made the album form and everything else is simple but then there should be a dropdown that lists all the bands and I choose to which band that particular album belongs to. Atm my admin_config.php contains the following

$this->fields['bandid']['writeParms']['optArray'] = array('bandid_0','bandid_1', 'bandid_2'); // Example Drop-down array. And that populates dropdown like in the picture

I would need to make the dropdown according to a database query to the band table and list them on that dropdown with bandid as the option value and bandname as option text. I know how to do all the queries etc but I don't know how to place the query result to that array.

Any help would be greatly appreciated cause atm I am stuck with this.

e107 version Version 2.1.6 (git)

2 Answers

1vote

Jimako Points1095
Look at Owe me plugin by Moc. I always copy this part of code from it. Look at init function.

terotolkki commented Aug 27

Where can I find this plugin? I tried to search from Git and also in Plugin Manager but couldn't find it. Thank you for your answer though :)

Jimako commented Aug 27

Moc is one of core developer. Check.his repository on.github. I am on mobile now. Sorry.

Moc commented Sep 5

Glad the example is still useful. For others: https://github.com/moc/oweme

0vote

terotolkki Points69
Ok found it and I can't believe how close I actually was. Now it's working, thank you!

tgtje commented Aug 28

@terotolkki : looks you have found a solution (and working) May the issue be closed?

terotolkki commented Aug 28

Yes it can be closed. I found a working solution with the awesome help from you guys again :)

Please log in or register to answer this question.

Know someone who can answer? Share a link to this

Recent Activities

...

e107 Q&A is a Question and Answer platform where e107 users can ask questions themselves and answer each others questions. By doing so users can earn badges and points and become e107 experts.

This community platform is a valuable tool for sharing and gaining knowledge on e107. Go ahead and find out yourself!

Connect with us