Search
Other Articles Anywhere questions
Forum

Kind of "Related articles" with Article Anywhere

Stephan Herby's Avatar Stephan Herby
Hi Peter,
I have tried to have a module "related article" with an "If structure".

What I want is :
My customer writte an article in category "Project Time-Line"
He can select an article from category "Project Main"
So when visitors go on article "Projetc 01" from "Project Main" category, the module show all articles from category "Project Time-Line" which have their custom field "related article" with the article "Projetc 01" selected.
I hope this is understandable 🙂

The code I added in my custom content module imported in article "Projetc 01" is :
<ul>{articles category="Project Time-Line"}
<li>
{if [relatedarticlecustomfield output="value"] = this:id}
	<strong>[title]</strong>
{/if}
</li>{/articles}
</ul>
But When i print my page, I get an error :
0
syntax error, unexpected ')', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'
Any advice ?
Thanks in advance...
Peter van Westen's Avatar Peter van Westen ADMIN
That syntax is wrong. You can't put data tags inside the {if} tags.
See: docs3.regularlabs.com/articlesanywhere/g...ctures#custom-fields

When in doubt: read the documentation.
Please post a rating at the Joomla! Extensions Directory
Stephan Herby's Avatar Stephan Herby
Hi Peter, thank you for pointing me in the right direction.
Actually it was more simple that what i tried :
	<ul>
		{articles category="Project Time-Line" relatedarticlecustomfield ="this:id" ordering="created ASC"}
			<li>[title]</li>
		{/articles}
	</ul>
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription