Articles Anywhere

List of articles with linked articles as title

5 months 3 weeks ago #88831

Octav A's Avatar Octav A

Hello,
I have posted a similar question and it generated a long discussion with Andy but i think i got stalled with it so i begin new post.
Everything is great about articles pro extension but cannot get to work with nested articles or maybe i don't need nested for this. Please help.

I have a list of articles from category="Cities":
Amsterdam
Frankfurt
Brussels

and a list of articles from category="Countries"
Netherlands
Germany
Belgium

Actually the countries are 250 and cities correspondingly - but lets simulate with 3 items.

Each City article has a custom field of type = "Articles", name="country", layout="Custom HTML", and the Custom HTML is a joomla custom field of type "Text" which is the country code. This is what we need for our tasks.

Now i need to display this list of cities together with linked country and i do like this:
{articles category="Cities"}
[title] - [country]
{/articles}
and i get this:
Amsterdam - NL
Frankfurt - DE
Brussels - BE

I need to display the title of Country article like this:
Amsterdam - Netherlands
Frankfurt - Germany
Brussels - Belgium

I hope the problem is clear to you. I am sure it is something simple but I just got stalled.
Thanks.

5 months 3 weeks ago #88835

Peter van Westen's Avatar Peter van Westen Admin

So this is working as expected, right?
You are outputting the custom field [country] which uses a custom layout which outputs the country code (NL) instead of the full name (Netherlands).

So if you do not want that custom layout to be used, override the layout with the default or a different custom layout.
See: www.regularlabs.com/extensions/articlesa...fields-using-layouts

5 months 3 weeks ago #88836

Octav A's Avatar Octav A

I used:
{articles category="Cities"}
[title] - [country layout="default"]
{/articles}
and i get the same output...
Amsterdam - NL
Frankfurt - DE
Brussels - BE

5 months 3 weeks ago #88837

Octav A's Avatar Octav A

If using layout override is the solution for this issue, I would very much appreciate if you write the full php code for this override so that article title is displayed. This maybe sounds lazy but i am really not strong at tasks like this.
Your time spending and assistance is very much appreciated.

5 months 3 weeks ago #88847

Peter van Westen's Avatar Peter van Westen Admin

It is way beyond my support to write your custom layouts. If you cannot do that, you should hire a web developer that can. I am not your free web developer.

Is your custom layout a full field layout or a value layout?
See: www.regularlabs.com/extensions/articlesa...fields-value-layouts

5 months 3 weeks ago #88849

Octav A's Avatar Octav A

Hello Peter,
I dont want to write layouts nor hire developers.
I just want to use your extensions for some common tasks in a friendly, intuitive and simple way, just as i am used to.
The layout of the custom field is "custom html" and looks like this: [country-code], where country-code is a text custom field of article from category "Countries"

5 months 3 weeks ago #88853

Peter van Westen's Avatar Peter van Westen Admin

You would have to use a layout or value layout. Please read the docs on how to create that:
www.regularlabs.com/guides/1299-how-to-c...ywhere#value-layouts

If that is too technical for you, then you'll have to find another solution.

5 months 2 weeks ago #88880

Octav A's Avatar Octav A

Peter van Westen wrote:

You would have to use a layout or value layout. Please read the docs on how to create that:
www.regularlabs.com/guides/1299-how-to-c...ywhere#value-layouts

If that is too technical for you, then you'll have to find another solution.
Hi Peter,
Thanks for your patience and guiding. I have managed to achieve what i needed using above tutorial.
If anybody will have the same situation this is the custom layout i have used to display linked article as title with link:
<?php
defined('_JEXEC') or die;
if (empty($displayData['values']))
{
   return;
}
$values = $displayData['values'];
$ids    = array_keys($values);
?>
{articles articles="<?php echo implode(',', $ids); ?>"}
   [link][title][/link]
{/articles}

5 months 2 weeks ago #88881

Peter van Westen's Avatar Peter van Westen Admin

Well done 🙂

5 months 2 weeks ago #88882

Octav A's Avatar Octav A

And this: "{article}[country value_layout="title"]{/article}" (title is the name of field layout override) is working very nice, but only in content editor (JCE) - not in template overrides (html/com_content/article/override.php)
If you have any ideas, thanks in advance.

5 months 2 weeks ago #88883

Peter van Westen's Avatar Peter van Westen Admin

No, not sure.
Is nothing being output?

Try adding the id of the article to the {article} tag.

5 months 2 weeks ago #88890

Octav A's Avatar Octav A

No output if using value_layout="" or layout="". The same when adding article id

5 months 2 weeks ago #88891

Peter van Westen's Avatar Peter van Westen Admin

Is the data tag not generating any output? Or the entire article tag?
What do you get if you do:

{article}[title] [country value_layout="title"]{/article}

5 months 2 weeks ago #88892

Octav A's Avatar Octav A

For this

{article}[title] [country value_layout="title"]{/article}
no output is generated
For this
{article}[title] [country]{/article}
the custom field is displayed with the layout set in field back end settings.

5 months 2 weeks ago #88893

Peter van Westen's Avatar Peter van Westen Admin

Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Hidden text' button in the forum editor to hide the confidential information.

5 months 2 weeks ago #88894

Octav A's Avatar Octav A

Unfortunately it is not possible. But you could reproduce this issue on any joomla installation. Meanwhile i will try to find a solution. And thank for your time anyway.

5 months 2 weeks ago #88895

Peter van Westen's Avatar Peter van Westen Admin

If you can reproduce this on an online environment to which I can get access, I am happy to look into this.