{"id":284,"date":"2011-03-19T15:12:16","date_gmt":"2011-03-19T19:12:16","guid":{"rendered":"http:\/\/cfdbplugin.com\/?page_id=284"},"modified":"2016-12-15T21:55:24","modified_gmt":"2016-12-16T02:55:24","slug":"cfdb-html","status":"publish","type":"page","link":"https:\/\/cfdbplugin.com\/?page_id=284","title":{"rendered":"[cfdb-html]"},"content":{"rendered":"<p><span style=\"font-weight:bold; background-color:#FFFF99;\">This documentation applies to version 2.6 and later<\/span><\/p>\n<h1><strong>Summary of Shortcode Options<\/strong><\/h1>\n<table border=\"1\" width=\"100%\" cellspacing=\"1\" cellpadding=\"1\" align=\"left\">\n<tbody>\n<tr>\n<td valign=\"middle\" width=\"10%\"><strong>Option<\/strong><\/td>\n<td width=\"40\"><strong>Example <\/strong><\/td>\n<td width=\"40%\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#form\"><strong>form<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0<strong>form=\"myform\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Required. Designates the form to display. All rows and columns are displayed by default<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#role\"><strong>role<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-datatable form=\"myform\" <strong>role=\"Author\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Make short code only display output for user&#8217;s with minimum-required role. Choices are<\/p>\n<ul>\n<li>Administrator<\/li>\n<li>Editor<\/li>\n<li>Author<\/li>\n<li>Contributor<\/li>\n<li>Subscriber<\/li>\n<li>Anyone<\/li>\n<\/ul>\n<p><strong>WARNING<\/strong>: this setting is overridden by plugin setting in WP Admin page Contact -&gt; Database Options -&gt; Can See Submission when using shortcodes<br \/>\n(since 2.4.1)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#show\"><strong>show<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0<strong>show=\"col1,col2\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Limits columns to be shown to be those designated (comma-delimited list)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#hide\"><strong>hide<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0hide<strong>=\"col1,col2\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Does not show listed columns (comma-delimited list)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#limit\"><strong>limit<\/strong><\/a><\/td>\n<td align=\"left\" valign=\"middle\" width=\"40%\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0<strong>limit=\"10\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">One number: limit=&#8221;10&#8243; means show first 10 rows. Is the same as limit=&#8221;0,10&#8243; Two Numbers: limit=&#8221;100,10&#8243; means show 10 rows starting at row #100)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#random\"><strong>random<\/strong><\/a><\/td>\n<td align=\"left\" valign=\"middle\" width=\"40%\"><code>[cfdb-table form=\"myform\"\u00a0<strong>random=\"2\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Display 2 random rows from those that the short code finds. (Since 2.4)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#orderby\"><strong>orderby<\/strong><\/a><\/td>\n<td align=\"left\" valign=\"middle\" width=\"40%\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0<strong>orderby=\"last-name,first-name\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Sort rows by designated columns. Use &#8220;column-name desc&#8221; to sort in descending (reverse) order<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#search\"><strong>search<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0search<strong>=\"Simpson\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Select rows to display that have any cell with the search text in it (case insensitive). Intended to mimic behavior of the &#8220;Search&#8221; field in the DataTable<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#filter\"><strong>filter<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0filter<strong>=\"col1=Simpson\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Select which rows to display based on filter expression. More powerful than &#8220;search&#8221;, it can filter on multiple columns with boolean and regular expressions. If both &#8220;search&#8221; and &#8220;filter&#8221; are specified, &#8220;search&#8221; is ignored.<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\" valign=\"middle\" width=\"10%\"><em>Options specific to this shortcode<\/em><\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=284#filelinks\"><strong>filelinks<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0<strong>filelinks=\"img\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Select how uploaded file fields should be output.<br \/>\nOptions are<\/p>\n<ul>\n<li><strong>url <\/strong>&#8211; output URL to download file<\/li>\n<li><strong>name <\/strong>&#8211; outputs simple file name<\/li>\n<li><strong>link <\/strong>&#8211; outputs and HTML link (&#8220;a&#8221; tag) linking to download the file<\/li>\n<li><strong>img <\/strong>or <strong>image <\/strong>&#8211; assumes the file is an image file and embeds the image in page (&#8220;img&#8221; tag)<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a name=\"stripbr\"><\/a><a href=\"http:\/\/cfdbplugin.com\/?page_id=284#wpautop\"><strong>stripbr<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0<strong>stripbr=\"true\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">*** Available as of 2.1 ***&#8221;Strip BR tags&#8221;. This is an alternative to wpautop which often does not work. If this option is set to &#8220;true&#8221; then all &#8220;<strong>&lt;br \/&gt;<\/strong>&#8221; tags will be removed from the output. The intention is to strip out BR tags injected by the WordPress\u00a0\u00a0<a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wpautop\" target=\"_wpautop\">wpautop<\/a>\u00a0function.The unintended consequence may be that it strips out BR tags that you put in the HTML template of this tag. The trick to make that work is to put in BR tags without a space, that is &#8220;<strong>&lt;br\/&gt;<\/strong>&#8221; or use capital letters. This option only removes BR tags that exactly match\u00a0\u00a0&#8220;&lt;br \/&gt;&#8221;You might also consider using a <a title=\"wpautop-control\" href=\"http:\/\/wordpress.org\/extend\/plugins\/wpautop-control\/\" target=\"_blank\">plugin to turn off wpautop for a specific post<\/a>. In that plugin, you set a customer field on the post to turn off wpautop<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a name=\"wpautop\"><\/a><a href=\"http:\/\/cfdbplugin.com\/?page_id=284#wpautop\"><strong>wpautop<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-html\u00a0form=\"myform\"\u00a0<strong>wpautop=\"true\"<\/strong>]<\/code><\/td>\n<td width=\"40%\"><strong>*** THIS MAY NOT WORK IN RECENT VERSIONS OF WORDPRESS ***<\/strong><strong>*** DEPRECATED AS OF VERSION 2.1. USE &#8220;stripbr&#8221; OPTION INSTEAD ***<\/strong><br \/>\nTurn on or off wpautop for the short code. Valid values are &#8220;true&#8221; or &#8220;false&#8221;. If not specified, &#8220;false&#8221; is the default. WP likes to automatically inject HTML P and BR tags into content text to try to reflect where users have typed in line breaks. This is called <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wpautop\" target=\"_wpautop\">wpautop<\/a>. This affects the content\/template text this shortcode (the text between the open and close tags). If you are not putting HTML tags in that content, you might wish to set wpautop=&#8221;true&#8221; to have WP preserve your line breaks. But if you are putting in your own HTML, then you will likely want wpautop=&#8221;false&#8221; to prevent WP from injection extraneous BR and P tags into your markup.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Want to get your data into an HTML format that you want instead of in a table and not in Javascript\/JSON? This is the shortcode for you.<\/p>\n<p><a name=\"template\"><\/a><strong>Template<\/strong><br \/>\nBest explained with an example. Imagine an example similar to\u00a0showing WordPress blog entries. If you imagine that a form submission is a blog entry, you could use this shortcode to show the most recent 10 blog entries.<\/p>\n<p><code>[cfdb-html form=\"blogs\" show=\"<strong>name,title,blogtext<\/strong>\" limit=\"10\" orderby=\"Submitted desc\"]<\/code><\/p>\n<p><code> &lt;div class=\"your-headline-style\"&gt;<strong>${name}<\/strong>: <strong>${title}<\/strong>&lt;\/div&gt;<\/code><\/p>\n<p><code> &lt;div class=\"your-content-style\"&gt;<strong>${blogtext}<\/strong>&lt;\/div&gt;<\/code><\/p>\n<p><span style=\"font-family: monospace;\">[\/cfdb-html] <\/span><\/p>\n<p>Unlike other shortcodes, we use the begin-tag [cfdb-html]<span style=\"font-weight: bold; background-color: #ffff99;\">Template<\/span> [\/cfdb-html] end-tag format. The template content inside the tag is repeated for each row returned by the shortcode.<\/p>\n<p>You use the <strong>${column-name}<\/strong> syntax to show where values for each row should be inserted. Be sure that all such substitution names are in your &#8220;show&#8221; list, or simply omit &#8220;show&#8221;.<\/p>\n<p><a name=\"filelinks\"><\/a> Use <code>filelinks<\/code> to indicate how form files that are uploaded files should be treated.<\/p>\n<p>Options are:<\/p>\n<ul>\n<li><strong>url <\/strong>&#8211; output URL to download file<\/li>\n<li><strong>name <\/strong>&#8211; outputs simple file name<\/li>\n<li><strong>link <\/strong>&#8211; outputs and HTML link (&#8220;a&#8221; tag) linking to download the file<\/li>\n<li><strong>img <\/strong>or <strong>image <\/strong>&#8211; assumes the file is an image file and embeds the image in page (&#8220;img&#8221; tag)<\/li>\n<\/ul>\n<p><a name=\"before\"><\/a><a name=\"after\"><\/a><strong>Before and After<\/strong><br \/>\n(Since 2.8)<br \/>\nA optional &#8220;before&#8221; and &#8220;after&#8221; section can be added which gets output once immediately before and after the template section respectively. Remember: the template gets output once for each form entry. <\/p>\n<p>This can be useful for adding addition Javascript to format the table (such as <a href=\"http:\/\/cfdbplugin.com\/?p=867\">making URLs clickable<\/a>). And if you are creating your own HTML table, then you can put the TABLE &#038; THEAD in the header and TFOOTER and \/TABLE in the footer. <\/p>\n<p>The short code builder admin page includes sections for header and footer. To do this manually, in the content section of your [cfdb-html] short code, add special delimiters to indicate the header and footer parts. See the example below:<\/p>\n<p><code>[cfdb-html form=\"blogs\" show=\"name,title,blogtext\" limit=\"10\" orderby=\"Submitted desc\"]<\/code><br \/>\n<code><strong>{{BEFORE}}<\/strong>&lt;div class=\"your-header-style\"&gt;Registered Users:<strong>{{\/BEFORE}}<\/strong><\/code><br \/>\n<code> &lt;div class=\"your-headline-style\"&gt;<strong>${name}<\/strong>: <strong>${title}<\/strong>&lt;\/div&gt;<\/code><\/p>\n<p><code> &lt;div class=\"your-content-style\"&gt;<strong>${blogtext}<\/strong>&lt;\/div&gt;<\/code><\/p>\n<p><code><strong>{{AFTER}}<\/strong>&lt;div class=\"your-footer-style\"&gt;Thanks to everyone!<strong>{{\/AFTER}}<\/strong><\/code><br \/>\n<span style=\"font-family: monospace;\">[\/cfdb-html] <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary of Shortcode Options Option Example Description form Required. Designates the form to display. All rows and columns are displayed by default role Make short code only display output for user&#8217;s with minimum-required role. Choices are Administrator Editor Author Contributor Subscriber Anyone WARNING: this setting is overridden by plugin setting in WP Admin page Contact [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1577,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"page-without-sidebar.php","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-284","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P1mptf-4A","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=284"}],"version-history":[{"count":36,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/284\/revisions"}],"predecessor-version":[{"id":1113,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/284\/revisions\/1113"}],"up":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/1577"}],"wp:attachment":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}