Search
Other Articles Anywhere questions
Forum

List of articles organized by date

Odin Mayland's Avatar Odin Mayland
I am trying to mimic this layout: regularlabs.com/latest-releases

Display all articles in the "Release Notes" category and all organized in sections by that same date.

How do I get the following organized by date and display that date?
{articles category="Release Notes"}
<h3>[title]</h3>
<p>[text]</p>
{/articles}
Peter van Westen's Avatar Peter van Westen ADMIN
That page is not made with Articles Anywhere, by the way.

For ordering by date, see: docs3.regularlabs.com/articlesanywhere/p...ut-settings#ordering

You could try comparing the articles date with the previous articles date, to see if you need to output it, using the {if} tags:
docs3.regularlabs.com/articlesanywhere/g...urther/if-structures
docs3.regularlabs.com/articlesanywhere/d...rom-specific-article
Please post a rating at the Joomla! Extensions Directory
Odin Mayland's Avatar Odin Mayland
I think this is where you were going:
{articles category="Release Notes"}
	{if publish_up = this:publish_up}
		<h3>[title]</h3>
		<p>[text]</p>
	{/if}	
{/articles}

Since this is checking if "Release Notes" within the cat match the date of the article I pasted this code into, I think the solution is to create an article with the date the release notes were completed as the article title and this code within it. And then set all the articles we want to publish with that new organizing-by-date-article to have the same publish date.

It works in testing except for these issues:
1. The publish_up date needs to be exact. Is there a way to make the if statement only check the day/month/year and ignore the hour:min:second?
2. How do I NOT display the organizing-by-date-article in the list of articles that the if returns?
Peter van Westen's Avatar Peter van Westen ADMIN
No, that was not what I was thinking....
More something like this, but don't know if it works:
{articles category="Release Notes" ordering="publish_up DESC"}
	{if date(publish_up, 'Y-m-d') != date(previous:publish_up, 'Y-m-d')}
		<h2>[publish_up format="Y-m-d"]</h2>
	{/if}	
	<h3>[title]</h3>
	<p>[text]</p>
{/articles}
Please post a rating at the Joomla! Extensions Directory
Andrea Malalana's Avatar Andrea Malalana ADMIN
@Peter I think we added the ability to use
previous:values
in If Structures only in the Joomla 4 version...
Peter van Westen's Avatar Peter van Westen ADMIN
Yeah, and in combination with the date.... probably won't work.
Please post a rating at the Joomla! Extensions Directory
Odin Mayland's Avatar Odin Mayland
Peter, I tried your code but I get:
syntax error, unexpected ':', expecting ')'
Peter van Westen's Avatar Peter van Westen ADMIN
Yeah, like we said, that won't work.
I don't think I have a solution for you with just Articles Anywhere.

PS: you can exclude articles by using a ! in front of the titles.... see the documentation on the syntax.
Please post a rating at the Joomla! Extensions Directory
Odin Mayland's Avatar Odin Mayland
That's ok. I think my solution is going to work.

I added title="!this:id" to exclude the organizing-by-date-article. Thanks!

I just need help with only using day/month/year and ignoring the hour:min:second.
<hr id="system-readmore" />{articles category="Release Notes" title="!this:id"} {if publish_up = this:publish_up}
<h3>[title]</h3>
<p>[text]</p>
<div class="panel">[fixed label="true"] [changed label="true"] [added label="true"] [removed label="true"]</div>
{/if} {/articles}
Peter van Westen's Avatar Peter van Westen ADMIN
I don't think this will work, but you can try:
{if date(publish_up, 'Y-m-d') != date(this:publish_up, 'Y-m-d')}
Please post a rating at the Joomla! Extensions Directory
Odin Mayland's Avatar Odin Mayland
You are correct.

This:
<p>{articles category="Release Notes" title="!this:id"} {if date(publish_up, 'Y-m-d') != date(this:publish_up, 'Y-m-d')}</p>
<div class="eachrelease">
	<h3>[title] [version]</h3>
	<p>[text]</p>
	<div class="panel">[fixed label="true"] [changed label="true"] [added label="true"] [removed label="true"]</div>
	{/if}
</div>
<p>{/articles}</p>
gives me this:
0 syntax error, unexpected ':', expecting ')'

Therefore, do you agree that the only way to get my code to work is to have the date be exactly the same like this: 2021-08-30 00:00:00 ?
Peter van Westen's Avatar Peter van Westen ADMIN
If you only want to use Articles Anywhere, then yes. Otherwise you would need to use PHP to do what you want.
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