0

I want to have a extra input field, called "URL" when adding content in drupal admin, and then print that out in the template if something was inserted there.

My guess is that custom module is needed, but that's how far I got, as I have no idea what hook I need to use and how. Or am I trying to solve this the wrong way?

3

No custom module is needed for this in Drupal 7.

Go to Admin > Structure > Content Types, click on "Manage Fields" by the content type you want to add the field to (e.g. admin/structure/types/manage/page/fields), select a type (e.g. "Text"), give it a name, and you're done. (There are some field settings you can change, but you don't need to.)

If you want something that does validation on the URLs, I'd recommend installing the link module, then choosing "Link" as the field widget type in the instructions above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.