Jump to content

Image descriptions ignoring text formatter


ZGD
 Share

Recommended Posts

I need to return many image descriptions—one for each language—simultaneously. I'm currently using the following:

<?php
$descriptions = [];

foreach(\Processwire\wire('languages') as $language) {
  // Returns only primary language formatted
  $desc = $page->imagefield->description($language);
  $descriptions[$language->language_code] = $description;
}

echo json_encode($descriptions);


This kind of works, but when using a textformatter for my imagefield field the formatter seems to apply only to the default language. I'm using a parsedown formatter, so for example two descriptions for English and German:

[A Hyperlink](https://www.google.com/)
[Ein Hyperlink](https://www.google.com/)

Will return...

<a href="https://www.google.com/">A Hyperlink</a>
[Ein Hyperlink](https://www.google.com/)


Does anyone know a way around this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...