WackoWiki: Details Formatter

https://wackowiki.org/doc     Version: 14 (01.06.2022 10:10)

Details Formatter

%%(details title="summary" open=1)%%

<details open>
  <summary>System Requirements</summary>
  <p>Requires a computer running an operating system. The computer
  must have some memory and ideally some kind of long-term storage.
  An input device as well as some form of output device is
  recommended.</p>
</details>	


formatter/highlight/details.php[link1]
<?php

/*
    % %(details
        [title="Title"]
        [open=0|1]
        )
    content
    % %
*/

if (!isset($options['title']))        $options['title']    = null;
if (!isset($options['open']))        $options['open']    = 0;

$title    = $options['title'] ?? $this->_t('ShowHideDetails');
$open    = $options['open'] ? ' open' : '';

echo    '<ignore><details' . $open . '>' . "\n";
echo    ($title
            ? '<summary>' . Ut::html($title) . '</summary>' . "\n"
            : '');
include Ut::join_path(FORMATTER_DIR, 'wiki.php');
echo    "</details></ignore>\n";


Summary The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element.


A disclosure widget is typically presented onscreen using a small triangle which rotates (or twists) to indicate open/closed status, with a label next to the triangle. If the first child of the <details> element is a <summary>, the contents of the <summary> element are used as the label for the disclosure widget.


Remarks

Links