Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Accordion Atom-X Theme v7

Asked Modified Viewed 1,304 times
H
hervan
H
hervan 10
sorry my english is very bad
  • Member, joined since
  • Contributed 93 posts on the community forums.
  • Started 37 threads in the forums
  • Started this discussions
asked
Member

help me use the accordion :
echo accordion($id, $array);


 function accordion($id, $array) {
 $html = "<div class='accordion' id='$id'/>\n";
 foreach ($array as $field_id => $data) {
 $active = ($field_id == '0') ? 'in' : '';
 $child = ($field_id == '0') ? '' : 'accordion-n';
 $title = str_replace('/[^A-Z]+$/i', " ",$data['title']);
 $title_id_cc = str_replace(" ", "-", $title);
 $html .= "<div class='accordion-group'>";
 $html .= "<div class='accordion-heading'>";
 $html .= "<a class='accordion-toggle $child' data-toggle='collapse' data-parent='#$id' href='#".$title_id_cc."-".$id."'/> ".$title." <i class='entypo cw'/></i></a>";
 $html .= "</div>\n";
 $html .= "<div id='".$title_id_cc."-".$id."' class='accordion-body collapse $active'><div class='accordion-inner'>\n";
 $html .= $data['content'];
 $html .= "</div></div></div>\n";
 }
 $html .= "</div>\n";
 return $html;
 }
hervan attached the following image:
Image not found
0 replies

3 posts

Z
zizub
Z
zizub 10
  • Member, joined since
  • Contributed 156 posts on the community forums.
  • Started 29 threads in the forums
answered
Member

As far as I know, pf-7 is no longer supported here. Try asking in the national forums of php-fusion v7 support, maybe they can help you there.
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

No, it's alright to ask here as long as we know what's going on. After all this site is open to our community members.


function accordion($id, $array) {
 $html = "<div class='accordion' id='$id'/>\n";
 foreach ($array as $field_id => $data) {
 $active = ($field_id == '0') ? 'in' : '';
 $child = ($field_id == '0') ? '' : 'accordion-n';
 $title = str_replace('/[^A-Z]+$/i', " ",$data['title']);
 $title_id_cc = str_replace(" ", "-", $title);
 $html .= "<div class='accordion-group'>";
 $html .= "<div class='accordion-heading'>";
 $html .= "<a class='accordion-toggle $child' data-toggle='collapse' data-parent='#$id' href='#".$title_id_cc."-".$id."'/> ".$title." <i class='entypo cw'/></i></a>";
 $html .= "</div>\n";
 $html .= "<div id='".$title_id_cc."-".$id."' class='accordion-body collapse $active'><div class='accordion-inner'>\n";
 $html .= $data['content'];
 $html .= "</div></div></div>\n";
 }
 $html .= "</div>\n";
 return $html;
}

$array = [
 0 => [ // must start with 0 always
 'title' => 'Example 1',
 'content' => 'This is a content 1',
 ],
 1 => [
 'title' => 'Example 2',
 'content' => 'This is a content 2'
 ]
];

echo accordion('my-accordion', $array);
1 reply
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

When it comes to code questions, Forum is the correct place to be. You can however, ping the Dev in discord to point em in the right direction of a thread.
0 replies

Category Forum

Themes Support

Labels

None yet

Statistics

  • Views 0 views
  • Posts 3 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
Z
Z
zizub 10
  • Member, joined since
  • Contributed 156 posts on the community forums.
  • Started 29 threads in the forums
H
H
hervan 10
sorry my english is very bad
  • Member, joined since
  • Contributed 93 posts on the community forums.
  • Started 37 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet