• Resolved rscarter1

    (@rscarter1)


    Here is part of my Pods template:

    <div class="database_column_five">
    	Buyer<p></p>
    	<b><a href="{@buyer.permalink}">{@buyer}</a></b>
    	</div>
    <div class="database_column_six">
    	Underbidders<p></p>
    	<b><a href="{@underbidders.permalink}">{@underbidders}</a></b>
    	</div><p></p>

    In the first div shown, the link works perfectly – there is only one “buyer” shown.

    In teh second div, there could be multiple “underbidders” and when that is the case, a list is displayed with one long URL which is broken. I’ve tried:

    <div class="database_column_five">
    	Buyer<p></p>
    	<b><a href="{@buyer.permalink}">{@buyer}</a></b>
    	</div>
    <div class="database_column_six">
    	Underbidders<p></p>
    	[each underbidders]<b><a href="{@underbidders.permalink}">{@underbidders}</a></b>, [/each]
    	</div><p></p>

    But this displays no text except for the comma.

    • This topic was modified 2 years, 8 months ago by rscarter1.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rscarter1

    (@rscarter1)

    On this page, I found the answer:

    “NOTE: Do not repeat the relationship field, taxonomy or image field inside the loop or you’ll step out of the loop (ie Don’t use {@relationship_field.post_title}, it’s just {@post_title}.”

    So, this worked:

    [each underbidders]<b><a href="{@permalink}">{@name}</a></b>[/each]

    • This reply was modified 2 years, 8 months ago by rscarter1.

    @rscarter1 thank you so much for sharing the solutions you find. It’s appreciated.

    If you run into these limitations of the EACH tag …

    You cannot use the each loop to order in a specific way, or filter specific records or only show a specific number of records. each is designed to loop through everything on the other side of the loop, no ordering, no limiting, no filtering. If you need more control, you need to be using PHP Theme Templates.

    … Take a look at the Pods shortcode (which you can use inside a template). That gives you a lot more options – I’m using where and order by clauses.

    https://docs.pods.io/displaying-pods/pods-shortcode/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unable to get [each] working correctly with URLS’ is closed to new replies.