How we add more fields in the appearance -> settings -> "my template"
So that the background image shows several titles and other information.
I added the fields in theme-settings.php, but when i am added new they cannot display at frontend. I changed the print code as well in template.php(code below).
for ($i = 0; $i < count($banners); $i++) {
$output .= '{
"image" : "' . file_create_url($banners[$i]['image_path']) . '",
"title" : "' . "<h2>" . fancy_title(t('@image_title', array('@image_title' => t($banners[$i]['image_title'])))) . "</h2>" . '",
"subtitle" : "' . "<h3>" . fancy_title(t('@image_subtitle', array('@image_subtitle' => t($banners[$i]['image_subtitle'])))) . "</h3>" . '",
},';
}
I tested and if i change 'subtitle' to 'title' i can print that, but not both.
If anyone can give me a hint i would appreciate. Cheers
EDIT
The fields that i need to print, are created in theme-settings.php with this code,
// Image title
$img_form['image_title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#default_value' => $image_data['image_title']
);
// Image SUB title
$img_form['image_subtitle'] = array(
'#type' => 'textfield',
'#subtitle' => t('subTitle'),
'#default_value' => $image_data['image_subtitle']
);
printed in template.php with this code,
for ($i = 0; $i < count($banners); $i++) {
$output .= '{
"image" : "' . file_create_url($banners[$i]['image_path']) . '",
"title" : "' . "<h2>" . fancy_title(t('@image_title', array('@image_title' => t($banners[$i]['image_title'])))) . "</h2>" . '",
"subtitle" : "' . "<h3>" . fancy_title(t('@image_subtitle', array('@image_subtitle' => t($banners[$i]['image_subtitle'])))) . "</h3>" . '",
},';
}
and called in page.tpl.php with this code,
<?php if (theme_get_setting("slideshowType")=="image") : ?>
So, the second field created shows in drupal- settings - template, stores the info in the database, but isn't printed correctly in page.tpl
If any more info is needed i will provide it.
Ps. I'm new to drupal and PHP.