We’re with you. JoomShaper is offering a 20% Discount on all plans due to the impact of COVID-19.

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

HTML in addon item title

Featured Lock Resolved Issue
How can I use HTML in the "Accordion Item Title"?
Screen Shot 2020-07-13 at 10.38.17 AM.png

I can edit PHP or create overrides if necessary.

I assume the edits would be in public_html/components/com_sppagebuilder/addons/accordion/site.php


if($title) {
$output .= '<'.$heading_selector.' class="sppb-addon-title">' . $title . '</'.$heading_selector.'>';
}

$output .= '<div class="sppb-addon-content">';
$output .= '<div class="sppb-panel-group">';

if(isset($settings->sp_accordion_item) && is_array($settings->sp_accordion_item) && count($settings->sp_accordion_item)){
foreach ($settings->sp_accordion_item as $key => $item) {
$item_title = (isset($item->title) && $item->title) ? $item->title : '';

$output .= '<div class="sppb-panel sppb-'. $style .'">';
$output .= '<div class="sppb-panel-heading'. (($key == 0) ? ' active' : '') .' '.($icon_position == 'right' ? 'sppb-accordion-icon-position-right' : '').'" id="sppb-ac-heading-'.$this->addon->id.'-key-'.$key.'" aria-expanded="'. (($key == 0) ? 'true' : 'false') .'" aria-controls="sppb-ac-content-'.$this->addon->id.'-key-'.$key.'">';
if(isset($item->icon) && $item->icon != '' && $style == 'panel-custom') {
$output .= '<span class="sppb-accordion-icon-wrap" aria-label="'.trim(strip_tags($item_title)).'">';

$icon_arr = array_filter(explode(' ', $item->icon));
if (count($icon_arr) === 1) {
$item->icon = 'fa ' . $item->icon;
}

$output .= '<i class="' . $item->icon . '" aria-hidden="true"></i> ';
$output .= '</span>';//.sppb-accordion-icon-wrap
}
$output .= '<span class="sppb-panel-title" aria-label="'.trim(strip_tags($item_title)).'">';
if(isset($item->icon) && $item->icon != '' && $style !== 'panel-custom') {

$icon_arr = array_filter(explode(' ', $item->icon));
if (count($icon_arr) === 1) {
$item->icon = 'fa ' . $item->icon;
}

$output .= '<i class="' . $item->icon . '" aria-hidden="true"></i> ';
}
$output .= $item_title;
$output .= '</span>';//.sppb-panel-title
if($style !== 'panel-custom'){
$output .= '<span class="sppb-toggle-direction" aria-label="Toggle Direction Icon '.($key+1).'"><i class="fa fa-chevron-right" aria-hidden="true"></i></span>';
}
$output .= '</div>';//.sppb-panel-heading
$output .= '<div id="sppb-ac-content-'.$this->addon->id.'-key-'.$key.'" class="sppb-panel-collapse"' . (($key != 0) ? ' style="display: none;"' : '') . ' aria-labelledby="sppb-ac-heading-'.$this->addon->id.'-key-'.$key.'">';
$output .= '<div class="sppb-panel-body">';
$output .= isset($item->content) ? $item->content : '';
$output .= '</div>';//.sppb-panel-body
$output .= '</div>';//.sppb-panel-collapse
$output .= '</div>';//.sppb-panel
}
}


$output .= '</div>';
$output .= '</div>';
$output .= '</div>';

return $output;

Attachments (1)

  • Screen Shot 2020-07-13 at 10.38.17 AM.png
    Screen Shot 2020-07-13 at 10.38.17 AM.png 31.7 KB

3 Answers

Toufiq - Staff

3 weeks ago #Permalink
Hi there,

Thanks for contacting us. You can override or modify your file. But, Sorry to say that We do not provide the customization support.

-Thanks
I was able to resolve this using a template override and editing the aria-label(s)
FROM:

aria-label="'.trim(strip_tags($item_title)).'"

TO:

aria-label="'.trim(($item_title)).'"

Toufiq - Staff

3 weeks ago #Permalink
I was able to resolve this using a template override and editing the aria-label(s)
FROM:

aria-label="'.trim(strip_tags($item_title)).'"

TO:

aria-label="'.trim(($item_title)).'"


Great :)


There are no replies made for this post yet.
Be one of the first to reply to this post!

126

Templates

333678

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us