this page here shows a date under details, hidden link
on this page here for instance , hidden 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
any idea waqar? thanks for converting into a ticket!
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. hidden link )
Screenshot: hidden 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"
( hidden 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
thanks waqar there is this here
hidden 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
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
brilliant waqar something easy for once!!
hidden 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
is this even possible waqar? thanks
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
thanks waqar ,that will do each line in a view. i meant like in the image attached
page for image
hidden link
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
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?
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":
hidden 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:
hidden 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:
hidden link
I hope this will make it more clear.
regards,
Waqar
Yes waqar it is clear how to achieve the final outcome you provided thanks , how ever rather than each line i wanted like this
hidden link but every other block a diferent colour if that makes sense.
thanks waqar
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