CINXE.COM
plugin:data [DokuWiki]
<!DOCTYPE html> <html lang="en" dir="ltr" class="no-js"> <head> <meta charset="utf-8" /> <title>plugin:data [DokuWiki]</title> <meta name="generator" content="DokuWiki"/> <meta name="theme-color" content="#008800"/> <meta name="robots" content="index,follow"/> <meta name="keywords" content="plugin,data"/> <link rel="search" type="application/opensearchdescription+xml" href="/lib/exe/opensearch.php" title="DokuWiki"/> <link rel="start" href="/"/> <link rel="contents" href="/plugin:data?do=index" title="Sitemap"/> <link rel="manifest" href="/lib/exe/manifest.php"/> <link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/feed.php"/> <link rel="alternate" type="application/rss+xml" title="Current namespace" href="/feed.php?mode=list&ns=plugin"/> <link rel="edit" title="Edit this page" href="/plugin:data?do=edit"/> <link rel="alternate" type="text/html" title="Plain HTML" href="/_export/xhtml/plugin:data"/> <link rel="alternate" type="text/plain" title="Wiki Markup" href="/_export/raw/plugin:data"/> <link rel="canonical" href="https://www.dokuwiki.org/plugin:data"/> <link rel="stylesheet" href="/lib/exe/css.php?t=dokuwiki&tseed=f1005bad3d81fc9c803c7f93d32a390e"/> <script >var NS='plugin';var JSINFO = {"plugins":{"edittable":{"default columnwidth":""}},"id":"plugin:data","namespace":"plugin","ACT":"show","useHeadingNavigation":0,"useHeadingContent":0};(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js" defer="defer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js" defer="defer"></script> <script src="/lib/exe/js.php?t=dokuwiki&tseed=f1005bad3d81fc9c803c7f93d32a390e&lang=en" defer="defer"></script> <meta name="viewport" content="width=device-width,initial-scale=1" /> <link rel="shortcut icon" href="/lib/tpl/dokuwiki/images/favicon.ico" /> <link rel="apple-touch-icon" href="/lib/tpl/dokuwiki/images/apple-touch-icon.png" /> <meta name="verify-v1" content="OVxl3gsCv2MhZqh1cBQyl0JytWXSwXMjyvwc+4w3WtA=" /> <meta name="google-site-verification" content="YhTVK69hW94ZXUtc2zSLPxTkZKbZIn0zK67mz5WQB-E" /> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-83791-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-83791-1', { 'anonymize_ip': true }); </script> </head> <body> <div id="dokuwiki__site"><div id="dokuwiki__top" class="site dokuwiki mode_show tpl_dokuwiki showSidebar hasSidebar"> <!-- ********** HEADER ********** --> <header id="dokuwiki__header"><div class="pad group"> <div class="headings group"> <ul class="a11y skip"> <li><a href="#dokuwiki__content">skip to content</a></li> </ul> <h1 class="logo"><a href="/start" accesskey="h" title="Home [h]"><img src="/lib/tpl/dokuwiki/images/logo.png" width="64" height="64" alt="" /><span>DokuWiki</span></a></h1> <p class="claim">It's better when it's simple</p> </div> <div class="tools group"> <!-- USER TOOLS --> <div id="dokuwiki__usertools"> <h3 class="a11y">User Tools</h3> <ul> <li class="action login"><a href="/plugin:data?do=login&sectok=" title="Log In" rel="nofollow"><span>Log In</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 17.25V14H3v-4h7V6.75L15.25 12 10 17.25M8 2h9a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-4h2v4h9V4H8v4H6V4a2 2 0 0 1 2-2z"/></svg></a></li> </ul> </div> <!-- SITE TOOLS --> <div id="dokuwiki__sitetools"> <h3 class="a11y">Site Tools</h3> <form action="/start" method="get" role="search" class="search doku_form" id="dw__search" accept-charset="utf-8"><input type="hidden" name="do" value="search" /><input type="hidden" name="id" value="plugin:data" /><div class="no"><input name="q" type="text" class="edit" title="[F]" accesskey="f" placeholder="Search" autocomplete="on" id="qsearch__in" value="" /><button value="1" type="submit" title="Search">Search</button><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form> <div class="mobileTools"> <form action="/doku.php" method="get" accept-charset="utf-8"><div class="no"><input type="hidden" name="id" value="plugin:data" /><select name="do" class="edit quickselect" title="Tools"><option value="">Tools</option><optgroup label="Page Tools"><option value="edit">Edit this page</option><option value="revisions">Old revisions</option><option value="backlink">Backlinks</option></optgroup><optgroup label="Site Tools"><option value="recent">Recent Changes</option><option value="media">Media Manager</option><option value="index">Sitemap</option></optgroup><optgroup label="User Tools"><option value="login">Log In</option></optgroup></select><button type="submit">></button></div></form> </div> <ul> <li class="action recent"><a href="/plugin:data?do=recent" title="Recent Changes [r]" rel="nofollow" accesskey="r">Recent Changes</a></li><li class="action media"><a href="/plugin:data?do=media&ns=plugin" title="Media Manager" rel="nofollow">Media Manager</a></li><li class="action index"><a href="/plugin:data?do=index" title="Sitemap [x]" rel="nofollow" accesskey="x">Sitemap</a></li> </ul> </div> </div> <!-- BREADCRUMBS --> <div class="breadcrumbs"> <div class="trace"><span class="bchead">Trace:</span> <span class="bcsep">•</span> <span class="curid"><bdi><a href="/plugin:data" class="breadcrumbs" title="plugin:data">data</a></bdi></span></div> </div> <hr class="a11y" /> </div></header><!-- /header --> <div class="wrapper group"> <!-- ********** ASIDE ********** --> <nav id="dokuwiki__aside" aria-label="Sidebar"><div class="pad aside include group"> <h3 class="toggle">Sidebar</h3> <div class="content"><div class="group"> <p> <strong>Learn about DokuWiki</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/features" class="wikilink1" title="features" data-wiki-id="features">Features</a> & <a href="/blogroll" class="wikilink1" title="blogroll" data-wiki-id="blogroll">reviews</a> </div> </li> <li class="level1"><div class="li"> <a href="/install" class="wikilink1" title="install" data-wiki-id="install">Installation guide</a></div> </li> <li class="level1"><div class="li"> <a href="/manual" class="wikilink1" title="manual" data-wiki-id="manual">User manual</a> & <a href="/wiki:syntax" class="wikilink1" title="wiki:syntax" data-wiki-id="wiki:syntax">syntax</a></div> </li> <li class="level1"><div class="li"> <a href="/changes" class="wikilink1" title="changes" data-wiki-id="changes">Release notes</a></div> </li> <li class="level1"><div class="li"> <a href="/faq" class="wikilink1" title="faq" data-wiki-id="faq">FAQ</a></div> </li> </ul> <p> <strong>Advanced Use</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/extensions" class="wikilink1" title="extensions" data-wiki-id="extensions">Extensions</a></div> </li> <li class="level1"><div class="li"> <a href="/development" class="wikilink1" title="development" data-wiki-id="development">Development manual</a></div> </li> </ul> <p> <strong>Corporate Use</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/faq:support" class="wikilink1" title="faq:support" data-wiki-id="faq:support">Get support</a></div> </li> <li class="level1"><div class="li"> <a href="/donate" class="wikilink1" title="donate" data-wiki-id="donate">Donations</a></div> </li> </ul> <p> <strong>Our Community</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/teams:getting_involved" class="wikilink1" title="teams:getting_involved" data-wiki-id="teams:getting_involved">Get involved</a></div> </li> <li class="level1"><div class="li"> <a href="/dokuinstall" class="wikilink1" title="dokuinstall" data-wiki-id="dokuinstall">Users</a></div> </li> <li class="level1"><div class="li"> <a href="http://forum.dokuwiki.org" class="urlextern" title="http://forum.dokuwiki.org">User forum</a></div> </li> <li class="level1"><div class="li"> <a href="/mailinglist" class="wikilink1" title="mailinglist" data-wiki-id="mailinglist">Development mailinglist</a></div> </li> </ul> <hr /> <p> Follow us on <a href="https://phpc.social/@dokuwiki" class="urlextern" title="https://phpc.social/@dokuwiki">Mastodon</a> and other <a href="/social" class="wikilink1" title="social" data-wiki-id="social">social networks</a>. </p> <p> <a href="/privacy" class="wikilink1" title="privacy" data-wiki-id="privacy">Our Privacy Policy</a> </p> </div></div> </div></nav><!-- /aside --> <!-- ********** CONTENT ********** --> <main id="dokuwiki__content"><div class="pad group"> <div class="pageId"><span>plugin:data</span></div> <div class="page group"> <!-- wikipage start --> <!-- TOC START --> <div id="dw__toc" class="dw__toc"> <h3 class="toggle">Table of Contents</h3> <div> <ul class="toc"> <li class="level1"><div class="li"><a href="#data_plugin">data Plugin</a></div> <ul class="toc"> <li class="level2"><div class="li"><a href="#download_and_installation">Download and Installation</a></div> <ul class="toc"> <li class="level3"><div class="li"><a href="#changes">Changes</a></div></li> <li class="level3"><div class="li"><a href="#updating_from_versions_prior_to_2013-02-06">Updating from versions prior to 2013-02-06</a></div></li> <li class="level3"><div class="li"><a href="#updating_from_versions_prior_to_2010-03-22">Updating from versions prior to 2010-03-22</a></div></li> </ul> </li> <li class="level2"><div class="li"><a href="#plugin_syntax">Plugin Syntax</a></div> <ul class="toc"> <li class="level3"><div class="li"><a href="#data_entry_input">Data Entry (Input)</a></div></li> <li class="level3"><div class="li"><a href="#data_table_output">Data Table (Output)</a></div></li> <li class="level3"><div class="li"><a href="#data_list_output">Data List (Output)</a></div></li> <li class="level3"><div class="li"><a href="#related_pages_output">Related Pages (Output)</a></div></li> <li class="level3"><div class="li"><a href="#tag_cloud_control">Tag Cloud (Control)</a></div></li> </ul> </li> <li class="level2"><div class="li"><a href="#customizing_the_styling">Customizing the Styling</a></div></li> <li class="level2"><div class="li"><a href="#type_aliases">Type aliases</a></div></li> <li class="level2"><div class="li"><a href="#custom_entry_editor">Custom entry editor</a></div></li> <li class="level2"><div class="li"><a href="#bureaucracy_plugin_and_type_aliases">Bureaucracy plugin and type aliases</a></div></li> <li class="level2"><div class="li"><a href="#translation_support">Translation Support</a></div></li> <li class="level2"><div class="li"><a href="#missing_features">Missing Features</a></div></li> <li class="level2"><div class="li"><a href="#examples">Examples</a></div></li> <li class="level2"><div class="li"><a href="#question_and_answers">Question and Answers</a></div> <ul class="toc"> <li class="level3"><div class="li"><a href="#how_to_refresh_data">How to refresh data?</a></div></li> <li class="level3"><div class="li"><a href="#what_is_the_difference_between_strata_plugin_and_data_plugin">What is the difference between Strata plugin and Data plugin?</a></div></li> <li class="level3"><div class="li"><a href="#how_do_you_filter_empty_fields_values">How do you filter empty fields/values?</a></div></li> <li class="level3"><div class="li"><a href="#why_don_t_my_variables_placeholders_work_when_i_create_a_table_in_a_namespace_template">Why don't my variables/placeholders work when I create a table in a namespace template?</a></div></li> <li class="level3"><div class="li"><a href="#other_questions">Other Questions</a></div></li> </ul> </li> <li class="level2"><div class="li"><a href="#customisations">Customisations</a></div> <ul class="toc"> <li class="level3"><div class="li"><a href="#customise_the_date_format">Customise the Date Format</a></div></li> </ul> </li> <li class="level2"><div class="li"><a href="#bugs_feature_requests_and_patches">Bugs, Feature Requests and Patches</a></div></li> </ul></li> </ul> </div> </div> <!-- TOC END --> <h1 class="sectionedit1" id="data_plugin">data Plugin</h1> <div class="level1"> <div class="pluginrepo_entry"><div class="usageInfo"><div class="compatibility"><p class="label">Compatible with DokuWiki</p><div class="versions"><ul><li class="">2024-02-06 "Kaos" <strong><span>unknown</span></strong></li><li class="">2023-04-04 "Jack Jackrum" <strong><span>unknown</span></strong></li><li class="yes">2022-07-31 "Igor" <strong><span>yes</span></strong></li><li class="yes">2020-07-29 "Hogfather" <strong><span>yes</span></strong></li></ul></div></div><ul class="actions"><li><a class="download" href="https://github.com/splitbrain/dokuwiki-plugin-data/zipball/master">Download</a></li><li><a class="bugs" href="https://github.com/splitbrain/dokuwiki-plugin-data/issues">Report bugs</a></li><li><a class="donate" href="http://donate.dokuwiki.org/data">Donate</a></li></ul><div class="clearer"></div></div><div class="mainInfo"><p class="description"><a class="media" href="/plugins"><img alt="plugin" class="medialeft" src="/lib/plugins/pluginrepo/images/dwplugin.png" width="60" height="60" /></a> Add and query structured data in your wiki</p></div><div class="metaInfo"><dl><dt>Last updated on</dt><dd>2024-01-30</dd><dt>Provides</dt><dd><a href="/plugins?plugintype=1#extension__table" class="wikilink1" title="List all Syntax plugins">Syntax</a>, <a href="/plugins?plugintype=16#extension__table" class="wikilink1" title="List all Helper plugins">Helper</a>, <a href="/plugins?plugintype=4#extension__table" class="wikilink1" title="List all Action plugins">Action</a></dd><dt>Repository</dt><dd><a class="urlextern" href="https://github.com/splitbrain/dokuwiki-plugin-data">Source</a></dd><dt>Conflicts with</dt><dd><a href="/plugin:data-au" class="wikilink1" title="plugin:data-au" data-wiki-id="plugin:data-au">data-au</a>, <a href="/plugin:fckg" class="wikilink1" title="plugin:fckg" data-wiki-id="plugin:fckg">fckg</a>, <a href="/plugin:headerfooter" class="wikilink1" title="plugin:headerfooter" data-wiki-id="plugin:headerfooter">headerfooter</a></dd><dt>Requires</dt><dd><a href="/plugin:sqlite" class="wikilink1" title="plugin:sqlite" data-wiki-id="plugin:sqlite">sqlite</a></dd></dl></div><div class="moreInfo"><p class="similar">Similar to <a href="/plugin:dtable" class="wikilink1" title="plugin:dtable" data-wiki-id="plugin:dtable">dtable</a>, <a href="/plugin:fields" class="wikilink1" title="plugin:fields" data-wiki-id="plugin:fields">fields</a>, <a href="/plugin:json" class="wikilink1" title="plugin:json" data-wiki-id="plugin:json">json</a>, <a href="/plugin:jsoneditor" class="wikilink1" title="plugin:jsoneditor" data-wiki-id="plugin:jsoneditor">jsoneditor</a>, <a href="/plugin:pagemod" class="wikilink1" title="plugin:pagemod" data-wiki-id="plugin:pagemod">pagemod</a>, <a href="/plugin:semanticdata" class="wikilink1" title="plugin:semanticdata" data-wiki-id="plugin:semanticdata">semanticdata</a>, <a href="/plugin:strata" class="wikilink1" title="plugin:strata" data-wiki-id="plugin:strata">strata</a>, <a href="/plugin:struct" class="wikilink1" title="plugin:struct" data-wiki-id="plugin:struct">struct</a></p><p class="tags">Tagged with <a href="/plugins?plugintag=data#extension__table" class="wikilink1" title="List all plugins with this tag">data</a>, <a href="/plugins?plugintag=database#extension__table" class="wikilink1" title="List all plugins with this tag">database</a>, <a href="/plugins?plugintag=listing#extension__table" class="wikilink1" title="List all plugins with this tag">listing</a>, <a href="/plugins?plugintag=sqlite#extension__table" class="wikilink1" title="List all plugins with this tag">sqlite</a>, <a href="/plugins?plugintag=tables#extension__table" class="wikilink1" title="List all plugins with this tag">tables</a>, <a href="/plugins?plugintag=tags#extension__table" class="wikilink1" title="List all plugins with this tag">tags</a></p><p class="needed">Needed for <a href="/plugin:datagraph" class="wikilink1" title="plugin:datagraph" data-wiki-id="plugin:datagraph">datagraph</a>, <a href="/plugin:dataloop" class="wikilink1" title="plugin:dataloop" data-wiki-id="plugin:dataloop">dataloop</a>, <a href="/plugin:datapopup" class="wikilink1" title="plugin:datapopup" data-wiki-id="plugin:datapopup">datapopup</a>, <a href="/plugin:datasearchform" class="wikilink1" title="plugin:datasearchform" data-wiki-id="plugin:datasearchform">datasearchform</a>, <a href="/plugin:datatemplate" class="wikilink1" title="plugin:datatemplate" data-wiki-id="plugin:datatemplate">datatemplate</a>, <a href="/plugin:orgchart" class="wikilink1" title="plugin:orgchart" data-wiki-id="plugin:orgchart">orgchart</a>, <a href="/plugin:podcast" class="wikilink1" title="plugin:podcast" data-wiki-id="plugin:podcast">podcast</a></p></div><div class="authorInfo"><strong>By <a href="mailto:andi%20%5Bat%5D%20splitbrain%20%5Bdot%5D%20org" class="mail" title="andi [at] splitbrain [dot] org">Andreas Gohr</a></strong><ul><li><a href="/plugin:badbehaviour" class="wikilink1" title="plugin:badbehaviour" data-wiki-id="plugin:badbehaviour">badbehaviour</a></li> <li><a href="/plugin:amazon" class="wikilink1" title="plugin:amazon" data-wiki-id="plugin:amazon">amazon</a></li> <li><a href="/plugin:xfortune" class="wikilink1" title="plugin:xfortune" data-wiki-id="plugin:xfortune">xfortune</a></li> <li><a href="/plugin:statistics" class="wikilink1" title="plugin:statistics" data-wiki-id="plugin:statistics">statistics</a></li> <li><a href="/plugin:translation" class="wikilink1" title="plugin:translation" data-wiki-id="plugin:translation">translation</a></li> <li><a href="/plugin:captcha" class="wikilink1" title="plugin:captcha" data-wiki-id="plugin:captcha">captcha</a></li> <li><a href="/plugin:graphviz" class="wikilink1" title="plugin:graphviz" data-wiki-id="plugin:graphviz">graphviz</a></li> <li><a href="/plugin:acl" class="wikilink1" title="plugin:acl" data-wiki-id="plugin:acl">acl</a></li> <li><a href="/plugin:info" class="wikilink1" title="plugin:info" data-wiki-id="plugin:info">info</a></li> <li><a href="/plugin:ditaa" class="wikilink1" title="plugin:ditaa" data-wiki-id="plugin:ditaa">ditaa</a></li> <li>and 60 more</li></ul></div></div> <p> This plugin allows you to add structured data to any DokuWiki page. Think about this data as additional named attributes. Those attributes can then be queried and aggregated. The plugin is similar to what was done here for the <a href="/plugin:repository" class="wikilink1" title="plugin:repository" data-wiki-id="plugin:repository">repository plugin</a> but its internals are very different to it. </p> <p> <img src="/lib/images/smileys/exclaim.svg" class="icon smiley" alt=":!:" /> You might want to consider using the spiritual successor to this plugin: <a href="/plugin:struct" class="wikilink1" title="plugin:struct" data-wiki-id="plugin:struct">struct Plugin</a> </p> </div> <div class="secedit editbutton_section editbutton_1"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[data Plugin] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="data_plugin" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="1-1222" /><button type="submit" title="data Plugin">Edit</button></div></form></div> <h2 class="sectionedit2" id="download_and_installation">Download and Installation</h2> <div class="level2"> <p> Search and install the plugin using the <a href="/plugin:extension" class="wikilink1" title="plugin:extension" data-wiki-id="plugin:extension">Extension Manager</a>. Refer to <a href="/plugins" class="wikilink1" title="plugins" data-wiki-id="plugins">Plugins</a> on how to install plugins manually. </p> </div> <div class="secedit editbutton_section editbutton_2"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Download and Installation] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="download_and_installation" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="1223-1400" /><button type="submit" title="Download and Installation">Edit</button></div></form></div> <h3 class="sectionedit3" id="changes">Changes</h3> <div class="level3"> <p> <a href="https://travis-ci.org/splitbrain/dokuwiki-plugin-data" class="media" title="https://travis-ci.org/splitbrain/dokuwiki-plugin-data"><img src="/lib/exe/fetch.php?cache=nocache&tok=2b4562&media=https%3A%2F%2Ftravis-ci.org%2Fsplitbrain%2Fdokuwiki-plugin-data.png" class="mediaright" loading="lazy" title="Build Status" alt="Build Status" /></a> </p> <ul class="rss"><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/a388be1c6f42795ca55ddab49fd741e848309304" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/a388be1c6f42795ca55ddab49fd741e848309304">Version upped</a> (2024-02-01 23:50)</div></li><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/957fa14d841a8002784f0d3283ba470d44f6ae4e" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/957fa14d841a8002784f0d3283ba470d44f6ae4e">Merge pull request #240 from annda/gh-tests</a> (2024-02-01 09:48)</div></li><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/820f7b69ab991d98fcb477d9c2cf41aaecde87ec" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/820f7b69ab991d98fcb477d9c2cf41aaecde87ec">Manual code style fixes</a> (2024-01-31 09:39)</div></li><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/495caa2716c27fd66c784a1e82295777e5301b28" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/495caa2716c27fd66c784a1e82295777e5301b28">Update test workflow</a> (2024-01-30 09:30)</div></li><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/b7b9d8d9c76265475bc8fdba9bca5c580cfeadeb" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/b7b9d8d9c76265475bc8fdba9bca5c580cfeadeb">Semi-automatic code style fixes</a> (2024-01-30 09:30)</div></li><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/01578b9aa65b74c85550dfe7bb202b34ae9c5719" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/01578b9aa65b74c85550dfe7bb202b34ae9c5719">Version upped</a> (2023-07-19 23:50)</div></li><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/c73abd3ae2556340c09fba132b1573518d9f095d" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/c73abd3ae2556340c09fba132b1573518d9f095d">Another adjustment for the pre-escaped filter values</a> (2023-07-18 09:12)</div></li><li><div class="li"><a href="https://github.com/splitbrain/dokuwiki-plugin-data/commit/8c5b72fc6a2df3f4e8948f8bfcec9e880cc9e7e6" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/commit/8c5b72fc6a2df3f4e8948f8bfcec9e880cc9e7e6">fix alias saving</a> (2023-07-10 11:40)</div></li></ul> </div> <div class="secedit editbutton_section editbutton_3"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Changes] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="changes" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="1401-1648" /><button type="submit" title="Changes">Edit</button></div></form></div> <h3 class="sectionedit4" id="updating_from_versions_prior_to_2013-02-06">Updating from versions prior to 2013-02-06</h3> <div class="level3"> <p> Be sure to update the <a href="/plugin:sqlite" class="wikilink1" title="plugin:sqlite" data-wiki-id="plugin:sqlite">sqlite</a> plugin and follow its instructions on sqlite version upgrades. </p> </div> <div class="secedit editbutton_section editbutton_4"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Updating from versions prior to 2013-02-06] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="updating_from_versions_prior_to_2013-02-06" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="1649-1799" /><button type="submit" title="Updating from versions prior to 2013-02-06">Edit</button></div></form></div> <h3 class="sectionedit5" id="updating_from_versions_prior_to_2010-03-22">Updating from versions prior to 2010-03-22</h3> <div class="level3"> <p> Since 2010-03-22, the data plugin uses the <a href="/plugin:sqlite" class="wikilink1" title="plugin:sqlite" data-wiki-id="plugin:sqlite">sqlite helper plugin</a>. Therefore, the database file location and structure changed. If you want to keep your old database, you have to perform the following steps prior to upgrading the data plugin: </p> <ol> <li class="level1"><div class="li"> Install the <a href="/plugin:sqlite" class="wikilink1" title="plugin:sqlite" data-wiki-id="plugin:sqlite">sqlite</a> plugin</div> </li> <li class="level1"><div class="li"> Move the file <code>data/cache/dataplugin.sqlite</code> to <code>data/meta/data.sqlite</code></div> </li> <li class="level1"><div class="li"> Perform the following SQL statements on the database (for example using the sqlite plugin’s admin page)<pre class="code sql"><span class="kw1">CREATE</span> <span class="kw1">TABLE</span> opts <span class="br0">(</span>opt<span class="sy0">,</span>val<span class="br0">)</span>; <span class="kw1">CREATE</span> <span class="kw1">UNIQUE</span> <span class="kw1">INDEX</span> idx_opt <span class="kw1">ON</span> opts<span class="br0">(</span>opt<span class="br0">)</span>; <span class="kw1">INSERT</span> <span class="kw1">INTO</span> opts <span class="kw1">VALUES</span> <span class="br0">(</span><span class="st0">'dbversion'</span><span class="sy0">,</span> <span class="nu0">1</span><span class="br0">)</span>;</pre> </div> </li> <li class="level1"><div class="li"> Upgrade the data plugin</div> </li> </ol> <p> If you upgraded the data plugin before these steps, a blank <code>data.sqlite</code> has been created and you have to copy the <code>data/cache/dataplugin.sqlite</code> over the existing <code>data/meta/data.sqlite</code>. </p> </div> <div class="secedit editbutton_section editbutton_5"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Updating from versions prior to 2010-03-22] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="updating_from_versions_prior_to_2010-03-22" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="1800-2686" /><button type="submit" title="Updating from versions prior to 2010-03-22">Edit</button></div></form></div> <h2 class="sectionedit6" id="plugin_syntax">Plugin Syntax</h2> <div class="level2"> <p> This plugin depends on multiple parts, each having a similar syntax. The syntax defines a block with various key/value pairs configuring the behaviour of the plugin part. The following parts are available: </p> <div class="table sectionedit7"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Part </th><th class="col1"> Function</th> </tr> </thead> <tr class="row1"> <td class="col0 leftalign"> <a href="#data_entry_input" title="plugin:data ↵" class="wikilink1">Data Entry</a> </td><td class="col1 leftalign"> Input </td> </tr> <tr class="row2"> <td class="col0 leftalign"> <a href="#data_table_output" title="plugin:data ↵" class="wikilink1">Data Table</a> </td><td class="col1 leftalign"> Output </td> </tr> <tr class="row3"> <td class="col0 leftalign"> <a href="#data_list_output" title="plugin:data ↵" class="wikilink1">Data List</a> </td><td class="col1 leftalign"> Output </td> </tr> <tr class="row4"> <td class="col0 leftalign"> <a href="#related_pages_output" title="plugin:data ↵" class="wikilink1">Related Pages</a> </td><td class="col1 leftalign"> Output </td> </tr> <tr class="row5"> <td class="col0 leftalign"> <a href="#tag_cloud_control" title="plugin:data ↵" class="wikilink1">Tag Cloud</a> </td><td class="col1"> Control </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_7"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table" /><input type="hidden" name="range" value="2921-3239" /><button type="submit" title="Table">Edit</button></div></form></div> </div> <div class="secedit editbutton_section editbutton_6"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Plugin Syntax] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="plugin_syntax" /><input type="hidden" name="codeblockOffset" value="1" /><input type="hidden" name="range" value="2687-3240" /><button type="submit" title="Plugin Syntax">Edit</button></div></form></div> <h3 class="sectionedit8" id="data_entry_input">Data Entry (Input)</h3> <div class="level3"> <p> This part is used to add structured data to a page. All data entered here is tied to the page. So <strong>you can use it only once on a page</strong><sup><a href="#fn__1" id="fnt__1" class="fn_top">1)</a></sup>. Let's start with an example: </p> <pre class="code">---- dataentry projects ---- type : web development volume : 1 Mrd # how much do they pay? employees : Joe, Jane, Jim description_wiki: **Important** project customer_page : customers:microsoft deadline_dt : 2009-08-17 server_pages : servers:devel01, extern:microsoft website_url : http://www.microsoft.com task_tags : programming, coding, design, html ----</pre> <p> As you can see the block is defined by hyphens and the word <code>dataentry</code>. You may add additional words after the <code>dataentry</code> keyword. Those will be added as additional <abbr title="Cascading Style Sheets">CSS</abbr> classes in the final <abbr title="HyperText Markup Language">HTML</abbr> output and can be queried as <code>%class%</code> later. You can use this for styling how different entry types should be displayed later or limiting aggregation to certain types of pages. </p> <p> You may use the <code>#</code> character to add comments to the block. Those will be ignored and will neither be displayed nor saved. If you need to enter <code>#</code> as data, escape it with a backslash (<code>\#</code>). If you need a backslash, escape it as well (<code>\\</code>). </p> <p> Inside the block you see <em>column names</em> and their <em>values</em>. There are a few rules for the column names: </p> <ul> <li class="level1"><div class="li"> Use any name you like</div> </li> <li class="level1 node"><div class="li"> If the name ends with the <code>s</code> character, you may add multiple values separated by commas (like in the employees row). This removes the last <code>s</code> character from the rendered column name.</div> <ul> <li class="level2"><div class="li"> The <code>s</code> suffix or “multiple values” come into play when using the <code>~</code> filter as opposed to <code>*~</code> (see below)<sup><a href="#fn__2" id="fnt__2" class="fn_top">2)</a></sup></div> </li> <li class="level2"><div class="li"> If you want to avoid the multiple value option and keep your column name as is, add an underscore to the end of your name (example: <code>thickness_ : 1cm</code>). </div> </li> <li class="level2"><div class="li"> If you want the multiple value option and keep the your column name as is, add a second <code>s</code> to your column name…<br/> e.g.:<br/> <code>name : John</code> → name: John<br/> <code>names: John, Jack</code> → name: John, Jack<br/> <code>name_tag : John, Jack</code> → name: <a href="/plugin:john_jack" class="wikilink2" title="plugin:john_jack" rel="nofollow" data-wiki-id="plugin:john_jack">John, Jack</a><br/> <code>name_tags: John, Jack</code> → name: <a href="/plugin:john" class="wikilink2" title="plugin:john" rel="nofollow" data-wiki-id="plugin:john">John</a>, <a href="/plugin:jack" class="wikilink2" title="plugin:jack" rel="nofollow" data-wiki-id="plugin:jack">Jack</a><br/> <code>thickness : 1cm</code> → thicknes: 1cm<br/> <code>thickness_: 1cm</code> → thickness: 1cm<br/> <code>thicknesss: 1cm, 2inch</code> → thickness: 1cm, 2inch<br/> </div> </li> </ul> </li> <li class="level1"><div class="li"> When using a type, add the <code>s</code> for multi-values at the very end (like in the <code>server_pages</code> row)</div> </li> <li class="level1 node"><div class="li"> Special <em>types</em> can be added to the name to have the output formatted accordingly. Use an underscore to separate <em>identifier</em> and <em>type</em>. The currently available <em>types</em> are listed in the table below.</div> <ul> <li class="level2"><div class="li"> when no type is given, it's just treated as simple string</div> </li> <li class="level2"><div class="li"> new types can be created by using <a href="#type_aliases" title="plugin:data ↵" class="wikilink1">Type Aliases</a></div> </li> </ul> </li> </ul> <div class="table sectionedit9"><table class="inline"> <thead> <tr class="row0"> <th class="col0"> type </th><th class="col1"> Meaning </th> </tr> </thead> <tr class="row1"> <td class="col0"> <code>dt</code> </td><td class="col1"> a date in the form YYYY-MM-DD, formatted as simple text but the input is checked for correct format </td> </tr> <tr class="row2"> <td class="col0"> <code>page</code> </td><td class="col1"> the entry is treated as Wiki <a href="/pagename" class="wikilink1" title="pagename" data-wiki-id="pagename">pagename</a> and will be linked in output. It is always considered to be an absolute pagename starting in the root namespace. Relative pagenames are not possible. </td> </tr> <tr class="row3"> <td class="col0"> <code>title</code> </td><td class="col1"> like page, but an additional display title can be given separated by a pipe. It is always considered to be an absolute pagename starting in the root namespace. Relative pagenames are not possible. </td> </tr> <tr class="row4"> <td class="col0"> <code>nspage</code> </td><td class="col1"> like page, but the column name is treated as namespace for the link. </td> </tr> <tr class="row5"> <td class="col0"> <code>url</code> </td><td class="col1"> the value will be treated as external link </td> </tr> <tr class="row6"> <td class="col0"> <code>tag</code> </td><td class="col1"> the values are linked to a page named after the column name, using the value as control filter for a data table (change target by a <a href="#change_tag_target_with_a_tag_type_alias" title="plugin:data ↵" class="wikilink1">type alias</a>) </td> </tr> <tr class="row7"> <td class="col0"> <code>mail</code> </td><td class="col1"> the value is checked to contain a valid email address, additional text is used as name that will be linked with the given email address </td> </tr> <tr class="row8"> <td class="col0"> <code>img<num></code> </td><td class="col1"> the input is assumed to be a image <abbr title="Uniform Resource Locator">URL</abbr> or local media id. The optional <num> is the wanted width in pixels to resize the image to (defaults to 40) </td> </tr> <tr class="row9"> <td class="col0"> <code>wiki</code> </td><td class="col1"> render the input as wikitext (use sparingly as this type impacts performance) </td> </tr> <tr class="row10"> <td class="col0"> <code>pageid</code> </td><td class="col1"> the input is the caption for a link to the data entry page </td> </tr> <tr class="row11"> <td class="col0"> <code>hidden</code> </td><td class="col1"> the input will not be shown in the data entry or the entry editor </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_9"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table1" /><input type="hidden" name="range" value="6743-8210" /><button type="submit" title="Table">Edit</button></div></form></div> <p> In the values you can use two placeholders, useful for creating localization depended links. </p> <div class="table sectionedit10"><table class="inline"> <thead> <tr class="row0"> <th class="col0">Variable for value </th><th class="col1"> Meaning </th> </tr> </thead> <tr class="row1"> <td class="col0"> %lang% </td><td class="col1"> Language code of your default wiki language. e.g. <code>en</code> </td> </tr> <tr class="row2"> <td class="col0 leftalign"> %trans% </td><td class="col1 leftalign"> Language code of the localisation of the current page.<br/> Requires the <a href="/plugin:translation" class="wikilink1" title="plugin:translation" data-wiki-id="plugin:translation">Translation</a> Plugin. For page link <code>de:test:page</code>, it is replaced by<br/> <code>de</code>. Fallback to default lang. Empty without Translation Plugin. </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_10"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table2" /><input type="hidden" name="range" value="8306-8637" /><button type="submit" title="Table">Edit</button></div></form></div> </div> <div class="secedit editbutton_section editbutton_8"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Data Entry (Input)] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="data_entry_input" /><input type="hidden" name="codeblockOffset" value="1" /><input type="hidden" name="range" value="3241-8638" /><button type="submit" title="Data Entry (Input)">Edit</button></div></form></div> <h3 class="sectionedit11" id="data_table_output">Data Table (Output)</h3> <div class="level3"> <p> To aggregate the structured data attached to various pages in your wiki this syntax is used. It will display a configurable table with the data you want. The table can be sorted and filtered. Paging<sup><a href="#fn__3" id="fnt__3" class="fn_top">3)</a></sup> is supported as well. And just as with the dataentry, you may add additional words after the datatable keyword. Those will be added as additional <abbr title="Cascading Style Sheets">CSS</abbr> classes in the final <abbr title="HyperText Markup Language">HTML</abbr> output. Let's start with an example again: </p> <pre class="code">---- datatable ---- cols : %pageid%, employees, deadline_dt, website_url, volume headers : Details, Assigned Employees, Deadline, Personal website, $$$ max : 10 filter : type=web development sort : ^volume ----</pre> <p> The above config will display a table with all web development projects, the employees assigned to the project, the deadline and the volume. The table will be sorted by the volume and will display a maximum of 10 projects. </p> <p> Like the dataentry, the values in the columns can also be formatted by postfixing the column names with the typealias. Like the <code>deadline_dt</code> column above. Another example shows <code>website</code>, as an url is given label the entries in cols with e.g. <code>_url</code> to enable linking in output. </p> <p> The keyword before the colon is a configuration option and the value behind is the actual setting. To make it more fault tolerant often multiple option names are possible. Here is a list of all available options: </p> <div class="table sectionedit12"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Option(s) </th><th class="col1 leftalign"> Required? </th><th class="col2 leftalign"> Description </th> </tr> </thead> <tr class="row1"> <td class="col0 leftalign"> cols<br/> select </td><td class="col1 leftalign"> yes </td><td class="col2 leftalign"> These are the attributes you want to display. These are the same <em>names</em> you used in the Data Entry part </td> </tr> <tr class="row2"> <td class="col0 leftalign"> head<br/> header<br/> headers </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> If specified, these names will be used in the table headers instead of the column names </td> </tr> <tr class="row3"> <td class="col0 leftalign"> max<br/> limit </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> How many rows should be displayed. If more rows are available the table will be made browsable. If not given all matching rows are shown </td> </tr> <tr class="row4"> <td class="col0 leftalign"> sort<br/> order </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> By what column should the table be sorted initially? Prepend a <code>^</code> to reverse the sorting </td> </tr> <tr class="row5"> <td class="col0 leftalign"> filter<br/> where<br/> filterand<br/> and </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> Filter by a column value. You may specify this more than once, multiple filters will be ANDed. </td> </tr> <tr class="row6"> <td class="col0 leftalign"> filteror<br/> or </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> Like filter, but multiple instances will be ORed </td> </tr> <tr class="row7"> <td class="col0 leftalign"> dynfilters </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> Set to <code>1</code> to enable a row of input fields for dynamically filtering the table </td> </tr> <tr class="row8"> <td class="col0 leftalign"> summarize </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> Set to <code>1</code> to calculate sum of columns </td> </tr> <tr class="row9"> <td class="col0 leftalign"> align </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> List of column alignments. The alignments can be <code>left</code> (<code>l</code>), <code>center</code> (<code>c</code>) or <code>right</code> (<code>r</code>) </td> </tr> <tr class="row10"> <td class="col0 leftalign"> rownumbers </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> Set to <code>1</code> to show row numbers </td> </tr> <tr class="row11"> <td class="col0 leftalign"> widths </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> Specifies column widths e.g. <code>50px, 20em, -, 10%</code>. Skip column by dash <code>-</code>. (remark: if a cell contains a long string of characters <em class="u">with no space</em>, the width of the corresponding column will not be able to be smaller than the size of this string of characters. Using “widths” to specify a smaller width for this column will have no effect) </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_12"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table3" /><input type="hidden" name="range" value="10076-11609" /><button type="submit" title="Table">Edit</button></div></form></div> <p> For filtering, multiple comparators are possible: </p> <div class="table sectionedit13"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Comparator </th><th class="col1 leftalign"> Meaning </th> </tr> </thead> <tr class="row1"> <td class="col0 leftalign"> <code>=</code> </td><td class="col1 leftalign"> Exact match </td> </tr> <tr class="row2"> <td class="col0 leftalign"> <code>!=</code> or <code><></code> </td><td class="col1 leftalign"> Does not exactly match </td> </tr> <tr class="row3"> <td class="col0 leftalign"> <code><</code> </td><td class="col1 leftalign"> Less than </td> </tr> <tr class="row4"> <td class="col0 leftalign"> <code><=</code> </td><td class="col1 leftalign"> Less than or equal to </td> </tr> <tr class="row5"> <td class="col0 leftalign"> <code>></code> </td><td class="col1 leftalign"> Greater than </td> </tr> <tr class="row6"> <td class="col0 leftalign"> <code>>=</code> </td><td class="col1 leftalign"> Greater than or equal to </td> </tr> <tr class="row7"> <td class="col0 leftalign"> <code>~</code> </td><td class="col1 leftalign"> Wildcard match. Use a <code>*</code> as wildcard. Like <code>Apple*</code> to match <code>Apple Pie</code> and <code>Apple Computer</code>; e.g. <code>dessert~ *Pie</code>. Case insensitive. </td> </tr> <tr class="row8"> <td class="col0 leftalign"> <code>*~</code> </td><td class="col1 leftalign"> Wildcard match. Look for matches containing search term; e.g. <code>dessert*~ Pi</code> match <code>Apple Pie</code> </td> </tr> <tr class="row9"> <td class="col0 leftalign"> <code>!~</code> </td><td class="col1 leftalign"> Negative Wildcard match. Select everything that does not match the expression. </td> </tr> <tr class="row10"> <td class="col0 leftalign"> <code>~~</code> </td><td class="col1 leftalign"> Looks if contained in given comma separated list; e.g. <code>dessert ~~ diner,dessert</code> </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_13"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table4" /><input type="hidden" name="range" value="11662-13542" /><button type="submit" title="Table">Edit</button></div></form></div> <p> You may use the special variables in a filter to make it match against current logged in user or current date e.g. <code>filter: username=%user%</code> </p> <div class="table sectionedit14"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Variable for filtervalue </th><th class="col1 leftalign"> Meaning </th> </tr> </thead> <tr class="row1"> <td class="col0 leftalign"> %user% </td><td class="col1 leftalign"> match against the currently logged in user </td> </tr> <tr class="row2"> <td class="col0 leftalign"> %groups% </td><td class="col1 leftalign"> match against the groups of the current user; use the <code>~~</code> comparator </td> </tr> <tr class="row3"> <td class="col0 leftalign"> %now% </td><td class="col1 leftalign"> compare with the current date </td> </tr> <tr class="row4"> <td class="col0 leftalign"> %lang% </td><td class="col1 leftalign"> Language code of your default wiki language. e.g. <code>en</code> </td> </tr> <tr class="row5"> <td class="col0 leftalign"> %trans% </td><td class="col1 leftalign"> Language code of the localisation of the current page.<br/> Requires the <a href="/plugin:translation" class="wikilink1" title="plugin:translation" data-wiki-id="plugin:translation">Translation</a> Plugin. For page link <code>de:test:page</code>, it is replaced by<br/> <code>de</code>. Fallback to default lang. Empty without Translation Plugin. </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_14"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table5" /><input type="hidden" name="range" value="13689-15170" /><button type="submit" title="Table">Edit</button></div></form></div> <p> There are a few variables available to be used as field names e.g. <code>filter : %pageid%~members:*</code>: </p> <div class="table sectionedit15"><table class="inline"> <thead> <tr class="row0"> <th class="col0"> Variable for fieldname </th><th class="col1"> Meaning </th> </tr> </thead> <tr class="row1"> <td class="col0"> %pageid% </td><td class="col1"> The whole <a href="/pagename" class="wikilink1" title="pagename" data-wiki-id="pagename">pagename</a> of a page </td> </tr> <tr class="row2"> <td class="col0 leftalign"> %title% </td><td class="col1"> The “title” of a page. This is the first headline of a page. </td> </tr> <tr class="row3"> <td class="col0 leftalign"> %class% </td><td class="col1"> The class of a data entry </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_15"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table6" /><input type="hidden" name="range" value="15275-15477" /><button type="submit" title="Table">Edit</button></div></form></div> <p> Additionally, the date of the last modification of found pages can be retrieved and sorted by <code>%lastmod%</code>: </p> <pre class="code">---- datatable ---- cols : %pageid%, %lastmod% headers : Details, Last Update max : 10 filter : type=release notes sort : ^%lastmod% ----</pre> </div> <div class="secedit editbutton_section editbutton_11"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Data Table (Output)] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="data_table_output" /><input type="hidden" name="codeblockOffset" value="2" /><input type="hidden" name="range" value="8639-15754" /><button type="submit" title="Data Table (Output)">Edit</button></div></form></div> <h3 class="sectionedit16" id="data_list_output">Data List (Output)</h3> <div class="level3"> <p> The <code>datalist</code> works like the <code>datatable</code> above and accepts the same parameters. But instead of displaying a table, an unordered list is shown. Each result row is one list item, all selected columns are default joined with a space. When <code>sepbyheaders</code> is not set, the <code>header</code> parameter is completely ignored. No pagination is used. </p> <div class="table sectionedit17"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Option(s) </th><th class="col1"> Required? </th><th class="col2"> Description </th> </tr> </thead> <tr class="row1"> <td class="col0"> sepbyheaders </td><td class="col1 leftalign"> no </td><td class="col2 leftalign"> Set to <code>1</code> to use headers as separators between the values. In headers you can use additional spaces, when enclosed by quotes e.g. <code>" - "</code> </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_17"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table7" /><input type="hidden" name="range" value="16127-16350" /><button type="submit" title="Table">Edit</button></div></form></div><pre class="code">---- datalist ---- cols : %pageid%, volume max : 10 filter : type=web development sort : ^volume ----</pre> </div> <div class="secedit editbutton_section editbutton_16"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Data List (Output)] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="data_list_output" /><input type="hidden" name="codeblockOffset" value="4" /><input type="hidden" name="range" value="15755-16480" /><button type="submit" title="Data List (Output)">Edit</button></div></form></div> <h3 class="sectionedit18" id="related_pages_output">Related Pages (Output)</h3> <div class="level3"> <p> This mode allows you to display a list of pages which are similar to the current page because they share some of the structured data. Which columns are used for similarity comparison has to be given in the <code>cols</code> option. Additional filters and sorting options can be set. Here is an example: </p> <pre class="code">---- datarelated ---- cols : task_tags, type title : Similar projects max : 5 sort : ^volume ----</pre> <p> The shown config will look for pages which share values in the columns <code>task_tags</code> and <code>type</code>. A maximum of 5 pages is shown, sorted by volume. </p> <p> Refer to datatable on what options are available. </p> <p> This mode will <strong>not</strong> disable caching for the page, so the list might not always be up to date. </p> </div> <div class="secedit editbutton_section editbutton_18"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Related Pages (Output)] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="related_pages_output" /><input type="hidden" name="codeblockOffset" value="5" /><input type="hidden" name="range" value="16481-17225" /><button type="submit" title="Related Pages (Output)">Edit</button></div></form></div> <h3 class="sectionedit19" id="tag_cloud_control">Tag Cloud (Control)</h3> <div class="level3"> <p> This syntax will display the values of a given data name as a tag cloud. Each value will link back to the current page (unless configured otherwise by <code>target</code> option). The page should also contain a Data Table - this table will then be filtered for all entries matching the selected tag. </p> <p> Example: </p> <pre class="code">---- datacloud ---- field: employees min: 2 limit: 20 ----</pre> <p> The above code would display a cloud of employees assigned to at least two different projects. A maximum of the 20 most busiest employees are shown. </p> <p> These are the possible options for the cloud: </p> <div class="table sectionedit20"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Option(s) </th><th class="col1"> Required? </th><th class="col2"> Description </th> </tr> </thead> <tr class="row1"> <td class="col0"> field<br/> select<br/> col </td><td class="col1 leftalign"> yes </td><td class="col2"> What attribute is used to build the cloud? </td> </tr> <tr class="row2"> <td class="col0"> limit<br/> max </td><td class="col1"> no </td><td class="col2"> Maximum number of tags to display. If not given all will be displayed </td> </tr> <tr class="row3"> <td class="col0"> min </td><td class="col1"> no </td><td class="col2"> Minimum count a tag must have. If not given all will be shown </td> </tr> <tr class="row4"> <td class="col0"> page<br/> target </td><td class="col1"> no </td><td class="col2"> Give a page which contains the Data Table to control. If not given the current page is used </td> </tr> <tr class="row5"> <td class="col0"> summarize </td><td class="col1"> no </td><td class="col2"> Set to 1 to show sum of field </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_20"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table8" /><input type="hidden" name="range" value="17831-18292" /><button type="submit" title="Table">Edit</button></div></form></div> <p> Additionally filters can be given as described in the datatable syntax. </p> </div> <div class="secedit editbutton_section editbutton_19"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Tag Cloud (Control)] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="tag_cloud_control" /><input type="hidden" name="codeblockOffset" value="6" /><input type="hidden" name="range" value="17226-18366" /><button type="submit" title="Tag Cloud (Control)">Edit</button></div></form></div> <h2 class="sectionedit21" id="customizing_the_styling">Customizing the Styling</h2> <div class="level2"> <p> Position and styling of input and output boxes can be done with simple <abbr title="Cascading Style Sheets">CSS</abbr>. Everything given after the syntax keyword will be assigned as additional class name to the surrounding div. Additionally are the field keys used as classes for the entry box items. </p> <p> Let's assume the following “dataentry” box, as specified at the beginning of the page. </p> <pre class="code">---- dataentry character24 ---- name : Jack Bauer agency_nspage : CTU status_tags : alive, active, disowned, furtive .... more info ----</pre> <p> You now can style this box with <abbr title="Cascading Style Sheets">CSS</abbr> in your <code><dokuwiki>/conf/userstyle.css</code><sup><a href="#fn__4" id="fnt__4" class="fn_top">4)</a></sup>. Here is an example: </p> <pre class="code css">div<span class="re1">.character24</span> <span class="br0">{</span> <span class="coMULTI">/* code for the container block, such as position, layout and borders, goes here */</span> <span class="kw1">float</span><span class="sy0">:</span> <span class="kw2">right</span><span class="sy0">;</span> <span class="kw1">width</span><span class="sy0">:</span> <span class="re3">33%</span><span class="sy0">;</span> <span class="br0">}</span> div<span class="re1">.character24</span> dl <span class="sy0">></span> dt <span class="br0">{</span> <span class="coMULTI">/* this will allow you to style the definition terms */</span> <span class="kw1">font-variant</span><span class="sy0">:</span> <span class="kw2">small-caps</span><span class="sy0">;</span> <span class="br0">}</span> div<span class="re1">.character24</span> dl <span class="sy0">></span> dt <span class="sy0">+</span> dd <span class="br0">{</span> <span class="coMULTI">/* this will allow you to style to the definition values */</span> <span class="kw1">font-family</span><span class="sy0">:</span> <span class="kw2">sans-serif</span><span class="sy0">;</span> <span class="br0">}</span> div<span class="re1">.character24</span> dl dd.name<span class="br0">{</span> <span class="coMULTI">/* this makes the name larger than the rest */</span> <span class="kw1">font-size</span><span class="sy0">:</span> <span class="re3">120%</span><span class="sy0">;</span> <span class="br0">}</span></pre> </div> <div class="secedit editbutton_section editbutton_21"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Customizing the Styling] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="customizing_the_styling" /><input type="hidden" name="codeblockOffset" value="7" /><input type="hidden" name="range" value="18367-19564" /><button type="submit" title="Customizing the Styling">Edit</button></div></form></div> <h2 class="sectionedit22" id="type_aliases">Type aliases</h2> <div class="level2"> <p> Type aliases are custom data types which are defined by a base type (one of the built-in types like <code>page</code> or no type), and optionally a prefix, postfix or a comma-separated set of valid values. Type aliases are managed on their own page in the admin menu and stored in the database. They can be used in data entries, lists and tables like the built-in types. </p> </div> <h4 id="map_type_alias">Map type alias</h4> <div class="level4"> <p> For example to create new datatype <code>map</code> which would open <a href="http://maps.google.com/maps" class="urlextern" title="http://maps.google.com/maps">Google Maps</a>: </p> <p> define <a href="/interwiki" class="wikilink1" title="interwiki" data-wiki-id="interwiki">interwiki</a> address map: </p> <pre class="code">map http://maps.google.com/maps?q={NAME}</pre> <p> And in Admin → Data Plugin: Field Aliases (<code>do=admin&page=data_aliases</code>) define: </p> <div class="table sectionedit23"><table class="inline"> <thead> <tr class="row0"> <th class="col0"> Type Alias </th><th class="col1"> Type </th><th class="col2"> Data Prefix </th><th class="col3"> Data Postfix </th><th class="col4"> Valid values </th> </tr> </thead> <tr class="row1"> <td class="col0 leftalign"> map </td><td class="col1"> wiki </td><td class="col2 leftalign"> [[map> </td><td class="col3 leftalign"> ]] </td><td class="col4 leftalign"> </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_23"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table9" /><input type="hidden" name="range" value="20265-20410" /><button type="submit" title="Table">Edit</button></div></form></div> <p> which you could use now as: </p> <pre class="code">---- dataentry ---- Address_map : 51.103028,-1.780611 ----</pre> <p> You can even enter a valid address, e.g. <code>Bahnhofsstraße 5, Regensburg, Deutschland</code> </p> </div> <h4 id="change_tag_target_with_a_tag_type_alias">Change tag target with a tag type alias</h4> <div class="level4"> <p> Tag links use default the column name as target page. You can change it by a type alias. Give as Prefix the url of the page that has your datatable. Clicking on taglink will filter that table by the tagvalue. </p> <div class="table sectionedit24"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Type Alias </th><th class="col1"> Type </th><th class="col2 leftalign"> Data Prefix </th><th class="col3"> Data Postfix </th><th class="col4"> Valid values </th> </tr> </thead> <tr class="row1"> <td class="col0 leftalign"> newtag </td><td class="col1"> tag </td><td class="col2 leftalign"> namespace:pagewithdatatable </td><td class="col3 leftalign"> </td><td class="col4 leftalign"> </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_24"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table10" /><input type="hidden" name="range" value="20872-21044" /><button type="submit" title="Table">Edit</button></div></form></div> <p> which you could use now as: </p> <pre class="code">---- dataentry ---- Address_newtag : cheese ----</pre> <p> Clicking on this <code>cheese</code> tag will refer to <code>namespace:pagewithdatatable</code> and filter on <code>cheese</code>. </p> </div> <h4 id="ical_type_alias_with_ical-plugin">iCal type alias with iCal-Plugin</h4> <div class="level4"> <p> If you aggregate any meeting, you´d link to combine them to a downloadable link. </p> <p> <a href="/plugin:ical" class="wikilink1" title="plugin:ical" data-wiki-id="plugin:ical">iCal-Plugin</a> </p> <div class="table sectionedit25"><table class="inline"> <thead> <tr class="row0"> <th class="col0"> Type Alias </th><th class="col1"> Type </th><th class="col2"> Data Prefix </th><th class="col3"> Data Postfix </th><th class="col4"> Valid values </th> </tr> </thead> <tr class="row1"> <td class="col0"> ical </td><td class="col1"> wiki </td><td class="col2 leftalign"> {{ical> </td><td class="col3 leftalign"> }} </td><td class="col4 leftalign"> </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_25"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table11" /><input type="hidden" name="range" value="21394-21528" /><button type="submit" title="Table">Edit</button></div></form></div> </div> <h4 id="vcard_type_alias_with_vcard_plugin">vCard type alias with vCard Plugin</h4> <div class="level4"> <p> Setup for the <a href="/plugin:vcard" class="wikilink1" title="plugin:vcard" data-wiki-id="plugin:vcard">vCard</a> plugin is similar to iCal. </p> </div> <div class="secedit editbutton_section editbutton_22"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Type aliases] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="type_aliases" /><input type="hidden" name="codeblockOffset" value="9" /><input type="hidden" name="range" value="19565-21633" /><button type="submit" title="Type aliases">Edit</button></div></form></div> <h2 class="sectionedit26" id="custom_entry_editor">Custom entry editor</h2> <div class="level2"> <p> The data plugin is the first plugin to provide a custom editor for its data entries. Data entries have an own edit button. When pressing this button, the user gets an edit form where she can edit the data entries’ content or – depending on the configuration option <code>edit_content_only</code> – even the structure, i. e. change a field’s name, type or append and delete fields. </p> <p> <a href="/_detail/plugin:data:dataentry_customeditor_structureandvalues.png?id=plugin%3Adata" class="media" title="plugin:data:dataentry_customeditor_structureandvalues.png"><img src="/_media/plugin:data:dataentry_customeditor_structureandvalues.png?w=500&tok=8d327c" class="media" loading="lazy" title="Custom editor with config "edit_content_only" off let's you edit structure and values" alt="Custom editor with config "edit_content_only" off let's you edit structure and values" width="500" /></a> <br/> <em>Custom editor: Editing structure and values</em> </p> <p> <a href="/_detail/plugin:data:dataentry_customeditor_onlyvalues.png?id=plugin%3Adata" class="media" title="plugin:data:dataentry_customeditor_onlyvalues.png"><img src="/_media/plugin:data:dataentry_customeditor_onlyvalues.png?w=500&tok=37d0bb" class="media" loading="lazy" title="Custom editor with config "edit_content_only" on let's you edit only values" alt="Custom editor with config "edit_content_only" on let's you edit only values" width="500" /></a><br/> <em>Custom editor: Editing only values by switching on config option <code>edit_content_only</code></em> </p> </div> <h4 id="nice_fields_for_edit_content_only">Nice fields for "edit_content_only"</h4> <div class="level4"> <p> When the configuration option <code>edit_content_only</code> is enabled, some nice fields are used: </p> <ul> <li class="level1"><div class="li"> Dropdown list is shown filled with the values given in the <code>Valid values</code> column of <a href="#type_aliases" title="plugin:data ↵" class="wikilink1">type aliases</a>.</div> </li> <li class="level1"><div class="li"> Datepicker for fields of type <code>dt</code> </div> </li> <li class="level1"><div class="li"> Autocompletion suggestion of existing pages for <a href="#type_aliases" title="plugin:data ↵" class="wikilink1">type aliases</a> based on the <code>page</code> type<br/> (type <code>page</code> itself don't work)</div> </li> </ul> <p> <strong>Requirement</strong>: The datepicker and pagesuggestions needs the <a href="/plugin:bureaucracy" class="wikilink1" title="plugin:bureaucracy" data-wiki-id="plugin:bureaucracy">bureaucracy</a> plugin, which supplies the JavaScript magic. </p> <p> Page suggestions are activated by a type alias of type <code>page</code>. The second alias shows only pages in <code>plugin:</code> namespace, demonstrated in the image too. </p> <div class="table sectionedit27"><table class="inline"> <thead> <tr class="row0"> <th class="col0 leftalign"> Type Alias </th><th class="col1 leftalign"> Type </th><th class="col2 leftalign"> Data Prefix </th><th class="col3 leftalign"> Data Postfix </th><th class="col4 leftalign"> Valid values </th> </tr> </thead> <tr class="row1"> <td class="col0 leftalign"> pagesuggest </td><td class="col1 leftalign"> page </td><td class="col2 leftalign"> </td><td class="col3 leftalign"> </td><td class="col4 leftalign"> </td> </tr> <tr class="row2"> <td class="col0 leftalign"> pagesuggestplugin </td><td class="col1 leftalign"> page </td><td class="col2 centeralign"> plugin: </td><td class="col3 leftalign"> </td><td class="col4 leftalign"> </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_27"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table12" /><input type="hidden" name="range" value="23205-23438" /><button type="submit" title="Table">Edit</button></div></form></div> <p> <a href="/_detail/plugin:data:dataentry_bureaucracy_datapicker_selects.png?id=plugin%3Adata" class="media" title="plugin:data:dataentry_bureaucracy_datapicker_selects.png"><img src="/_media/plugin:data:dataentry_bureaucracy_datapicker_selects.png?w=250&tok=18acb0" class="medialeft" loading="lazy" title="Custom entry editor: datepicker for _dt and selects for alias type with Valid values" alt="Custom entry editor: datepicker for _dt and selects for alias type with Valid values" width="250" /></a> </p> <p> <a href="/_detail/plugin:data:dataentry_bureaucracy_pagepicker.png?id=plugin%3Adata" class="media" title="plugin:data:dataentry_bureaucracy_pagepicker.png"><img src="/_media/plugin:data:dataentry_bureaucracy_pagepicker.png?w=270&tok=840e21" class="mediacenter" loading="lazy" title="Custom entry editor: pagesuggestions for type aliases of page type. Suggestions show page title and in brackets the page name." alt="Custom entry editor: pagesuggestions for type aliases of page type. Suggestions show page title and in brackets the page name." width="270" /></a> </p> <p> <em>Left: custom editor with datapicker field and a single and a multiple select field.<br/> <br/> Right: a field with pagesuggestions.</em> </p> </div> <div class="secedit editbutton_section editbutton_26"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Custom entry editor] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="custom_entry_editor" /><input type="hidden" name="codeblockOffset" value="12" /><input type="hidden" name="range" value="21634-23911" /><button type="submit" title="Custom entry editor">Edit</button></div></form></div> <h2 class="sectionedit28" id="bureaucracy_plugin_and_type_aliases">Bureaucracy plugin and type aliases</h2> <div class="level2"> <p> The nice fields of data plugin used in the custom entry editor are also available for fields in the form of the <a href="/plugin:bureaucracy" class="wikilink1" title="plugin:bureaucracy" data-wiki-id="plugin:bureaucracy">Bureaucracy Plugin</a>. These are: select of valid values, datepicker and pagesuggestions. Other types are allowed, but are a plain textbox only. </p> <p> Some examples of defining form fields in the bureaucracy form, using dataplugin fields: </p> <pre class="code">data_aliastextbox Tag _fixedtag data_aliastextbox Multitags _fixedtags data_aliastextbox "Date of happening" _dt data_aliastextbox "Plugin Page" _pagesuggestplugin</pre> <p> Last line uses the type alias of previous section, the first two lines are in combination with type alias: </p> <div class="table sectionedit29"><table class="inline"> <tr class="row0"> <td class="col0 leftalign"> fixedtag </td><td class="col1 leftalign"> tag </td><td class="col2 leftalign"> </td><td class="col3 leftalign"> </td><td class="col4 centeralign"> Book, Notebook, Reader </td> </tr> </table></div> <div class="secedit editbutton_table editbutton_29"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table13" /><input type="hidden" name="range" value="24616-24672" /><button type="submit" title="Table">Edit</button></div></form></div> <p> <a href="/_detail/plugin:data:bureaucracy_form_datepicker.png?id=plugin%3Adata" class="media" title="plugin:data:bureaucracy_form_datepicker.png"><img src="/_media/plugin:data:bureaucracy_form_datepicker.png" class="medialeft" loading="lazy" title="Datepicker for dataplugin _dt field in a bureaucracy form" alt="Datepicker for dataplugin _dt field in a bureaucracy form" /></a> <a href="/_detail/plugin:data:bureaucracy_form_selects.png?id=plugin%3Adata" class="media" title="plugin:data:bureaucracy_form_selects.png"><img src="/_media/plugin:data:bureaucracy_form_selects.png" class="mediacenter" loading="lazy" title="Single and multiple select for dataplugin field using a type alias with Valid values in a bureacracy form" alt="Single and multiple select for dataplugin field using a type alias with Valid values in a bureacracy form" /></a> </p> <p> Left image shows a datepicker in a bureaucracy form and right a single and a multiple select, these are created with a type alias which defines some valid values. </p> </div> <div class="secedit editbutton_section editbutton_28"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Bureaucracy plugin and type aliases] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="bureaucracy_plugin_and_type_aliases" /><input type="hidden" name="codeblockOffset" value="12" /><input type="hidden" name="range" value="23912-25103" /><button type="submit" title="Bureaucracy plugin and type aliases">Edit</button></div></form></div> <h2 class="sectionedit30" id="translation_support">Translation Support</h2> <div class="level2"> <p> If you use the <a href="/plugin:translation" class="wikilink1" title="plugin:translation" data-wiki-id="plugin:translation">translation</a> plugin, you might want to use the same data entries in different languages. The plugin allows for translated field names – values will not be translated. If you only want to use English field names while having them displayed in your language, you can also follow these instructions. </p> <p> To create fieldname translations, create a file in <code>conf/lang/<langcode>/data-plugin.php</code>. The file needs to contain a PHP array named <code>$lang</code> with the fieldname in the array key and the translation in the value: </p> <dl class="code"> <dt><a href="/_export/code/plugin:data?codeblock=12" title="Download Snippet" class="mediafile mf_php">conf/lang/en/data-plugin.php</a></dt> <dd><pre class="code php"><span class="kw2"><?php</span> <span class="re0">$lang</span><span class="br0">[</span><span class="st_h">'somekey'</span><span class="br0">]</span> <span class="sy0">=</span> <span class="st_h">'My name for the key'</span><span class="sy0">;</span> <span class="re0">$lang</span><span class="br0">[</span><span class="st_h">'otherkey'</span><span class="br0">]</span> <span class="sy0">=</span> <span class="st_h">'My name for the other key'</span><span class="sy0">;</span></pre> </dd></dl> <p> Fieldnames are to be given without their type. So it's <code>deadline</code> not <code>deadline_dt</code>. </p> <p> After creating or modifiying data-plugin.php file, please update wiki configuration to refresh cache <code>start?do=admin&page=config</code>, otherwise modifications are not taken into account. </p> </div> <div class="secedit editbutton_section editbutton_30"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Translation Support] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="translation_support" /><input type="hidden" name="codeblockOffset" value="12" /><input type="hidden" name="range" value="25104-26098" /><button type="submit" title="Translation Support">Edit</button></div></form></div> <h2 class="sectionedit31" id="missing_features">Missing Features</h2> <div class="level2"> <ul> <li class="level1 node"><div class="li"> more control options:</div> <ul> <li class="level2"><div class="li"> attribute list (similar to tag cloud but as a simple list)</div> </li> <li class="level2"><div class="li"> search field – see <a href="/plugin:datasearchform" class="wikilink1" title="plugin:datasearchform" data-wiki-id="plugin:datasearchform">datasearchform</a> plugin</div> </li> </ul> </li> <li class="level1 node"><div class="li"> <strong>better documentation, examples</strong></div> <ul> <li class="level2"><div class="li"> Please provide suggestions for which pieces need more attention or where you do not understand stuff. Thanks.</div> </li> </ul> </li> <li class="level1"><div class="li"> Add JavaScript support for the content_only edit form to the full-blown form as well</div> </li> <li class="level1"><div class="li"> more data types?</div> </li> <li class="level1"><div class="li"> links in aggregations and data entries don't generate backlinks</div> </li> <li class="level1"><div class="li"> search data in a specific namespace</div> </li> <li class="level1"><div class="li"> WHERE checks against date fields need SQL INTERVAL equivalent (“WHERE field_dt < %now% + INTERVAL 6 MONTH” equals to “field_dt before 6 months from now”)</div> </li> <li class="level1"><div class="li"> compare against “this page” name (in datatable)</div> </li> <li class="level1"><div class="li"> history for the type alias table (changes in the table can affect the pages, but no record and no revert is available).</div> </li> <li class="level1"><div class="li"> More data-entry blocks at one page. Reason: the Data Plugin is designed as data-entry block per page. ⇒ Recommended alternative: <a href="/plugin:strata" class="wikilink1" title="plugin:strata" data-wiki-id="plugin:strata">Strata Plugin</a>, which is equivalent to Data plugin, but bit more sophisticated.</div> </li> </ul> </div> <div class="secedit editbutton_section editbutton_31"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Missing Features] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="missing_features" /><input type="hidden" name="codeblockOffset" value="13" /><input type="hidden" name="range" value="26099-27217" /><button type="submit" title="Missing Features">Edit</button></div></form></div> <h2 class="sectionedit32" id="examples">Examples</h2> <div class="level2"> <p> Some use cases: </p> <ul> <li class="level1 node"><div class="li"> This plugin may be seen in action on this wiki in the <a href="/dokuinstall" class="wikilink1" title="dokuinstall" data-wiki-id="dokuinstall">DokuWiki Installations</a> namespace. </div> <ul> <li class="level2"><div class="li"> Look for the <code>datatable</code> in the source of <a href="/dokuinstall" class="wikilink1" title="dokuinstall" data-wiki-id="dokuinstall">DokuWiki Installations</a></div> </li> <li class="level2"><div class="li"> and for a <code>dataentry</code> in some of the <a href="/dokuinstall:southeastern" class="wikilink1" title="dokuinstall:southeastern" data-wiki-id="dokuinstall:southeastern">individual installation pages</a>.</div> </li> </ul> </li> <li class="level1"><div class="li"> Very interesting and organized wiki setup: <a href="http://www.ickewiki.de/ickewiki" class="urlextern" title="http://www.ickewiki.de/ickewiki">ICKEwiki</a> by <a href="http://www.cosmocode.de/en/wiki/ickewiki" class="urlextern" title="http://www.cosmocode.de/en/wiki/ickewiki">Cosmocode</a> integrates the Data Plugin with some other plugins such as <a href="/plugin:bureaucracy" class="wikilink1" title="plugin:bureaucracy" data-wiki-id="plugin:bureaucracy">Bureaucracy</a> to a complete enterprise wiki tool. Follow links to the (German) Demo, which let you access the wiki as employee. </div> </li> <li class="level1"><div class="li"> <a href="/plugin:data:list_of_employees" class="wikilink1" title="plugin:data:list_of_employees" data-wiki-id="plugin:data:list_of_employees">DokuWiki usecase: list of employees</a> – How to use Data Plugin with <a href="/plugin:bureaucracy" class="wikilink1" title="plugin:bureaucracy" data-wiki-id="plugin:bureaucracy">Bureaucracy</a> Plugin and <a href="/plugin:wrap" class="wikilink1" title="plugin:wrap" data-wiki-id="plugin:wrap">Wrap</a> Plugin. A manual by <a href="https://forum.dokuwiki.org/u/lolmaus" class="interwiki iw_user" title="https://forum.dokuwiki.org/u/lolmaus">lolmaus</a>.</div> </li> </ul> </div> <div class="secedit editbutton_section editbutton_32"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Examples] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="examples" /><input type="hidden" name="codeblockOffset" value="13" /><input type="hidden" name="range" value="27218-28081" /><button type="submit" title="Examples">Edit</button></div></form></div> <h2 class="sectionedit33" id="question_and_answers">Question and Answers</h2> <div class="level2"> </div> <div class="secedit editbutton_section editbutton_33"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Question and Answers] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="question_and_answers" /><input type="hidden" name="codeblockOffset" value="13" /><input type="hidden" name="range" value="28082-28115" /><button type="submit" title="Question and Answers">Edit</button></div></form></div> <h3 class="sectionedit34" id="how_to_refresh_data">How to refresh data?</h3> <div class="level3"> <p> The data that is copied to the SQLite database <em>should</em> be refreshed automatically whenever the page containing the dataentry box is changed. If you deleted or renamed pages outside the wiki, the database will still contain data about now non-existing pages. These can be cleaned using the <code>Data Plugin: Clean up database</code> entry in the Admin menu. </p> <p> However there might be some bugs making this not always 100% reliable. Refer to the <a href="#open_bugs" title="plugin:data ↵" class="wikilink1">open bugs</a> section and <a href="#changes" title="plugin:data ↵" class="wikilink1">changes</a> to see what might be broken or what was recently fixed. </p> <p> When you delete the whole database, all entry pages have to be re-rendered to repopulate the database. There is no automatic way to do so. </p> <p> In case page were externally modified, or fresh database, few tricks to refresh the database are: </p> <ul> <li class="level1"><div class="li"> to download the wiki pages, in batch, using wget, a command-line file downloader;</div> </li> <li class="level1"><div class="li"> to install the <a href="/plugin:searchindex" class="wikilink1" title="plugin:searchindex" data-wiki-id="plugin:searchindex">searchindex</a> plugin, launch the newly added <code>SearchIndex Manager</code> panel in Admin menu and click the <code>Rebuild Index</code> button.</div> </li> </ul> <p> You can of course open the database file directly in the SQLite command line client and manipulate it through SQL queries. </p> </div> <div class="secedit editbutton_section editbutton_34"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[How to refresh data?] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="how_to_refresh_data" /><input type="hidden" name="codeblockOffset" value="13" /><input type="hidden" name="range" value="28116-29288" /><button type="submit" title="How to refresh data?">Edit</button></div></form></div> <h3 class="sectionedit35" id="what_is_the_difference_between_strata_plugin_and_data_plugin">What is the difference between Strata plugin and Data plugin?</h3> <div class="level3"> <p> The <a href="/plugin:strata" class="wikilink1" title="plugin:strata" data-wiki-id="plugin:strata">Strata Plugin</a> is in the big lines equivalent to Data plugin. However, it has more sophisticated query syntax, less and simpler 'aliastypes' system and additional features like graph or output based at an predefined template. So for handling of more complicated data the Strata Plugin has more opportunities. </p> </div> <div class="secedit editbutton_section editbutton_35"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[What is the difference between Strata plugin and Data plugin?] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="what_is_the_difference_between_strata_plugin_and_data_plugin" /><input type="hidden" name="codeblockOffset" value="13" /><input type="hidden" name="range" value="29289-29692" /><button type="submit" title="What is the difference between Strata plugin and Data plugin?">Edit</button></div></form></div> <h3 class="sectionedit36" id="how_do_you_filter_empty_fields_values">How do you filter empty fields/values?</h3> <div class="level3"> <p> Suppose some entries contain empty fields and you want to display such entries: how do you write the filter in the query to output these? </p> <p> e.g. </p> <pre class="code">---- dataentry projects ---- type : web development volume : 1 Mrd # how much do they pay? employees : Joe, Jane, Jim description_wiki: **Important** project customer_page : ----</pre> <p> and if the query is: </p> <pre class="code">---- datatable ---- cols : %pageid% headers : Details filter : customer_page= ----</pre> <p> the output does not show the above record </p> <div class="table sectionedit37"><table class="inline"> <thead> <tr class="row0"> <th class="col0">The solution is to change the filter to a value that will always be populated. </th> </tr> </thead> <tr class="row1"> <td class="col0"><pre class="code">---- datatable ---- cols : %pageid% headers : Details filter : %class% = projects ----</pre> </td> </tr> <tr class="row2"> <td class="col0 rightalign"> — <a href="https://forum.dokuwiki.org/u/SFITCS" class="interwiki iw_user" title="https://forum.dokuwiki.org/u/SFITCS">SFITCS</a> <em>2016-10-15 04:58</em></td> </tr> </table></div> <div class="secedit editbutton_table editbutton_37"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Table] " /><input type="hidden" name="target" value="table" /><input type="hidden" name="hid" value="table14" /><input type="hidden" name="range" value="30281-30520" /><button type="submit" title="Table">Edit</button></div></form></div> </div> <div class="secedit editbutton_section editbutton_36"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[How do you filter empty fields/values?] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="how_do_you_filter_empty_fields_values" /><input type="hidden" name="codeblockOffset" value="13" /><input type="hidden" name="range" value="29693-30521" /><button type="submit" title="How do you filter empty fields/values?">Edit</button></div></form></div> <h3 class="sectionedit38" id="why_don_t_my_variables_placeholders_work_when_i_create_a_table_in_a_namespace_template">Why don't my variables/placeholders work when I create a table in a namespace template?</h3> <div class="level3"> <p> DokuWiki calls <a href="https://secure.php.net/strftime" class="interwiki iw_phpfn" title="https://secure.php.net/strftime">strftime</a> on <code>_template.txt</code> when creating a new page. This replaces some combinations of %[a-z] (for example, %title% will become [TAB]itle%). When using placeholders in <code>_template.txt</code> you should use double percent signs (%%title%%). Strftime will treat those as literal percent characters. </p> </div> <div class="secedit editbutton_section editbutton_38"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Why don't my variables/placeholders work when I create a table in a namespace template?] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="why_don_t_my_variables_placeholders_work_when_i_create_a_table_in_a_namespace_template" /><input type="hidden" name="codeblockOffset" value="16" /><input type="hidden" name="range" value="30522-30959" /><button type="submit" title="Why don't my variables/placeholders work when I create a table in a namespace template?">Edit</button></div></form></div> <h3 class="sectionedit39" id="other_questions">Other Questions</h3> <div class="level3"> <p> If you still have questions, search the forum and if it hasn't been asked before ask your question there. Please leave bug reports on Github's issue tracker. </p> <hr /> </div> <div class="secedit editbutton_section editbutton_39"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Other Questions] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="other_questions" /><input type="hidden" name="codeblockOffset" value="16" /><input type="hidden" name="range" value="30960-31151" /><button type="submit" title="Other Questions">Edit</button></div></form></div> <h2 class="sectionedit40" id="customisations">Customisations</h2> <div class="level2"> <p> <strong>Important!</strong> These are <em>hacks</em> – there is no guarantee they'll always work, and they will <strong>not</strong> survive updates. </p> <p> If it breaks you get to keep the pieces. <img src="/lib/images/smileys/smile.svg" class="icon smiley" alt=":-)" /> </p> </div> <div class="secedit editbutton_section editbutton_40"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Customisations] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="customisations" /><input type="hidden" name="codeblockOffset" value="16" /><input type="hidden" name="range" value="31152-31347" /><button type="submit" title="Customisations">Edit</button></div></form></div> <h3 class="sectionedit41" id="customise_the_date_format">Customise the Date Format</h3> <div class="level3"> <p> <strong>NOTE:</strong> The configuration setting for the PHP strftime function in <code>/conf/dokuwiki.php</code> also need to be changed (can also be changed via <strong>Admin→Configuration</strong>) </p> <pre class="code">$conf['dformat'] = '%d/%m/%Y %H:%M';</pre> <p> To change the default date format from <code>yy-mm-dd</code> to <code>dd-mm-yy</code> (e.g. for Australia) </p> <p> Change this: </p> <dl class="code"> <dt><a href="/_export/code/plugin:data?codeblock=17" title="Download Snippet" class="mediafile mf_php">plugins/data/helper.php</a></dt> <dd><pre class="code php"> <span class="co4">/** * Replace placeholders in sql */</span> <span class="kw2">function</span> _replacePlaceholdersInSQL<span class="br0">(</span><span class="sy0">&</span><span class="re0">$data</span><span class="br0">)</span> <span class="br0">{</span> <span class="kw2">global</span> <span class="re0">$USERINFO</span><span class="sy0">;</span> <span class="co1">// allow current user name in filter:</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">(</span><span class="st_h">'%user%'</span><span class="sy0">,</span> <span class="re0">$_SERVER</span><span class="br0">[</span><span class="st_h">'REMOTE_USER'</span><span class="br0">]</span><span class="sy0">,</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">(</span><span class="st_h">'%groups%'</span><span class="sy0">,</span> <a href="http://www.php.net/implode"><span class="kw3">implode</span></a><span class="br0">(</span><span class="st0">"','"</span><span class="sy0">,</span> <span class="br0">(</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">)</span> <span class="re0">$USERINFO</span><span class="br0">[</span><span class="st_h">'grps'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">,</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span>$ <span class="co1">// allow current date in filter:</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">(</span><span class="st_h">'%now%'</span><span class="sy0">,</span> dformat<span class="br0">(</span><span class="kw4">null</span><span class="sy0">,</span> <span class="st_h">'%Y-%m-%d'</span><span class="br0">)</span><span class="sy0">,</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="co1">// language filter</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-></span><span class="me1">makeTranslationReplacement</span><span class="br0">(</span><span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="br0">}</span></pre> </dd></dl> <p> to this: </p> <dl class="code"> <dt><a href="/_export/code/plugin:data?codeblock=18" title="Download Snippet" class="mediafile mf_php">plugins/data/helper.php</a></dt> <dd><pre class="code php"> <span class="co4">/** * Replace placeholders in sql */</span> <span class="kw2">function</span> _replacePlaceholdersInSQL<span class="br0">(</span><span class="sy0">&</span><span class="re0">$data</span><span class="br0">)</span> <span class="br0">{</span> <span class="kw2">global</span> <span class="re0">$USERINFO</span><span class="sy0">;</span> <span class="co1">// allow current user name in filter:</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">(</span><span class="st_h">'%user%'</span><span class="sy0">,</span> <span class="re0">$_SERVER</span><span class="br0">[</span><span class="st_h">'REMOTE_USER'</span><span class="br0">]</span><span class="sy0">,</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">(</span><span class="st_h">'%groups%'</span><span class="sy0">,</span> <a href="http://www.php.net/implode"><span class="kw3">implode</span></a><span class="br0">(</span><span class="st0">"','"</span><span class="sy0">,</span> <span class="br0">(</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">)</span> <span class="re0">$USERINFO</span><span class="br0">[</span><span class="st_h">'grps'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">,</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span>$ <span class="co1">// allow current date in filter:</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">(</span><span class="st_h">'%now%'</span><span class="sy0">,</span> dformat<span class="br0">(</span><span class="kw4">null</span><span class="sy0">,</span> <span class="st_h">'%d-%m-%Y'</span><span class="br0">)</span><span class="sy0">,</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="co1">// language filter</span> <span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-></span><span class="me1">makeTranslationReplacement</span><span class="br0">(</span><span class="re0">$data</span><span class="br0">[</span><span class="st_h">'sql'</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="br0">}</span></pre> </dd></dl> <p> and change this: </p> <dl class="code"> <dt><a href="/_export/code/plugin:data?codeblock=19" title="Download Snippet" class="mediafile mf_php">plugins/data/helper.php</a></dt> <dd><pre class="code php"><span class="kw1">switch</span><span class="br0">(</span><span class="re0">$type</span><span class="br0">)</span> <span class="br0">{</span> <span class="kw1">case</span> <span class="st_h">'dt'</span><span class="sy0">:</span> <span class="kw1">if</span><span class="br0">(</span><a href="http://www.php.net/preg_match"><span class="kw3">preg_match</span></a><span class="br0">(</span><span class="st_h">'/^(\d\d\d\d)-(\d\d?)-(\d\d?)$/'</span><span class="sy0">,</span> <span class="re0">$value</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span> <span class="kw1">return</span> <a href="http://www.php.net/sprintf"><span class="kw3">sprintf</span></a><span class="br0">(</span><span class="st_h">'%d-%02d-%02d'</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">[</span><span class="nu0">1</span><span class="br0">]</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">[</span><span class="nu0">2</span><span class="br0">]</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">[</span><span class="nu0">3</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="br0">}</span></pre> </dd></dl> <p> to this: </p> <dl class="code"> <dt><a href="/_export/code/plugin:data?codeblock=20" title="Download Snippet" class="mediafile mf_php">plugins/data/helper.php</a></dt> <dd><pre class="code php"><span class="kw1">switch</span><span class="br0">(</span><span class="re0">$type</span><span class="br0">)</span> <span class="br0">{</span> <span class="kw1">case</span> <span class="st_h">'dt'</span><span class="sy0">:</span> <span class="kw1">if</span><span class="br0">(</span><a href="http://www.php.net/preg_match"><span class="kw3">preg_match</span></a><span class="br0">(</span><span class="st_h">'/^(\d\d?)-(\d\d?)-(\d\d\d\d)$/'</span><span class="sy0">,</span> <span class="re0">$value</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span> <span class="kw1">return</span> <a href="http://www.php.net/sprintf"><span class="kw3">sprintf</span></a><span class="br0">(</span><span class="st_h">'%02d-%02d-%d'</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">[</span><span class="nu0">1</span><span class="br0">]</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">[</span><span class="nu0">2</span><span class="br0">]</span><span class="sy0">,</span> <span class="re0">$m</span><span class="br0">[</span><span class="nu0">3</span><span class="br0">]</span><span class="br0">)</span><span class="sy0">;</span> <span class="br0">}</span></pre> </dd></dl> <p> and change this: </p> <dl class="code"> <dt><a href="/_export/code/plugin:data?codeblock=21" title="Download Snippet" class="mediafile mf_js">plugins/data/script.js</a></dt> <dd><pre class="code javascript"><span class="coMULTI">/** * Init datepicker for all date fields */</span> jQuery<span class="br0">(</span><span class="kw1">function</span> <span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span> jQuery<span class="br0">(</span><span class="st0">'.data_type_dt input'</span><span class="br0">)</span>.<span class="me1">datepicker</span><span class="br0">(</span><span class="br0">{</span> dateFormat<span class="sy0">:</span> <span class="st0">"yy-mm-dd"</span><span class="sy0">,</span> changeMonth<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span> changeYear<span class="sy0">:</span> <span class="kw2">true</span> <span class="br0">}</span><span class="br0">)</span><span class="sy0">;</span></pre> </dd></dl> <p> to this: </p> <dl class="code"> <dt><a href="/_export/code/plugin:data?codeblock=22" title="Download Snippet" class="mediafile mf_js">plugins/data/script.js</a></dt> <dd><pre class="code javascript"><span class="coMULTI">/** * Init datepicker for all date fields */</span> jQuery<span class="br0">(</span><span class="kw1">function</span> <span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span> jQuery<span class="br0">(</span><span class="st0">'.data_type_dt input'</span><span class="br0">)</span>.<span class="me1">datepicker</span><span class="br0">(</span><span class="br0">{</span> dateFormat<span class="sy0">:</span> <span class="st0">"dd-mm-yy"</span><span class="sy0">,</span> changeMonth<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span> changeYear<span class="sy0">:</span> <span class="kw2">true</span> <span class="br0">}</span><span class="br0">)</span><span class="sy0">;</span></pre> </dd></dl> <p> — <a href="https://forum.dokuwiki.org/u/SFITCS" class="interwiki iw_user" title="https://forum.dokuwiki.org/u/SFITCS">SFITCS</a> <em>2016-11-26 01:24</em> </p> </div> <div class="secedit editbutton_section editbutton_41"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Customise the Date Format] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="customise_the_date_format" /><input type="hidden" name="codeblockOffset" value="16" /><input type="hidden" name="range" value="31348-34108" /><button type="submit" title="Customise the Date Format">Edit</button></div></form></div> <h2 class="sectionedit42" id="bugs_feature_requests_and_patches">Bugs, Feature Requests and Patches</h2> <div class="level2"> <p> Please submit bugs and feature requests in the <a href="https://github.com/splitbrain/dokuwiki-plugin-data/issues" class="urlextern" title="https://github.com/splitbrain/dokuwiki-plugin-data/issues">issue tracker on GitHub</a>. Patches should be sent unified diff format or as git patches against the devel branch. Or even better: fork the repository at github and send a merge request. </p> </div> <div class="secedit editbutton_section editbutton_42"><form class="button btn_secedit" method="post" action="/plugin:data"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1713264860" /><input type="hidden" name="summary" value="[Bugs, Feature Requests and Patches] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="bugs_feature_requests_and_patches" /><input type="hidden" name="codeblockOffset" value="23" /><input type="hidden" name="range" value="34109-" /><button type="submit" title="Bugs, Feature Requests and Patches">Edit</button></div></form></div><div class="footnotes"> <div class="fn"><sup><a href="#fnt__1" id="fn__1" class="fn_bot">1)</a></sup> <div class="content">any additional <code>dataentry</code> on the same page would overwrite any preceding dataentry on this page and so - while many dataentry blocks on one page may be displayed - only the values of the last one would be stored in the SQLite database and could be retrieved as an output by e.g. a <code>datatable</code></div></div> <div class="fn"><sup><a href="#fnt__2" id="fn__2" class="fn_bot">2)</a></sup> <div class="content">details: an <code>s</code> suffix results for e.g. “adam, eve” in a <em>list</em> that you can request per element with <code>~</code> or as a whole with <code>*~</code>, without <code>s</code> suffix “adam, eve” will be stored as a <em>string</em> that you can request only as a whole with <code>*~</code> - given that, in most contexts the <code>s</code> suffix is rather a matter of semantic clearness than a technical requirement (for field values that humans understand as multiple or list values) </div></div> <div class="fn"><sup><a href="#fnt__3" id="fn__3" class="fn_bot">3)</a></sup> <div class="content">what does this mean?</div></div> <div class="fn"><sup><a href="#fnt__4" id="fn__4" class="fn_bot">4)</a></sup> <div class="content">About <a href="/devel:css#user_styles" class="wikilink1" title="devel:css" data-wiki-id="devel:css">user css styles</a></div></div> </div> <!-- wikipage stop --> </div> <div class="docInfo"><bdi>plugin/data.txt</bdi> · Last modified: <time datetime="2024-04-16T12:54:20+0200">2024-04-16 12:54</time> by <bdi>asheenlevrai</bdi></div> <hr class="a11y" /> </div></main><!-- /content --> <!-- PAGE ACTIONS --> <nav id="dokuwiki__pagetools" aria-labelledby="dokuwiki__pagetools__heading"> <h3 class="a11y" id="dokuwiki__pagetools__heading">Page Tools</h3> <div class="tools"> <ul> <li class="edit"><a href="/plugin:data?do=edit" title="Edit this page [e]" rel="nofollow" accesskey="e"><span>Edit this page</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg></a></li><li class="revs"><a href="/plugin:data?do=revisions" title="Old revisions [o]" rel="nofollow" accesskey="o"><span>Old revisions</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M11 7v5.11l4.71 2.79.79-1.28-4-2.37V7m0-5C8.97 2 5.91 3.92 4.27 6.77L2 4.5V11h6.5L5.75 8.25C6.96 5.73 9.5 4 12.5 4a7.5 7.5 0 0 1 7.5 7.5 7.5 7.5 0 0 1-7.5 7.5c-3.27 0-6.03-2.09-7.06-5h-2.1c1.1 4.03 4.77 7 9.16 7 5.24 0 9.5-4.25 9.5-9.5A9.5 9.5 0 0 0 12.5 2z"/></svg></a></li><li class="backlink"><a href="/plugin:data?do=backlink" title="Backlinks" rel="nofollow"><span>Backlinks</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10.59 13.41c.41.39.41 1.03 0 1.42-.39.39-1.03.39-1.42 0a5.003 5.003 0 0 1 0-7.07l3.54-3.54a5.003 5.003 0 0 1 7.07 0 5.003 5.003 0 0 1 0 7.07l-1.49 1.49c.01-.82-.12-1.64-.4-2.42l.47-.48a2.982 2.982 0 0 0 0-4.24 2.982 2.982 0 0 0-4.24 0l-3.53 3.53a2.982 2.982 0 0 0 0 4.24m2.82-4.24c.39-.39 1.03-.39 1.42 0a5.003 5.003 0 0 1 0 7.07l-3.54 3.54a5.003 5.003 0 0 1-7.07 0 5.003 5.003 0 0 1 0-7.07l1.49-1.49c-.01.82.12 1.64.4 2.43l-.47.47a2.982 2.982 0 0 0 0 4.24 2.982 2.982 0 0 0 4.24 0l3.53-3.53a2.982 2.982 0 0 0 0-4.24.973.973 0 0 1 0-1.42z"/></svg></a></li><li class="top"><a href="#dokuwiki__top" title="Back to top [t]" rel="nofollow" accesskey="t"><span>Back to top</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"/></svg></a></li> </ul> </div> </nav> </div><!-- /wrapper --> <!-- ********** FOOTER ********** --> <footer id="dokuwiki__footer"><div class="pad"> <div class="license">Except where otherwise noted, content on this wiki is licensed under the following license: <bdi><a href="https://creativecommons.org/licenses/by-sa/4.0/deed.en" rel="license" class="urlextern">CC Attribution-Share Alike 4.0 International</a></bdi></div> <div class="buttons"> <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.en" rel="license"><img src="/lib/images/license/button/cc-by-sa.png" alt="CC Attribution-Share Alike 4.0 International" /></a> <a href="https://www.dokuwiki.org/donate" title="Donate" ><img src="/lib/tpl/dokuwiki/images/button-donate.gif" width="80" height="15" alt="Donate" /></a> <a href="https://php.net" title="Powered by PHP" ><img src="/lib/tpl/dokuwiki/images/button-php.gif" width="80" height="15" alt="Powered by PHP" /></a> <a href="//validator.w3.org/check/referer" title="Valid HTML5" ><img src="/lib/tpl/dokuwiki/images/button-html5.png" width="80" height="15" alt="Valid HTML5" /></a> <a href="//jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" ><img src="/lib/tpl/dokuwiki/images/button-css.png" width="80" height="15" alt="Valid CSS" /></a> <a href="https://dokuwiki.org/" title="Driven by DokuWiki" ><img src="/lib/tpl/dokuwiki/images/button-dw.png" width="80" height="15" alt="Driven by DokuWiki" /></a> </div> <div style="margin-top: 2em; font-size:90%" class="dokuwiki"><div style="float:right"><a href="http://www.splitbrain.org/personal#imprint" style="float:right; text-decoration: none; color:#333">Imprint</a></div></div><!-- Include for DokuWiki site wide top bar --> <style type="text/css"> @media screen { body { padding-top: 30px; } #global__header { position: absolute; top: 0; left: 0; text-align: left; vertical-align: middle; line-height: 1.5; background-color: #333; box-shadow: 0 0 8px rgba(0,0,0,0.5); width: 100%; margin: 0; padding: 5px 20px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; white-space: nowrap; overflow: hidden; } #global__header h2 { position: absolute; left: -99999em; top: 0; overflow: hidden; display: inline; } #global__header ul, #global__header li { margin: 0; padding: 0; list-style: none; display: inline; line-height: 1.5; } #global__header a { color: #bbb; text-decoration: none; margin-right: 20px; font-size: 14px; font-weight: normal; } #global__header a:hover, #global__header a:active, #global__header a:focus { color: #fff; text-decoration: underline; } #global__header form { float: right; margin: 0 0 0 20px; } #global__header input { background-color: #333; background-image: none; border: 1px solid #bbb; color: #fff; box-shadow: none; border-radius: 2px; margin: 0; line-height: normal; padding: 1px 0 1px 0; height: auto; } #global__header input.button { border: none; color: #bbb; } #global__header input.button:hover, #global__header input.button:active, #global__header input.button:focus { color: #fff; text-decoration: underline; } } /* /@media */ @media only screen and (min-width: 601px) { /* changes specific for www.dokuwiki.org */ #dokuwiki__header { padding-top: 3em; } #dokuwiki__usertools { top: 3em; } /* changes specific for bugs.dokuwiki.org */ div#container div#showtask { top: 40px; } } /* /@media */ @media only screen and (max-width: 600px) { body { padding-top: 0; } #global__header { position: static; white-space: normal; overflow: auto; } #global__header form { float: none; display: block; margin: 0 0 .4em; } } /* /@media */ @media print { #global__header { display: none; } } /* /@media */ </style> <div id="global__header"> <h2>Global DokuWiki Links</h2> <form method="get" action="https://search.dokuwiki.org/" target="_top"> <input type="text" name="q" title="Search all DokuWiki sites at once" class="input" /> <input type="submit" title="Search all DokuWiki sites at once" value="Search" class="button" /> </form> <ul> <li><a href="https://download.dokuwiki.org" title="Download the latest release" target="_top">Download</a></li> <li><a href="https://www.dokuwiki.org" title="Read the DokuWiki documentation" target="_top">Wiki</a></li> <li><a href="https://forum.dokuwiki.org" title="Ask questions in the DokuWiki forum" target="_top">Forum</a></li> <li><a href="https://irc.dokuwiki.org" title="Check IRC chat logs or join the chat" target="_top">IRC</a></li> <li><a href="https://github.com/splitbrain/dokuwiki/issues" title="Report and track bugs" target="_top">Bugs</a></li> <li><a href="https://translate.dokuwiki.org/" title="Help translating the DokuWiki interface" target="_top">Translate</a></li> <li><a href="https://github.com/splitbrain/dokuwiki" title="Access the most recent git commits" target="_top">Git</a></li> <li><a href="https://xref.dokuwiki.org/reference/dokuwiki/" title="Cross-Reference of the DokuWiki source code" target="_top">XRef</a></li> <li><a href="https://codesearch.dokuwiki.org/" title="Search through the sources of DokuWiki, plugins and templates" target="_top">Code Search</a></li> </ul> </div> <!-- end of DokuWiki top bar include --> </div></footer><!-- /footer --> </div></div><!-- /site --> <div class="no"><img src="/lib/exe/taskrunner.php?id=plugin%3Adata&1733906648" width="2" height="1" alt="" /></div> <div id="screen__mode" class="no"></div></body> </html>