0

In PHPfox, i want to call "Pages" name in drop-down in Signup form. Reason for calling "Pages", Actually i have created many pages for college name & that are saved in database. So if someone comes for signup, i want to show them college name in drop-down (which are basically "Pages").

Please help me.

Thanks in advance.

Anoop
  • 61
  • 8

1 Answers1

0

You will need 2 plugins, one to show the HTML and one to process what to do with the user input: 1) Make a plugin that fetches the pages, maybe the hook user.component_controller_register_1 or another in that controller would do but otherwise you can always use a low level hook like run_start and check if its the section where you want it.

To show the HTML you have 2 options: include a JS file to populate the sign up form with anything that you want, or if you have a custom template you can just assign the array to the template variable and look through it in your template.

2) Once the html part is showing and working make a plugin for the sign up routine, I think the hook user.service_process_add_1 should be enough given its location.

Dont forget that the input name for the signup is an array, so your drop down needs to look somewhat like this:

<select name="val[my_dropdown]">
Purefan
  • 1,498
  • 24
  • 44
  • Thank you. Can you explain me in details. Actually i am beginner in PHPFox. In which page/module i will have to do this things? – Anoop Mar 14 '14 at 13:38
  • I wrote an article about this http://www.phpfox.com/kb/article/264/primer-on-hooks-plugins/ – Purefan Mar 15 '14 at 12:28
  • @Purefan Somehow The page is not found.. It gives 404 error. Want to read your article... – user3419778 Jul 21 '15 at 10:03
  • @user3419778 That link is over 1 year old, I suggest you search the new phpfox.com site for more info but I don't know if they kept the articles or if they are relevant with the new version – Purefan Jul 22 '15 at 11:15