Search
Other Articles Anywhere questions
Forum

Edge case with Yootheme templates

Aram's Avatar Aram
Hi Peter,

So I'm trying to use Articles Anywhere within Yootheme's Pro 'templates'.

If you're not familiair with it; it uses a base 'template' for articles with (e.g.) tag A.

So within the template, I'm using {article}[title]{/article}. Which normally does work within an article.
However, when I'm trying to accomplish this with the template function within Yootheme. It doesn't seem to work.

{article id="4"}[title]{/article} > does work, but that only returns the title of article with ID 4.

Do you, by chance, have an idea how I can make this work?

I've already tried it with sourcerer:
{source}
<?php
$input = JFactory::getApplication()->input;
echo $input->getInt('id');
?>
{/source}
, but alas, it didn't work.

If we don't talk before tomorrow, fijne kerst alvast!
Peter van Westen's Avatar Peter van Westen ADMIN
Try:
{article id="{source}<?php echo \Joomla\CMS\Factory::getApplication()->input->getInt('id'); ?>{/source}"}[title]{/article}

Make sure the Sourcerer system plugin is ordered before Articles Anywhere.

If you need Sourcerer ordered after Articles Anywhere for whatever reason, you can try:
{source}<?php 
$current_id = \Joomla\CMS\Factory::getApplication()->input->getInt('id');
echo '{' . 'article id="' . $current_id . '"}'
   . '[title]'
   . '{' . '/article}';
?>{/source}
Please post a rating at the Joomla! Extensions Directory
Aram's Avatar Aram
Thank you Peter! It didn't work (probably because of a conflict between the plugins, ordering didn't work).

I've now resolved it by using ReReplacer and creating 'my own' Articles Anywhere for this application. That worked! 😁
Peter van Westen's Avatar Peter van Westen ADMIN
Ok 👍
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription