Metadata, asset listings and logic: possible?


(Bdebroglio) #1

Is the following possible?

 

I have standard pages, the content of which is relevant for a defined period of time. Metadata is used to describe this period of time.

  • Date Available defines the 'start' date & time
  • Date Expire defines the 'end' date & time

I would like to create asset listings that show:

  1. Pages relevant 'now' -- %globals_date% > Date Available AND %globals_date% < Date Expire
  2. Archive -- %globals_date% > Date Expire

 

Thanking you!


(Nic Hubbard) #2

Hmm, you might be able to do this with Triggers and linking those assets into an "Archived" folder or a "Now" folder. But, I have not tested this.

 

Seems like a complex thing to do.


(Bdebroglio) #3

Thanks Nic. I'd rather not move assets around - it's one of the problems I'm trying to overcome, actually.

 

It's easy enough to compare dates programatically, I'm just wondering how to accomplish this within Squiz Matrix, to take advantage of the asset listing functionality.


(Nic Hubbard) #4

Thanks Nic. I'd rather not move assets around - it's one of the problems I'm trying to overcome, actually.

 

It's easy enough to compare dates programatically, I'm just wondering how to accomplish this within Squiz Matrix, to take advantage of the asset listing functionality.

 

I didn't mean move the assets, just link them. I would link them into a location that has no webpath so that they don't get a new URL.


(Bdebroglio) #5

Thanks Nic, I'll read up on Triggers.

 

The individual pages listed will still need to be accessible, whether they are relevant 'now' or not. I should have stated that upfront. It's just the listing itself that needs to conditionally show assets.


(Nic Hubbard) #6

The individual pages listed will still need to be accessible, whether they are relevant 'now' or not. I should have stated that upfront. It's just the listing itself that needs to conditionally show assets.

 

I realize that. But, by linking into folders like I mentioned you with effectively group them how you want. Then you can point an asset listing at those folders, list the assets, and the users will still be able to access those access through their normal URLs. The folders are just used to group the assets the way you are wanting and for the asset listing to source from.


(Anthony) #7

Two other thoughts occur to me... untested...

 

1 - could you use conditions in a paint layout to decide whether a specific item gets listed or not? So the asset lister thinks its listing them all, but the format uses a paint layout where the whole output is in the test so it either prints the details or outputs nothing for each entry

2 - have the asset lister output the whole lot in a JSON array format - including the two dates - and then have a bit of javascript that tests the dates and dynamically adds (jQuery) the necessry HTML to a placeholder on the page for the ones that need to appear.