Skip Navigation

[Resolved] wpv-post-taxonomy-iterator PROBLEM

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)

This topic contains 7 replies, has 2 voices.

Last updated by Minesh 3 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2708244

a.R

Why doesn´t this work?

[wpv-post-taxonomy-iterator taxonomy="quellen" separator=',</li><li style="display: inline;">']
      <a href='[types termmeta="quelle-url"][/types]'>
          [wpv-taxonomy-title]
    </a>
[/wpv-post-taxonomy-iterator]	

It displays the quelle-url ABOVE the link text.

#2708301

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - [wpv-post-taxonomy-iterator] is used when you want to loop every item one by one.

What if you try to use the following code:

<ul>
[wpv-post-taxonomy-iterator taxonomy="quellen"]
      <li style="display: inline;>
             <a href='[types termmeta="quelle-url"][/types]'>[wpv-taxonomy-title]</a>
      </li>
[/wpv-post-taxonomy-iterator]
</ul>

More info:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-taxonomy-iterator

#2708517

a.R

Ok, thank you Minesh, now this works for us:

        <ul class="linebeneinander" style="display:inline"> 
            [wpv-post-taxonomy-iterator taxonomy="quellen" separator=", "]
                <li>
                    <a href='[types termmeta="quelle-url" output="raw"][/types]' target="_blank">[wpv-taxonomy-title]</a>
                </li>
            [/wpv-post-taxonomy-iterator]
        </ul>

2 final questions:

1. How could we only insert a link for terms that have a quelle-url?
2. How prevent the separator from being wrapped in <p></p>?

#2708667

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1. How could we only insert a link for terms that have a quelle-url?
====>
It's already wrapped:

<a href='[types termmeta="quelle-url" output="raw"][/types]' target="_blank">[wpv-taxonomy-title]</a>

2. How prevent the separator from being wrapped in <p></p>?
===>
I'm not sure from where its added.

#2709394

a.R

1. It should be possible to decide by wpv-conditional or so for each link, if to display it wrapped in <a> or not?

#2709412

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you try to use the [wpv-conditional] shortcode to display the conditional content:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153493

Does that works?

#2709457

a.R

Would that be:

 [wpv–conditional if="( $('[types termmeta="quelle-url" output="raw"][/types]') ne '' )"]
   <a href='[types termmeta="quelle-url" output="raw"][/types]' target="_blank">[wpv-taxonomy-title]</a>
[/wpv–conditional]
 [wpv–conditional if="( $('[types termmeta="quelle-url" output="raw"][/types]') eq '' )"]
   [wpv-taxonomy-title]
[/wpv–conditional]
#2710371

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please try to use the following code and check if that help you to resolve your issue:

[wpv–conditional if="( '[types termmeta="quelle-url" output="raw"][/types]' ne '' )"]
   <a href='[types termmeta="quelle-url" output="raw"][/types]' target="_blank">[wpv-taxonomy-title]</a>
[/wpv–conditional]
 [wpv–conditional if="( '[types termmeta="quelle-url" output="raw"][/types]' eq '' )"]
   [wpv-taxonomy-title]
[/wpv–conditional]
#2710431

a.R

With regular hyphens it works now.
Thank you, Minesh.