Skip to content

Commit

Permalink
Update if the title_field is a block for a repeatable field
Browse files Browse the repository at this point in the history
  • Loading branch information
daylightstudio committed Oct 13, 2015
1 parent 11839f3 commit d3fec21
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion fuel/modules/fuel/libraries/Fuel_custom_fields.php
Expand Up @@ -1070,7 +1070,23 @@ public function template($params, $return_fields = FALSE)
$value = $form_builder->simple_field_value($ff);
if (isset($params['title_field'], $f[$params['title_field']]))
{
$header_value = (is_array($f[$params['title_field']]['value'])) ? current($f[$params['title_field']]['value']) : $f[$params['title_field']]['value'];
if (is_array($f[$params['title_field']]['value']))
{
// specific to block field types
if (isset($f[$params['title_field']]['value']['block_name']))
{
$header_value = $f[$params['title_field']]['value']['block_name'];
}
else
{
$header_value = current($f[$params['title_field']]['value']);
}
}
else
{
$header_value = $f[$params['title_field']]['value'];
}

if (is_string($header_value))
{
$heading = str_replace('{__title__}', $header_value, $value);
Expand Down

0 comments on commit d3fec21

Please sign in to comment.