You do not have sufficient permissions to access this data.You do not have sufficient permissions to access this data.{"id":1389,"date":"2016-02-04T13:05:45","date_gmt":"2016-02-04T18:05:45","guid":{"rendered":"http:\/\/cfdbplugin.com\/?page_id=1389"},"modified":"2016-02-04T13:05:45","modified_gmt":"2016-02-04T18:05:45","slug":"creating-a-master-detail-view","status":"publish","type":"page","link":"https:\/\/cfdbplugin.com\/?page_id=1389","title":{"rendered":"Creating a Master-Detail View"},"content":{"rendered":"<p>Problem: you want to display a list of form entries and have a link on each one to show expanded information about that one entry. <\/p>\n<p>For the example below, let&#8217;s assume:<\/p>\n<ul>\n<li>We have a form named <strong>registration<\/strong> with entries in the database<\/li>\n<li>The <strong>registration<\/strong> form has fields: <strong>firstname<\/strong>, <strong>lastname<\/strong>, <strong>street<\/strong>, <strong>city<\/strong>, <strong>state<\/strong>, <strong>postalcode<\/strong>, <strong>country<\/strong>\n<\/li>\n<li>On the <strong>Master<\/strong> page, we want a table showing <strong>lastname, firstname<\/strong> sorted by <strong>lastname<\/strong>\n<\/li>\n<li>When we click on a link on the <strong>Master<\/strong> page, it takes us to the <strong>Detail<\/strong> page where we show all the fields for that entry.\n<\/li>\n<\/ul>\n<p>We want the master page to have a table that looks like this:<br \/>\n<a href=\"http:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.28.22-PM.png\" rel=\"attachment wp-att-1394\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.28.22-PM-300x57.png\" alt=\"Master Table\" width=\"600\" height=\"114\" class=\"alignnone size-medium wp-image-1394\" srcset=\"https:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.28.22-PM-300x57.png 300w, https:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.28.22-PM-768x146.png 768w, https:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.28.22-PM-1024x195.png 1024w, https:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.28.22-PM.png 1144w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>And when we click on a <strong>Details<\/strong> link, we want to navigate to a page that shows all the information for one entry like this:<br \/>\n<a href=\"http:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.55.26-PM.png\" rel=\"attachment wp-att-1404\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.55.26-PM-300x118.png\" alt=\"Details page\" width=\"300\" height=\"118\" class=\"alignnone size-medium wp-image-1404\" srcset=\"https:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.55.26-PM-300x118.png 300w, https:\/\/cfdbplugin.com\/wp-content\/uploads\/2016\/02\/Screen-Shot-2016-02-04-at-12.55.26-PM.png 648w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>From Definition<\/h2>\n<p>Use whatever form plugin you like to create your form. For this example, I created a Contact Form 7 form like this:<\/p>\n<pre lang=\"html\" line=\"1\" escaped=\"true\">\r\n<p>First Name (required)<br \/>\r\n    [text* firstname] <\/p>\r\n\r\n<p>Last Name (required)<br \/>\r\n    [text* lastname] <\/p>\r\n\r\n<p>Street <br \/>\r\n    [text street] <\/p>\r\n\r\n<p>City <br \/>\r\n    [text city] <\/p>\r\n\r\n<p>State or Province <br \/>\r\n    [text state] <\/p>\r\n\r\n<p>Postal code <br \/>\r\n    [text postalcode] <\/p>\r\n\r\n<p>Country <br \/>\r\n    [text country] <\/p>\r\n\r\n<p>[submit \"Submit\"]<\/p>\r\n<\/pre>\n<p>I added the form shortcode to a post and submitted some entries for testing. <\/p>\n<p>Create two pages or posts in WordPress. The first will be the &#8220;Master&#8221; page that will display a table of form entries. The second will be the &#8220;Detail&#8221; page to so the details of a particular entry. You will need to know the URL of the Details page to add it as a link on the Master page. <\/p>\n<h2>Master Page<\/h2>\n<p>On the <strong>Master<\/strong> page I place this shortcode. <\/p>\n<ul>\n<li>Line 1 shortcode: change the value of <strong>form<\/strong> to your form name\n<\/li>\n<li>Line 1 shortcode: change the value of <strong>show<\/strong> to display those fields that you want. But keep the <strong>submit_time<\/strong> field.\n<\/li>\n<li>Line 1 shortcode: change the value of <strong>headers<\/strong> as desired or remove it.\n<\/li>\n<li>Line 1 shortcode: change the value of <strong>orderby<\/strong> as desired or remove it.\n<\/li>\n<li>On Line 6, replace the value of <strong>detailPageUrl<\/strong> in line with the URL to your <strong>Details<\/strong> page\n<\/li>\n<li>Optionally on Line 5, change the value of <strong>label<\/strong> to whatever you like.\n<\/li>\n<\/ul>\n<pre lang=\"html\" line=\"1\" escaped=\"true\">\r\n\r\n<\/pre>\n<h2>Details Page<\/h2>\n<p>On the Details Page, let&#8217;s assume we want to display the values as shown below using the cfdb-html tag. <\/p>\n<ul>\n<li>Line 1: change the value of <strong>form<\/strong> to your form name\n<li>Line 2-5: Rewrite the template HTML in your cfdb-html to match your fields\n<\/li>\n<\/ul>\n<pre lang=\"html\" line=\"1\" escaped=\"true\">\r\n\r\n<\/pre>\n<p>What is happening here is that we take the <strong>submit_time<\/strong> value, which identifies a single form submission. The <strong>Master<\/strong> page constructs URLs to the <strong>Details<\/strong> page passing the <strong>submit_time<\/strong> in the URL (<strong>st<\/strong> parameter). Each row in the <strong>Master<\/strong> page has a URL with a different <strong>st<\/strong> value. <\/p>\n<p>On the details page, the shortcode <strong>filter=&#8221;submit_time=$_GET(st)&#8221;<\/strong> only displays the values for that submission. <\/p>\n<p>If you view the Details page directly then the shortcode will show no content. The <strong>st<\/strong> parameter must be in the URL for the shortcode filter to match a form submission. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: you want to display a list of form entries and have a link on each one to show expanded information about that one entry. For the example below, let&#8217;s assume: We have a form named registration with entries in the database The registration form has fields: firstname, lastname, street, city, state, postalcode, country On [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":102,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-without-sidebar.php","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-1389","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P1mptf-mp","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/1389","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=1389"}],"version-history":[{"count":21,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/1389\/revisions"}],"predecessor-version":[{"id":1412,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/1389\/revisions\/1412"}],"up":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/102"}],"wp:attachment":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}