Last active
August 29, 2015 14:01
-
-
Save raynimmo/9180e5e93801f40e2cab to your computer and use it in GitHub Desktop.
Drupal list all content types and fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$content_types = node_get_types(); | |
$output = ''; | |
foreach($content_types as $content_type => $content_type_object) { | |
$output .= "" . $content_type_object->name . ""; | |
$output .= ' '; | |
$fields = _content_type_info(); | |
$fields = $fields['content types'][$content_type]['fields']; | |
$ouput = ''; | |
foreach ($fields as $field_name=>$field) { | |
$output .= $field['widget']['label']; | |
$output .= ' '; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment