Skip Navigation

[Gelöst] need to display a date.

This support ticket is created vor 5 Jahre, 3 Monate. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Dieses Thema enthält 14 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von martinP-13 vor 5 Jahre, 3 Monate.

Assistiert von: Waqar.

Author
Artikel
#1197124

this page here shows a date under details, versteckter Link

on this page here for instance , versteckter Link

i would want to show
Date: Saturday 1 July 2017
just under Stake : test stake 1

so i had

Stake : test stake 1
Date: Saturday 1 July 2017

how would i get the date across?or would i be better to a date post type and set up a relationship to events?

many thnks

#1197126
#1197194

any idea waqar? thanks for converting into a ticket!

#1197244

Waqar
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hi Martin,

Thank you for waiting and sorry about the delay.

I understand that your goal is to show the event's date under "HISTORICAL TRIAL RESULTS" section, on the single dog page.
( e.g. versteckter Link )
Screenshot: versteckter Link

If that is correct, you can get the ID of the current event in your view "View to show stake from an event - child"
( versteckter Link ), by using the shortcode:


[wpv-post-id item="@stake-events.child"]

Since the date of the event is saved and managed through "The Events Calendar" plugin (and not through Toolset Types), you can consult its documentation or support team, to learn about calling the date information, when ID of an event is available.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1197442

thanks waqar there is this here
versteckter Link so i used
[tribe_formatted_event_date item="@stake-events.child" id=5694 format="F j, Y,"]

i dont know how to invorporate the 2 together though ie
[tribe_formatted_event_date item="@stake-events.child" id=5694 format="F j, Y,"] and [wpv-post-id item="@stake-events.child"]

is this some thing you can advise on

#1197623

Waqar
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hi Martin,

Thank you for sharing that.

This is how the two shortcodes can be used together:


[tribe_formatted_event_date id=[wpv-post-id item='@stake-events.child'] format="F j, Y,"]

regards,
Waqar

#1197738

brilliant waqar something easy for once!!
versteckter Link
has 3 results under historical trials can you pointin me in the direction how to make every other result have a diff colour background to make easier on the eyes?
thanks again

#1197798

is this even possible waqar? thanks

#1198375

Waqar
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hi Martin,

Thanks for the update and glad it worked.

>> can you pointin me in the direction how to make every other result
>> have a diff colour background to make easier on the eyes?

- This question was addressed previously in one of my replies in a different thread:
https://toolset.com/forums/topic/getting-specific-info-into-a-view-waqar-please/#post-1195250

To elaborate and as an example, you can add following CSS code at WP Admin -> Appearance -> Customize -> Additional CSS:
(this will make sure that this code is automatically included in all pages of the website)


.special-row-container {
display: block;
margin: 5px auto 10px;
overflow: hidden;
}

.special-row-container .special-row-item {
display: block;
overflow: hidden;
padding: 5px 10px;
}

.special-row-container .special-row-item:nth-child(even) {
background-color: #cccccc;
}

.special-row-container .special-row-item:nth-child(odd) {
background-color: #eeeeee;  
}

Feel free to adjust the color codes as needed.

After that, you can structure the output of your views, to match the following HTML structure:


<div class="special-row-container">
	<div class="special-row-item">Item 1</div>
	<div class="special-row-item">Item 2</div>
	<div class="special-row-item">Item 3</div>
	<div class="special-row-item">Item 4</div>
	<div class="special-row-item">Item 5</div>
	<div class="special-row-item">Item 6</div>
</div>

Important notes:

1. For more personalized assistance around custom CSS, HTML or PHP code, you can hire a professional from our list of recommended contractors:
https://toolset.com/contractors/

2. Please open a new ticket for each new question or concern, to ensure timely and efficient support.

regards,
Waqar

#1198463
waqar.png

thanks waqar ,that will do each line in a view. i meant like in the image attached
page for image
versteckter Link

#1198516

Waqar
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hi Martin,

Yes, as long as each text line in a view is wrapped in a separate div tag with class "special-row-item" like "Item 1", "Item 2" and so on, the alternate background styling should work.

regards,
Waqar

#1198553

how though waqar? in views there isnt 2 results of the views to do this? how would i set the 2nd set of info? there is no where to set it?

#1199193

Waqar
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hi Martin,

To better understand how to structure your results based on the HTML structure, I shared earlier, please review this example of your view "View to show all dogs related to an event":
versteckter Link

Before:

Backend code:


<div class="special-row-container">
    <div class="special-row-item"><strong>[types field="select-7e0ad2ec"][/types] : [wpv-post-link item="@events-dog.child"]<br>
[types field='dog-breed' item='@events-dog.child'][/types]
[types field='sex' item='@events-dog.child'][/types]
[types field='dogs-date-of-birth' style='text' format='d/m/y' item='@events-dog.child'][/types]<br>
[wpv-view name="view-to-show-a-sire-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]
[wpv-view name="view-to-show-a-dam-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]
[wpv-view name="view-to-show-a-owner-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]
[wpv-view name="view-to-show-a-handler-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]
[wpv-view name="view-to-show-a-breeder-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
</div></div>

Frontend screenshot:
versteckter Link

After:

Backend code:


<div class="special-row-container">
	<div class="special-row-item">
		<strong>[types field="select-7e0ad2ec"][/types] : [wpv-post-link item="@events-dog.child"]</strong>
	</div>
	<div class="special-row-item">
		<strong>[types field='dog-breed' item='@events-dog.child'][/types]
		[types field='sex' item='@events-dog.child'][/types]
		[types field='dogs-date-of-birth' style='text' format='d/m/y' item='@events-dog.child'][/types]</strong>
	</div>
	<div class="special-row-item">
		<strong>[wpv-view name="view-to-show-a-sire-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	</div>
	<div class="special-row-item">
		<strong>[wpv-view name="view-to-show-a-dam-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	</div>
	<div class="special-row-item">
		<strong>[wpv-view name="view-to-show-a-owner-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	</div>
	<div class="special-row-item">
		<strong>[wpv-view name="view-to-show-a-handler-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	</div>
	<div class="special-row-item">
		<strong>[wpv-view name="view-to-show-a-breeder-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	</div>
</div>
<hr>

Frontend screenshot:
versteckter Link

I hope this will make it more clear.

regards,
Waqar

#1199333

Yes waqar it is clear how to achieve the final outcome you provided thanks , how ever rather than each line i wanted like this
versteckter Link but every other block a diferent colour if that makes sense.
thanks waqar

#1199589

Waqar
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Karachi (GMT+05:00)

Hi Martin,

To wrap each resulting block, rather than each line, in alternating colors, you can follow these steps:

1. Wrap the content template's output inside a single div with class "special-row-item":


<div class="special-row-item">
	<strong>[types field="select-7e0ad2ec"][/types] : [wpv-post-link item="@events-dog.child"]</strong><br>
	<strong>[types field='dog-breed' item='@events-dog.child'][/types]
	[types field='sex' item='@events-dog.child'][/types]
	[types field='dogs-date-of-birth' style='text' format='d/m/y' item='@events-dog.child'][/types]</strong><br>	
	<strong>[wpv-view name="view-to-show-a-sire-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	<strong>[wpv-view name="view-to-show-a-dam-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	<strong>[wpv-view name="view-to-show-a-owner-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	<strong>[wpv-view name="view-to-show-a-handler-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong>
	<strong>[wpv-view name="view-to-show-a-breeder-on-a-dog-child" wpvrelatedto="[wpv-post-id item="@events-dog.child"]"]</strong> 
</div>

2. The outer div with class "special-row-container" will need to be moved outside the loop, in "Loop Editor" section:


[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<div class="special-row-container">
			<wpv-loop>
				[wpv-post-body view_template="loop-item-in-view-to-show-all-dogs-related-to-an-event"]
			</wpv-loop>
		</div>
	<!-- 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]

Important reminder: As much as we would like to help, 1-1 assistance around custom PHP, HTML and CSS code is beyond the scope of support that we provide.
( https://toolset.com/toolset-support-policy/ )

If you need more personalized assistance around PHP, HTML and CSS code, we'll recommend hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

For questions related to Toolset features and functionalities, you're welcome to start a new ticket for each topic.

regards,
Waqar

Dieses Ticket ist jetzt geschlossen. Wenn Sie ein Toolset Kunde sind und Hilfe benötigen, eröffnen Sie bitte ein neues Support-Ticket.