Last week we took a first look at the content “Category”, the magical little folders that you can use to organize, schedule, and update content across your entire network. This week, we’ll look at a trick that you can use to randomize the order of content inside of a category.
This setup is admittedly more difficult than it should be, but the results are both cool and powerful.
The first step is to create your content category by going to Content > New Category in the main menu. Give the category a name, but make sure not to use spaces. For this example, I’m going to create a category called “my_images”. Note the underscore instead of a space. This will make more sense in a second.
Next, add the category to a template. It doesn’t actually matter what region the category is added to, it just needs to be in the template where you want to play the content. And UNSCHEDULE the category as well (right-click > Unschedule). Again, all of this will make more sense in just a moment. Hang in there.
Next, we’re going to create a Content Feed item. This item is going to read the contents of the category that we just made. Click on the Content Feed icon.
Here’s where things get interesting. In the Content Feed properties, I’m going to give it a name of “Random Pictures”. In the URL, I am going to add the following syntax:
This is likely new to you. What this does is it tells Content Player that you want to look for a content item by the name of “my_images”, and you want to use that as your data source. For this to work, the content item MUST be present in the same template. That’s very important: It won’t work if you leave the content category in the content bin.
Next, I’m going to change my Data format to XML. When the player reads the category, it’s going to return XML of what’s inside of the category. Finally, click the ellipsis button (…) next to the Data format dropdown, and change the XPath to:
Again, a little more complicated than it should be, but that was the hard part. below is an image of that setup:
Press “OK” to the XML Properties window and the Content Feed Properties window. You can then take your new “Random Pictures” content feed item and drag it into your template. Schedule it in the region where you would like to see the content displayed. In the image below, I have my content feed item and my content category in the same region, but that isn’t necessary. The two can be in separate regions (as long as they are in the same template):
If you preview your sign now, you should see the images from your category being displayed in the region with your content feed item. Cool! We’re using a content feed item to read in and display the contents of a category. Why is this important? Because now we can use the functionality of the content feed item to our advantage.
Right click on your content feed item and choose “Edit Source Content”. Back inside the properties window, choose the “Filter and Sort” button. This brings you to what looks like the Live Data Layout editor, but there is no actual layout to be done. In the top right corner of the screen, you will see sorting options in the Sort tab. If you choose “Shuffle rows” from that dropdown, then you have effectively told Content Player to play your content in random order.
And that’s it. There are a ton of other use cases for this Layout Properties window, including filtering your content by content name or content type using the “Filter” tab, or playing only a few items at a time using the “Cursor” tab.
But I will come back and do a more detailed blog post on all those tabs and their options at another time. For now, sit back, relax, and enjoy the random ordering of your new content feed!
See you next week, and #DoYouFWI?