1

Anyone know if it's possible to get back the name of the site an entry is from dynamically? Simple code example below:

{exp:channel:entries channel="news" site="siteA|siteB"}
  <h2>{title}</h2>
  <p>Published: {entry_date format="%j %M %Y"} in {site_name}</p>
{/exp:channel:entries}

Tried using {site_name} and {site_label} but they just show the current site. Be nice to be able to get the site name and short name out.

Cheers, Ant

1 Answer 1

1

For the name you could try a conditional with entry_site_id.

<p>Published: {entry_date format="%j %M %Y"} in {if entry_site_id == 1}Site name 1{/if}{if entry_site_id == 2}Site name 2{/if}</p>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.