Hello,
I have two problems on my jtse.fr website.
1- When I go to the custom post-type "Conferences" and create a new one, I have the possibility at the bottom of the page to create a custom post-type in relationship called "Intervenants". The problem, when I click on "Ajouter un nouvel intervenant" is that I cannot add links in the wysiwyg editor called "Biographie FR" et "Biographie EN". When I click on the link icon, the field to insert a link is not displayed.
2- I have created a "Archive Conférence" view. In this view, I added a "Date" search field which allows me to select positions according to the "event-date" custom field. On the following page, this search box does not work: hidden link
Please be careful, my website is online.
Thanks for your help.
Hello and thank you for contacting the Toolset support.
I test a clean installation and I confirm the first issue happens.
There is a workaround to be able to enter links on the same page. Just continue creating the related post, save the related post without entering links. Then "Quick Edit" it on the list of posts hidden link
You will be asked to Enable editing the related post's field inside the parent post's editing page hidden link
You can then enter links hidden link
I'll report this issue to our 2nd Tier and will get back to you about it.
Regarding the second issue, I wonder, why are you using a view inside an Elementor archive template?
The page hidden link is the archive for the custom post type event. Archives have their own queries. So, I am a little confused, and I think that how you are using the view inside the archive is not correct.
Can you elaborate on what you try to do? And why are you using an Elementor archive template instead of a Toolset archive template?
Hello and thank you for contacting the Toolset support.
I test a clean installation and I confirm the first issue happens.
There is a workaround to be able to enter links on the same page. Just continue creating the related post, save the related post without entering links. Then "Quick Edit" it on the list of posts hidden link
You will be asked to Enable editing the related post's field inside the parent post's editing page hidden link
You can then enter links hidden link
I'll report this issue to our 2nd Tier and will get back to you about it.
Regarding the second issue, I wonder, why are you using a view inside an Elementor archive template?
The page hidden link is the archive for the custom post type event. Archives have their own queries. So, I am a little confused, and I think that how you are using the view inside the archive is not correct.
Can you elaborate on what you try to do? And why are you using an Elementor archive template instead of a Toolset archive template?
Hello Jamal,
Thanks for your return!
I used the tip you gave me for adding link, it works.
For the second problem, I am indeed displaying this view on an elementor archive, which may not be conventional. On the other hand, I don't really see how that can influence.
A view can be inserted on any page it should behave independently of where it is located right? For example, I inserted my view on this page, the problem is the same: hidden link
Let's focus on the "test" page to try to unravel this problem. Is there something that I configured incorrectly?
All I want is to have a page that displays the posts of my "Conferences" post-type and to be able to apply a search filter according to the custom "Date" field.
Thank you for your help
Sure, we can focus on the /test page first, then we'll see about the archive page.
When activating the view's debug mode, I get an SQL query that tries to search for custom fields "date" and "debut" and I do not understand why the query is built that way. I would like to disable WPML while investigating but I do not want to do that on your live site. Would it be possible to take a copy of your website using the Duplicator plugin? Or would it be possible to provide a staging site where I can deactivate plugins and test freely?
Hello Jamal
I think this comes from a function that I added in function.php of my theme following advice found on this forum.
Since I want the posts in this view to be sorted by date and then by time, I added this piece of code:
function add_custom_fields_to_view_query($query_args, $view_settings, $view_id ) {
$view_ids = array( 426, 480 );
if( in_array( $view_id, $view_ids)) {
$query_args['meta_query'] = array(
'relation' => 'AND',
'date_clause' => array(
'key' => 'wpcf-date',
'compare' => 'EXISTS',
'type' => 'NUMERIC',
),
'start_clause' => array(
'key' => 'wpcf-debut',
'compare' => 'EXISTS',
'type' => 'NUMERIC',
),
);
$query_args['orderby'] = array(
'date_clause' => 'ASC',
'start_clause' => 'ASC',
);
}
return $query_args;
}
add_filter('wpv_filter_query', 'add_custom_fields_to_view_query', 199, 3);
In order to try to debug our problem, I have removed it for the moment but that does not solve the problem.
I can send a duplicator, tell me how I get it to you.
Thank for your help
EDIT: In fact, disabling this function seems to have solved the problem. What did I do wrong in this function?
This function changes the query filters of the view, it overrides the query filter on the date dropdown, which means, that whatever you choose on the date dropdown, it will be ignored, just like if it was not used at all.
I also, see an issue. You currently, choose the date field to be a "select" field, instead of a date. Then, with this custom code, you are trying to use it as a number. Check line 9.
If you would like to use a date field, and a time field, I wonder, why not using one field that will store both, the date and the time?
I do not think, that choosing a select field will help you achieve what you want.
So, before going further on this issue, I wonder, if you would like to change the field type, and enter new values for the post, then we can continue together. Sound good?
Hello Jamal,
The reason why I am not using a date field are:
1- I want my users, when creating a "Conference" post, to be able to choose only between two dates (24/11/20 and 25/11/20)
2- As it is not possible to have just single "time" fields and I want to have a start time and an end time, this implies that my users select two dates. However, for each post conference, I don't want them to be able to select two different dates but only one date for the same post.
3- In my view, I want to be able to have the date as a drop-down menu and not as a date picker.
For sorting with my function, I had configured a numeric sort. In my custom date field this is configured as such:
Text = 24/11/2020 - Field content = 1
Text = 25/11/2020 - Field content = 2
This is the situation. I can create a new date field and leave it in date-time format but would I be able to keep my constraints 1 to 3 mentioned above?
Thank you for your feedback. However, for support rules, we are able to handle only one issue at a time. This helps us to bring you a better service and also helps other users to find all the information here exposed. For that reason, I have created another ticket about the view and the date filter and I'll be posting my replies there.
Regarding this ticket original issue(add link in wysiwyg editor), I am setting this ticket as escalated to our 2nd Tier, and I'll get back to you as soon as we have any progress on that bug.
Let's work on the second issue on the new ticket. Please check my reply and provide the needed details.
My issue is resolved now. Thank you!