When relating to entries from multiple weblogs, how does one link to them assuming they are in a different template group?
I normally use the "url_title_path" but I would need to change the template group on the fly.
I'm looking at an if statement something like,
{if {examples:total_related_entries weblog=="products"}}"products"{/if}
but I am not getting any output from it.
Any ideas?
Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
-
Similarly, if you need to do something conditionally, depending on which weblog the entries from playa come from. Like, use one image path if the entry is from news-dogs, and another image path if the entry is from news-cats.
-
-
We just did something similar using weblog_short_name inside a playa field.
{my_playa_field}
{if weblog_short_name == "events"}
output something
{/if}
{if weblog_short_name == "news"}
output something else
{/if}
{/my_playa_field}
You could use an elseif syntax as well.
HTH -
-
Thanks g-rom! That works, albeit this should be considered a hack, non? Various (related) threads on the EE forums refer to the use of {comment_auto_path}, but I haven't figured out the rational/configuration.
-
-
No hack there. {weblog_short_name} is a perfectly legal piece of code ;o).
You could use {comment_url_title_auto_path} as well if you have setup the Comment Page URL preference for your weblogs/channels I guess (see the linked doc).
I generally try to avoid using it myself because it relies on you specifying it in the CP, which I likely will not do in various situations (if I am not using comments for example). Not tested here but I guess it will work ok. I hope that helps. -
-
Ooops. EDIT
Apparently (If you don't trust Mr. Boyink you cannot trust anyone) {comment_url_auto_path} might not be available in playa. See here. So I guess using {weblog_short_name} is your only option here. -
-
I was hoping there was a "shot tag" or something included in Playa, thus I searched. No biggie though. I did much the same but used 'weblog' instead of 'weblog_short_name'
{if news_related}<ul class="related">Related:
{news_related status="Published|Featured"}
<li>
{if weblog=="Projects"}Projects » {title}{/if}
{if weblog=="Knowledge"}Knowledge » {title}{/if}
{if weblog=="News"}News » {title}{/if}
{if weblog=="About"}About » {title}{/if}
{if weblog=="Events"}
{if expiration_date > current_time}Upcoming{if:else}Past{/if}
Events » {title}{/if}
{if weblog=="Media"}Press » {title}{/if}
</li>
{/news_related}</ul>
{/if}
-
Loading Profile...





