Skip Navigation

[Fermé] Table with date-time custom field

This support ticket is created Il y a 8 années et 3 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Marqué : 

This topic contains 3 réponses, has 2 voix.

Last updated by Ross Fisher Il y a 8 années et 3 mois.

Assisted by: Ross Fisher.

Auteur
Publications
#361260
Show table.JPG

I'm working on a website for a theater. Every post is a different Show, where I put a repetitive custom Field with date&time of the show.

In my homepage I need to create a table like the handmade one attached as a picutre. I can't figure out how to do this. Thanks in advance for yuur support.

#361365

Thank you for contacting Toolset support, I'd be delighted to assist!

Sounds like a cool project, I'm excited!

We have two ways of creating a table in Views. The first one would be to use a Parent post to display all children, such as Rooms in a house:
https://toolset.com/documentation/user-guides/display-fields-table-content-using-views-or-the-types-api/

As you'd like to display time data, you may need a more customized solution such as https://toolset.com/forums/topic/create-table-rows-with-a-foreach-loop/#post-207420

The above custom code example requires Bootstrap to function properly, such as using our Toolset Bootstrap theme or a theme compatible with the Bootstrap framework.

Let me know if this helps!

#361456

Hi, and thanks for your help.

The second way needs coding, and i'm not good enough with PHP to afford it.

The first solution seems not to be what I need. Maybe a full automated table is hard to make without coding... so I'm trying a walkaround, making a table with defined row with fixed time for the movie-shows, and filling the table with conditional views. But I have a problem in this case too.

First of all it seems that views filter doesn't recognize the DATATIME custom field as a DATATIME field: infact I've tryed a simple View like this:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<table width="100%">
		<tbody class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<tr>
				[wpv-post-body view_template="Loop item in WEEK"]
			</tr>
		</wpv-loop>
		</tbody>
	</table>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

with the loop:

<td>[wpv-post-link]</td>
<td>[types field="show-timing"][/types]</td>

This will output in the same cell (and this is a problem too), all together every repetition of the custom field of a post; but let's get it aside for now. When I define a filter to the view, in order to output only the "show timing" custom fileds (wich is a DATETIME field) that are greater then the current DATETIME, the filter doesn't work and output "No items found". If I try with other settings (i.e. show empty fields) it works with STRINGS and TIME setting. but not with DATE and DATETIME setting.

I'm trying to fill the table using [wpw conditional] and, after filtering all the custom fileds to get only the "future" events, compare the time of the event with the time of the row and, if it matches, print the name of the article... but it seems to be so hard without coding.

You think there isn't another way to do what I want? or to make filters working?

Thanks in advance again for your help.

#361931

Howdy!

Try changing show-timing to wpcf-show-timing - all Types custom fields have a wpcf- prefix. Let me know if it works!

Le sujet ‘[Fermé] Table with date-time custom field’ est fermé à de nouvelles réponses.