Search
Other Articles Anywhere questions
Forum

Display a message on articles that are over 1 year old.

Collin Lafrance's Avatar Collin Lafrance
Hello, I am trying to setup a simple module that displays a short message on article pages (the current article) in which the article is greater than a 1 year old.
{article}{if created >= date('-1 year')}The related files have now been archived.{/if}{/article}

Still trying to figure out how to display nothing if it is not over a year old.

However when I browse to the page, it just keeps loading and loading until it times out and I get a timeout error.
Peter van Westen's Avatar Peter van Westen ADMIN
I have no idea why it would time out...
Do you only have 1 article showing on the page?

By the way, your if check is now checking to see if the created date is larger (later) than a year ago. So you should probably use:
{if created < date('-1 year')}
Please post a rating at the Joomla! Extensions Directory
Collin Lafrance's Avatar Collin Lafrance
Thanks Peter.

Is there a simple way for it to not output anything if it doesn't match the IF statement?
Peter van Westen's Avatar Peter van Westen ADMIN
What do you mean with that?
The Articles Anywhere will not output anything if it doesn't match the if statement, the way you use it.
Please post a rating at the Joomla! Extensions Directory
Collin Lafrance's Avatar Collin Lafrance
Perhaps I should explain better.

I am assigning the module to the menu item of the articles (Article Blog). On the article blog page that shows the intros of 10 articles, I do not want the module to show, but only on the actual page of the single article (to which there is no menu item), and only if it is over a year old.

When I go to the single article page of an article over 1 year old, it loads ok, however on the Article blog view (with 10 article intros showing) it just loads and loads and ultimately the page fails to open.
Peter van Westen's Avatar Peter van Westen ADMIN
I recommend you only assign the module to the articles, not the blog view.
You can do that with Advanced Module Manager.
regularlabs.com/advancedmodulemanager

With the pro version of Advanced Module Manager you could even assign the module to some custom PHP code that could check the age of the article. That way you wouldn't even need Articles Anywhere for this.
Please post a rating at the Joomla! Extensions Directory
Collin Lafrance's Avatar Collin Lafrance
It's working now perfectly. Thanks Peter. You are as always, the Master!
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription