Mix content types within an Excel data feed, another method to do it

Heya all,

This message is an extension of the current Help Center article here. It’s recommended to read it before you continue further.

As you know, in the article, there is a small limitation being that you have to use the same file extension for each type of media. So here is another way to do it.

The trick is the same, we are going to use an Excel file, with a list of records containing a column with the path to the media. The addition will be to set up another column with a type of media.
Types will be for this example: image, video or document.

The Excel file will look like this:
image

The point is to have different file extensions for the same file type (.png and .jpg for images, .mp4 and .wmv for videos here).

In the experience, we will use the same trick and put in Template the 3 required Assets to display the 3 types of media, like this:

image

The content of each Asset will use a binding to the media path.
As you guessed, if we keep it this way, only some media will be displayed, and it will end up like this:

We keep the same trick that in original article and we’re going to bind the visibility of each Asset to the type of media, and set up a Converter to show the Asset if the Media is related.

The Custom Converter will look like this for the Image Asset:

if (INPUT == "image") "True"
else "False"

Meaning that you will show the Image Asset only if your type of element is “image”. Same goes for the videos and documents.

And voilà! you now have a mixed media collection, pulled from Excel :slight_smile:


(Asset Grid on top, Swap Collection below)

Enhancement:
Some may think is not that an improvement compared to the original article but wait … there is more! :wink:

Now that you have a column for the document type, you can use it easily as a filter. With just a few toggle buttons, you can display any type you want! :tada:




Download

The sample used for this message is available here:
https://data.intuiface.com/KB-Samples/6.6/Community/Community-AnotherMixMediaExcel.zip (45Mb)

2 Likes

Cool!

Super cool!

Does it work on Android :slight_smile:

hi,
In this type of excel data feed integration,
If I enable tap item to open is it possible to maximize opened item to full screen with double tap gesture. (for example, if I want to play opened video in full-screen)

It should as long as you are using files supported by Android player. I’ve run a quick test on Composer Play mode for Android and only had an issue with the .wmv video file which not supported.

image

Feel free to download the sample and give a try yourself :wink:

It won’t work “as is” because the maximized item isn’t set to react to double tap by default.
You have to do it yourself by creating a detailed view that will behave the way you want. We have an article explaining how to do it here: displaying data feeds using a summary list with detail view.

Regards,

Alex.

1 Like

Thanks @Alex for sharing the tip.

Just a comment on

An easier / nicer / lazier way that works on all platforms is to use the following code in the script converter

(INPUT == "image")

This returns true, the boolean value and not the string, if INPUT equals “image”, else false. I think you don’t even need the parenthesis, but didn’t test :wink:

4 Likes