cfdb-html or cfdb-table with custom shortcode?
-
Hi Michael,
This is a follow on question regarding the help you gave me searching between 2 dates (start_end_wrapper shortcode). Thank you for adding the code to retain the search values on submit. It works really well and with the datepicker too.
Using ‘filter’ I can search on, and display, the other fields I need in addition to the start and end dates which is just what I needed. However, I cannot get any of the data to display using cfdb-html, only with cfdb-table. I need to use html in order to display images and use ‘submit-time’.
I cannot find any reason why this should be so, unless the shortcode=”” constraint only works for cfdb-table. Here is the code using cfdb-table:<title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $('input.datepicker').datepicker({ dateFormat: 'dd-mm-yy' }); }); </script> <form action="" method="POST"> Start: <input class="datepicker" name="start" type="text" value="[echo_post_var var='start']"/> End: <input class="datepicker" name="end" type="text" value="[echo_post_var var='end']"/> Country: <input name="country" type="text" /> <input type="submit" /></form> [start_end_wrapper shortcode="cfdb-table" form="Sign Up" show="Country,start,end" filter="Country~~/.*$_POST(country).*/i"]' Here's the code using cfdb-html:[start_end_wrapper shortcode=”cfdb-html” form=”Sign Up” show=”Country,City,AccommType,start,end,Event,Interests,MainImage,submit_time” filelinks=”url” role=”Anyone” filter=”Country~~/.*$_POST(country).*/i&&City~~/.*$_POST(city).*/i&&AccommType~~/.*$_POST(accommtype).*/i&&Event~~/.*$_POST(event).*/i&&Interests~~/.*$_POST(interests).*/i”]
<table>
<tbody>
<thead>
<th></th>
<th>Country</th>
<th>City</th>
<th>Accommodation</th>
<th>Available</th>
<th>Specific Event</th>
<th>Interests</th>
<th></th>
</tr>
<tr><td><img style=”width: 100px; height: 100px; border: 0;” src=”${MainImage}” alt=”” /></td>
<td>${Country}</td>
<td>${City}</td>
<td>${AccommType}</td>
<td>From: ${start}
To: ${end}</td>
<td>${Event}</td>
<td>${Interests}</td>
<td><img src=”http://freestayexchange.com/wp-content/uploads/2014/12/details_button.png” alt=”” /></td>
</tr>
</thead>
</tbody>
</table>
<hr />`
Please can you tell me if the code you wrote for the date search will only work with cfdb-table, and if not where am I going wrong.
Many thanks
Juliehttps://ww.wp.xz.cn/plugins/contact-form-7-to-database-extension/
The topic ‘cfdb-html or cfdb-table with custom shortcode?’ is closed to new replies.