This is a mix of a PHP and a Drupal question.
I created a custom function...
theme_field__custom_content_type($variables)
I have the DEVEL module installed and have been using it profusely. I'm trying to modify the layout/look of a custom content through a childtheme I'm developing. I'm running into an issues that is leaving me scratching my head.
I have a custom content type [netrunner_card] and it has several fields that are taxonomy references. One field in particular is [field_card_subtype]. A card can have multiple subtypes... "Location," "Seedy," "Cloud," etc. What I want to do is to take those subtypes and place them next to another field like so:
field_card_type : field_card_subtype[0] - field_card_subtype[1] - etc
So that you would see output like:
Operation : Location - Seedy
ICE : AP - Trap
etc.
What I am doing is the following... Yes, I am creating custom variables for this as it helps to collect everything in an easy to use package.
$blinksFieldName = $variables['element']['#field_name'];
switch( $blinksFieldName )
{
case 'field_unique_card':
$variables['card_is_unique'] = $variables['element']['#items'][0]['value'];
break;
case 'field_card_subtype':
$variables['card_subtype_list'] = implode( " - ", $variables['element']['#items']);
break;
...
}
When I kpr( $variables['card_subtype_list'] ) I get a string of the word 'Array'. I think that's because the breakdown of the variable in question is more like:
$variables['element']['#items'][0]['#title']
I'm very confused how you reach that level of the array when one of the placeholders is the array index... I had thought to do a for-next but I can't figure out how I would word it? Any help would be greatly appreciated.
theme_field()
theme function? If that is the case,$variables
should not contain$variables['element']
.