Sauter la navigation

[Résolu] Using Shortcodes to define results

This support ticket is created Il y a 4 années et 9 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Ce sujet contient 25 réponses, a 2 voix.

Dernière mise à jour par Pete Il y a 4 années et 8 mois.

Assisté par: Minesh.

Auteur
Publications
#1758929

Hey Minesh,

Yep I can see it works great.

So to confirm, for this to work it needs 'both' Views, my original 36515 and your new 37117?

If this the case, 'both' need the conditions updated if I add more pages?

Many thanks.

#1758933

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

On your original view:
=> lien caché
Within the "Search and Pagination" section, if you add more pages, you will require to add more conditions.

So, if you add new page for collection value "xyz". Then, to that new page, you will require to add the view form as:

[wpv-form-view name="feat-loc-destin-pages" wpv-collection="xyz"  target_id="36480"]

And within the view's "Search And pagination" section, you will require to add conditional statement as:
=> lien caché

[wpv-conditional if="( '[wpv-attribute name='wpv-collection']'  eq 'xyz' )"]
        <input type="hidden" name="wpv-collection" value="xyz" />
[/wpv-conditional]

I hope this is clear now. please let me know your feedback.

#1758953

Ok I understand.

Glamping works great however one of our most popular collections is: lien caché

Now if you use this, without selecting Pets > Yes the results are not right.
I as a visitor wouldn't select anything here presuming I'm on the page so it must all be Pets Ues anyway.

In this instance, is there a way of the pre selected actually being set by default?

Many thanks.

#1758961

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

To set the selected value for your Pets dropdown:
=> lien caché

I've added the following JS code to your following View's "Search and Pagination" section JS editor:
=> lien caché

jQuery( document ).ready(function($){
  x = $("input[name='wpv-collection']").val();
   if(x=="dog-friendly"){
     $("select[name='wpv-pet'] [value='yes']").prop("selected","selected");
   }
});

I can see now when you load the page: lien caché
- It does set the Pets yes.

Please open a new ticket for every new question you may have. I hope we can close here 🙂

#1758977

Hi there,

I understand, however I'm still worried this is taking a lot of extra code to make to work. That said I have just added sea-views to both your conditional codes, and this isn't working.

lien caché

Select Area > Suffolk and nothing else. Just about all are inland and don't have a sea view.

Ready to leave this Minesh and get rid as I do understand I'm possibly pushing Toolset beyond what it can do.

#1759015

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please check now: lien caché

Its working.

With the following view:
=> lien caché
- if you make any changes and see the following dialog as per the following screenshot - Click on "No" button:
=> lien caché

I can see its working and this should work for your other pages as well now.

#1759021

Thank you Minesh for all your help and pointing out what I need to do.

Appreciate your time.

Take care, Pete

#1759023

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Glad to help. Please feel free to mark resolve this ticket and share your feedback 🙂

#1759027

This isn't allowing me to resolve the ticket Minesh.

All done so happy for you to do so please 🙂

#1759029

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

You have to add different message (other than "My issue is resolved now. Thank you!").

The different message will allow you to mark resolve this ticket.

#1759035

Thank you Minesh