Hi there, this is for Christian Cox, please! 😀
Hi Christian, I'm opening a ticket based on https://toolset.com/forums/topic/only-call-one-taxonomy-term-for-use-in-a-view-when-a-post-has-several/ to see if you can help me. I know you work today and Waqar doesn't, and I wanted to specifically request your help anyway.
The code Waqar gave me didn't work for me. I added it as a Custom code snippet in my Toolset settings. I wasn't sure whether to also register this as a third-party shortcode, but, trying it both ways, it didn't work. I added the shortcode to my view inside the link (see screenshot - you can see how the link shows up in the URL preview in the left-hand corner) and also outside the link just to view the results. It just prints the shortcode, it doesn't return any URL.
Do you think you can help me write something that will return the single URL?
ALSO - I need to be able to specify WHICH URL. The first one isn't necessarily the one I need to call. We can maybe use the [get-current-slug] shortcode to specify which of the taxonomy terms to link to... or some other way to identify which URL to use. Speaking in plain English, I need to call the class part that is part of the class the user is currently looking at.
I'm not sure what the smartest way to do this is. I just know I need to do using logic instead of manually separating out these classes, because I tried duplicating all the chapters to create totally separate classes, and it's not feasible. I will end up with 3x and 4x duplicate content because these chapters are re-used in several classes, and it results in several hundred added chapters.
Thank you so much for your help. This is my last step in finishing my membership site and launching it to my clients.
Thank you,
Liat
Okay so let me make sure I understand what you want to do. Let's look at this page:
hidden link
Please tell me the full URLs each of these menu items should link to:
What Is Toe-Up?
What Is Two-At-A-Time?
How To Use This Course
Toe-Up Sock Pattern
Choose Your Materials
I'll take a look and make sure I understand, then we can talk about a solution.
What Is Toe-Up? - hidden link
What is Two-at-a-Time - hidden link
How To Use This Course - hidden link
Toe-Up Sock Pattern - hidden link
Choose Your Materials - hidden link
Thank you!
Oh, okay I don't think any special conditional logic is necessary. Just pass the taxonomy archive URL from the parent View into the nested View as an attribute "classpart": (hidden link)
[wpv-view name="chapters-within-each-chapter" classpart="[wpv-taxonomy-url]"]
Then access that "classpart" attribute in the nested View to build the link URL:
(hidden link)
<a href="[wpv-attribute name='classpart']#[wpv-post-slug]">
Check it now and let me know if I've misunderstood.
You are so incredible!!!! You solved my problem in a way that I didn't even know was possible! You made everything more simple. Now ALL my classes work the way they should, regardless of whether the chapters are shared between multiple classes. You have helped me more than anyone else in the history of the Internet.
I'm ONLY leaving this open, and I'm sorry to do you like this, to ask for your help or advice regarding another ticket I couldn't solve by myself: https://toolset.com/forums/topic/only-load-images-inside-bootstrap-panel-on-click-to-reduce-page-load-time/. I know this isn't part of your scope of work at Toolset, but even if I could pay you separately, is there some way you could advise me on this ticket? I don't know anyone who knows code and I don't know how to follow Luo's advice by myself, although it seems incredibly straightforward.
Supporters are contractually forbidden from taking on freelance work, but I can offer some advice. If the lists of images are displayed with Views, you can use Infinite Scrolling on all the Views (https://toolset.com/documentation/user-guides/infinite-scrolling-in-views/). This will load only a few images in each View at first, then as the User scrolls to the bottom of the list more results will be added with AJAX. That's probably the easiest alternative that doesn't require custom code, and can dramatically reduce the initial load time for a page with many images.
Another option is a separate Lazy Load plugin. There are several out there, and I don't know how well any of them work, but if you have time to experiment you may find one that works well on your site.
Thank you Christian! You totally solved this problem for me (about the taxonomy terms). Thank you also for your advice about infinite scroll. It's not quite working for me, but if I have more questions I'll open a separate ticket. Thank you thank you!