Asset Listing: Nested Grouping by Year then Month

Hello Matrixland,


today I'm wondering whether it's possible to group and asset listing results by 'year' and 'month' according to each listed asset's Created or Published timestamp.



So far I have [color="#00bfff"]Group Level 1: Standard Asset Field sorting by 'created date', but I want to broaden this to 'created year'.



Similarly I want [color="#00bfff"]Group Level 2: Standard Asset Field[/color] to be 'created month'.



I'm using Matrix v3.22.1, so my choices for group type are 'Parent Asset', 'Asset Metadata' or 'Standard Asset Field' - no keyword type for me :frowning:



Is what I'm talking about possible? I don't want to have to manually 'group' the assets in a folder, or by assigning a metadata value, as that seems a bit redundant.



Regards,



Robert

Robert, I really don't think this is possible. There are no extra grouping options for keywords, so, there would be no way to group by just year, or month.


Not that it is the cleanest solution, but I am sure it would be pretty easy to build what you want using javascript.

Yes, or you might want to try something with the what's new asset as you can limit say to something like 2008, 2009, 2010. Like Nic, it's not the cleanest solution…

Hmm, both ideas have got me thinking. I reckon with the volume of news items we'll be listing we'll really need a monthly breakdown, so JavaScript might be a neater solution. I'll give it a go and let you know what I come up with anyway!


Thanks guys,

Not sure if you have this option in 3.22.1 but you can sort assets by Date, Month, Year and even Time in 3.26




From my understanding you want to get something like this


    
    2009 
    August
    Test 5 (24 Aug 2009 10:45pm)
    
    June 
    Test 3 (24 Jun 2009 10:45pm)
    
    March 
    Test 2 (24 Mar 2009 10:45pm)
    
    2010 
    January 
    Test (24 Jan 2010 10:44pm)
    Test 4 (25 Jan 2010 10:45pm)


To do this you create New Group with Keyword in Asset Grouping (enable Group Sorting in Details screen).
In the Keyword you can use PHP date format with the keyword %asset_created_X% but without the percentage, so it is asset_created_Y (for Year), asset_created_F (for Month)

Then in the Group Level Format use [b]%group_name%[/b] [b]%group_listing%[/b] and in the Page Contents normal %asset_listing%

I hope this is what you wanted from my understanding.

Edit: here is a working example.

[quote]


To do this you create New Group with Keyword in Asset Grouping (enable Group Sorting in Details screen).

In the Keyword you can use PHP date format with the keyword %asset_created_X% but without the percentage, so it is asset_created_Y (for Year), asset_created_F (for Month)



Then in the Group Level Format use %group_name% %group_listing% and in the Page Contents normal %asset_listing%



I hope this is what you wanted from my understanding.



Edit: here is a working example.

[/quote]



Awesome, looks like this is a new feature of 3.26, as we don’t have this in 3.24.3.

Hey tbaatar,:lol:


yeah, that's exactly how I'd like it to work. Unfortunately the 'keyword' grouping type isn't available in our version of Matrix. I'll just have to add this to the growing list of reasons to upgrade. I think we're hanging off for version four though!



:ph34r:

[quote]
I think we're hanging off for version four though!

[/quote]



I think that is going to be a while!

[quote]
I think that is going to be a while!

[/quote]



V4 is awesome like google wave. google wave has been in "preview" for a while already.

[quote]
V4 is awesome like google wave. google wave has been in "preview" for a while already.

[/quote]



Are you saying you have seen more than Mini?

[quote]
Are you saying you have seen more than Mini?

[/quote]



No I have not. But as what I've seen so far I guess Mini is from V4 family.

[quote]
No I have not. But as what I've seen so far I guess Mini is from V4 family.

[/quote]



Yeah, that is my understanding too. Have you played with Mini yet? I have been running it for a while. Good stuff, but I just love the power and flexibility of Matrix, Mini is far from there currently.

I have not played Mini because the developer has not much to do, I think. It's too good to be customised. But on the other hand, the inflexibility is Mini's success. Just like iphone.

Ah, we were under the impression somthing was happening soon with v4. Maybe we got wires crossed with chat about Mini; I remember we were very excited about the inline editing feature in particular.


What are your feelings about upgrading? We'd have to spend some support time, so we naturally want to wait for a major version to get the best value. I'm keen to use the Javascript API though (also on my forementioned List of Reasons to Upgrade) so it might be worth it for us.



Incidently, I have Mini running on a VM on my desktop, and curiously the comments in the code claim to be Matrix v4.0…



Oh, and just had a chat with our content editor and he's happy to file the news items into a folder hierarchy, so that'll do for now I suppose!:slight_smile:

[quote]
What are your feelings about upgrading? We'd have to spend some support time, so we naturally want to wait for a major version to get the best value. I'm keen to use the Javascript API though (also on my forementioned List of Reasons to Upgrade) so it might be worth it for us.

[/quote]



You should be fine upgrading, if Squiz does it for you, it should go smoothly. Just do an upgrade to the new 3.26.x branch, it has all the newest/greatest features.


[quote]

Incidently, I have Mini running on a VM on my desktop, and curiously the comments in the code claim to be Matrix v4.0…

[/quote]



Yes, it is MySource4, but all the features have not been added to it yet, so they called it MySource Mini for the time being. MySource Mini will become MySource4. Correct me if I am wrong Greg. :slight_smile:

[quote]
Yes, it is MySource4, but all the features have not been added to it yet, so they called it MySource Mini for the time being. MySource Mini will become MySource4. Correct me if I am wrong Greg. :slight_smile:

[/quote]



Generally correct, but stay tuned for big news from Squiz.

All things considered, don't hold off upgrading your Matrix environment if there are features and fixes which will be of immediate benefit to your organisation.
The 3.26.x branch will be our "hardened release" by May, having been at that stage available / deployed over 5 months.

[quote]
To do this you create New Group with Keyword in Asset Grouping (enable Group Sorting in Details screen).

In the Keyword you can use PHP date format with the keyword %asset_created_X% but without the percentage, so it is asset_created_Y (for Year), asset_created_F (for Month)

[/quote]



This is a great tip - thanks! I've set it up and it's working well for a news archive, where the published date is the critical thing.



However, I am having trouble using the same setup when the date field in question is a metadata field.



When the keyword is entered as asset_metadata_<metadata_field_name>Y (for example), it is not honoured as a group name at all.



When the keyword is entered as asset_metadata
<metadata_field_name>^date_format_Y, a group name is created, but it uses the display format of the metadata field, not the php format.



This means that I cannot group by monthname or year, but only by the individual dates entered into the metadata field



What I am trying to do is to set up the exact grouping format tbaatar outlined in post #5, but using this manually entered metadata date (which we have to use, since the relevant information is often not related to the created, updated or published dates of the asset itself).


  1. is the above expected behaviour from Matrix, or should I submit a bug report?
  2. anyone have any other ideas as to how to achieve the above?



    I also tried setting up two metadata dates with different display formats, and having the value of one posted to the other on asset status change via a trigger, but this did not work - and I can't see any way in the metadata set up area to have one metadata field automatically populated with the value of another metadata field - is this possible?



    Very :huh: This seems like it should be easy.



    Matrix version 3.28.2

Hi,


Beeroll have you tried using with the percentage e.g %asset_metadata_value_Y%. I know it works without the percentage for the PHP date format but for metadata it might require the percentage tags.

[quote]
Beeroll have you tried using with the percentage e.g %asset_metadata_value_Y%. I know it works without the percentage for the PHP date format but for metadata it might require the percentage tags.

[/quote]



Hi tbaatar,



Yes, that's how I tried to configure it first, not realising that the standard asset tags worked without the percentage signs. No luck, unfortunately. :frowning: