Articles Anywhere

dynamic display current category title?

1 month 1 week ago #90086

Odin Mayland's Avatar Odin Mayland

I am trying to display the title for the current category in the grey header.

Here is the test url: empirearbitration.com/index.php?option=c...log&id=70&Itemid=431
As you can see the current cat is 70 which is titled "Testimonials".

My attempt is not working: {article category="current"}[category]{/article}

What am I doing wrong?

1 month 1 week ago #90088

Peter van Westen's Avatar Peter van Westen Admin

Try:

{article}[category]{/article}

1 month 1 week ago #90089

Odin Mayland's Avatar Odin Mayland

I had that originally, but it does the same thing and repeats all the 1st level categories in ID ascending order.
https://www.dropbox.com/s/u064hjepfv9ns4m/Screen%20Shot%202020-01-14%20at%2010.42.02%20PM.png?dl=0

1 month 1 week ago #90090

Andy Badwool's Avatar Andy Badwool Moderator

Make sure you're using the single {article}...{/article} tag, and not the plural.

1 month 1 week ago #90091

Andy Badwool's Avatar Andy Badwool Moderator

Actually, I've looked at your test page, and you are in a category blog page, not in an article page. So there is no "current article".

So from a category blog page you could probably do something like:

{articles category="current" limit="1"}[category]{/articles}

(plural syntax should be used here).

1 month 1 week ago #90099

Odin Mayland's Avatar Odin Mayland

Andy Badwool wrote:

{articles category="current" limit="1"}[category]{/articles}

Unfortunately, I tried that too, but it doesn't display anything. Here it is again: empirearbitration.com/index.php?option=c...log&id=70&Itemid=431

1 month 1 week ago #90105

Peter van Westen's Avatar Peter van Westen Admin

Your page is not an article page, but a category blog page. You cannot use the {article} tags in the category page (outside the articles showed on that page) and try to reference the 'current' data, as there is no current article te reference.

1 month 1 week ago #90108

Andy Badwool's Avatar Andy Badwool Moderator

Actually, nevermind, category="current" should work correctly in a Category Blog page. It works in our test environment, even when used in a module in that page. So something weird going on on your setup.

Can you give us (super) admin so we can take a look?
And tell us 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.

1 month 1 week ago #90110

Peter van Westen's Avatar Peter van Westen Admin

category="current" should work correctly in a Category Blog page
The things I find out about my own extensions 😁
I often forget these niche features I built in!

1 month 1 week ago #90128

Odin Mayland's Avatar Odin Mayland

Andy Badwool wrote:

Can you give us (super) admin so we can take a look?
And tell us on what url I can see/reproduce the issue.

Here is a protostar page for testing the "Dynamic Header" : empirearbitration.com/index.php?Itemid=1185
The AA code is in module 211

Confidential information:
(hidden)

1 month 1 week ago #90129

Odin Mayland's Avatar Odin Mayland

Peter van Westen wrote:

The things I find out about my own extensions 😁
I often forget these niche features I built in!

No worries, I too keep forgetting how powerful AA is!!

1 month 1 week ago #90130

Andy Badwool's Avatar Andy Badwool Moderator

After scrambling a lot to figure out what the issue was, I just couldn't understand it, I finally realized the reason.

The Testimonials category has 0 articles!

So doing this in that page can't work:

{articles category="current" limit="1"}[category]{/articles}

There needs to be at least 1 article in that category for the articles code to work, otherwise it will always return empty 🙂

So that's the issue.

1 month 1 week ago #90131

Odin Mayland's Avatar Odin Mayland

Darn it! I knew that but had forgotten that requirement. 😲 🙁

Thanks for all the awesome support. It's working now!!