Listing web paths and remaps for an asset


#1

version: 5.5.6.4

I am making a dashboard for our content owners to show them information about the pages they look after without giving them access to the admin as a) it would confuse them and b) we don’t want them being able to change anything themselves.

I would like to output some information that there doesn’t appear to be variables for

  • a list of ALL webpaths, not just the main one
  • a list of all remaps that point to the asset

and as a bonus, any scheduled status changes for the asset.

I have asked about scheduling before and found out those are shadow assets, and I’m guessing that the webpath info is the same. But I’m sure I read that it is possible to get those into the front end in some way.

Is this something for which the API is needed? Any examples of doing this sort of thing would be great.


(John gill) #2

No keyword for web paths, but you could extract them from %asset_urls% with SSJS by grabbing the last path segment and culling duplicates.

<script runat="server">
    var web_paths = %asset_urls^empty:[]%.map(url => url.split("/").pop()).filter((item, i, ar) => ar.indexOf(item) === i);
    print(JSON.stringify(web_paths,null,2))
</script>

To the best of my knowledge remaps aren’t gettable by keyword or API.


#3

Thanks for that. That keyword makes it easier.

Frustrating that data that is obviously available because it’s right there in the admin isn’t available in a more user friendly format.


(Bart Banda) #4

Thanks guys, we might look at adding a new keyword for %asset_web_paths% that gives the paths set on an asset as an array, similar to %asset_urls% if developers find that that would be useful. We’ll also look to add it to the Content API.


#5

That would be great!

Can I get %asset_scheduled_events% as well? I’d love to be able to display when an asset is scheduled to change status to people who don’t otherwise need admin access.

What kind of timeframe is there on this kind of development? Am I right in thinking we’d need to be on the latest version to be able to use it?


(Bart Banda) #6

Thanks, we’ll look into a way to get a list of scheduled tasks as well.

Can’t give time frame at this stage as I still have to review it with the development team and assess it based on effort and priority against other backlog items.

Correct. These improvements would go into the latest version of Matrix 6.