I have a template, where would like to print the content of an article, what is working quite nice so far, using this code:
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models');
$model = JModelLegacy::getInstance('Article', 'ContentModel');
$article = $model->getItem($aid);
$terms = empty($article->fulltext) ? $article->introtext : $article->fulltext;
So basically, I have the article's id and load it, BUT that throws an error if the current language differs from the language of the article. Unfortunately, I cannot »translate« the article ID, so I need to find a way, to get the right article based on the current language.
Fortunately, there are the associations I can use for that Job (image below).
So now my Question:
How can I load the associated Article?
n.b.: I already had a look at the database, and I found the associations table, but I just hope that there is already some code I could use!
Thanks in Ahead!