MWDelaney / bootstrap-4-shortcodes

33 stars 11 forks source link

Using accordion #10

Open brettalton opened 6 years ago

brettalton commented 6 years ago

What are the new shortcodes for accordion? For a fork of your bootstrap-3-shortcodes, called ciromatta/boostrap-4-shortcodes (https://github.com/ciromattia/bootstrap-4-shortcodes), I would do something like,

<div id="accordion" class="accordion">
[accordion]
    [collapse title="Collapse 1" active="true"]
        ...
    [/collapse]
    [collapse title="Collapse 2"]
        ...
    [/collapse]
    [collapse title="Collapse 3"]
        ...
    [/collapse]
[/accordion]
</div>

but this appears to break in the new version here. Any assistance would be appreciated!

brettalton commented 6 years ago

Ok, I found your documentation as a popup above the classic editor beside "Add Media".

For accordion, you explain to use this format,

[accordion]
  [card]
    [card-header] 1 [/card-header]
    [card-body]
      1
    [/card-body]
  [/card]
  [card]
    [card-header] 2 [/card-header]
    [card-body]
      2
    [/card-body]
  [/card]
[/accordion]

when I paste that in and preview the page, the follow error repeats 10+ times,

Warning: DOMDocument::loadHTML() expects parameter 2 to be long, string given in /server/path/hidden/wp-content/plugins/bootstrap-4-shortcodes-master/app/Utilities.php on line 344

That's inside function processdom and pertains to line,

$doc->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

Without a stacktrace, I'd have no idea why that is occurring.

Let me know if there's anything I can do to help debug!

MikeiLL commented 6 years ago

I would open up the file referenced in the warning: /server/path/hidden/wp-content/plugins/bootstrap-4-shortcodes-master/app/Utilities.php and add a print_r() to the loadHTML method to print out parameter 2. That way you hopefully see in the browser what the method is receiving.

So you would add print_r(LIBXML_HTML_NOIMPLIED); and probably also print_r(LIBXML_HTML_NODEFDTD);. I might also print the $content.

"Long" probably means a long integer.

Sometimes I follow a print_r() call with die() so that new output doesn't hide the output I'm looking for.

I hope this helps.