I've been searching around for help on this and I suspect it's not there because drupal 7 isn't mainstream in the release cycle yet so I thought I'd ask the question here since Link is the Field Type I want to use.
I'm creating a custom content type in a module I'm building and I'd like to add Link as one of the installed fields. I'm following the example from the Examples project (node_example) and I'm wondering after I install Link what is the Type that I'd put in and what are the display options.
As an example here is what is in node_example:
'node_example_link' => array(
'field_name' => 'node_example_link',
'cardinality' => 3,
'type' => 'text', <------ What would this be
'settings' => array( <------ Are there any settings?
'max_length' => 60,
),
And then for defining the instances:
'node_example_link' => array(
'field_name' => 'node_example_link',
'label' => $t('A Link.'),
'widget' => array(
'type' => 'text_textfield', <----- What are the available widgets?
),
'display' => array(
'example_node_list' => array(
'label' => 'hidden',
'type' => 'node_example_???', <------- What are the available displays?
),
),
),
Thanks so much for your help. I'm sure this will help others even with other field types.
Tony
Comments
Comment #1
jlaurin commentedHi,
I found that you can add a link field with this type :
'type' => 'link_field',
I don't know all the other settings, but I will check it out.
Comment #2
jlaurin commentedHere is an exemple to create a Link in a content type :
Comment #3
jcfiala commentedHey folks - if you enclose your php with <code>, it'll display better.
Comment #4
scuba_flyCorrect me if I'm wrong but I couldn't find this in the current version.
Thanks for the example jlaurin #2 was really helpful!
I tried
'type' => 'link'but only got errors ;)Comment #5
jbenjamin commentedsome more detail:
field:
instance:
hope this helps anyone looking.