toshi0383 / TVMLKitchen

Swifty TVML template manager with or without client-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to load local files embedded in Template?

marbetschar opened this issue · comments

How may I add local files (from the main bundle) to a xml template?

For example, I'd like to provide a static menu, the user can choose an item by using the stackTemplate.
For each menu Item I want to show a logo, served locally and stored in the main bundle.

For each entry I got a code similar to this:

<lockup>
    <img src="wordpress.png" width="548" height="274" />
        <title>WordPress</title>
</lockup>

And the image wordpress.png is stored in the main bundle - but as you can see on the following screenshot it isn't displayed:

simulator screen shot 14 05 2016 17 44 13

Hi!

Added a new feature in #83 .
If you use Kitchen.serve(xmlFile:), now you can do this.

<lockup>
    <img src="((MAIN_BUNDLE_URL))wordpress.png" width="548" height="274" />
        <title>WordPress</title>
</lockup>

If you use Kitchen.serve(xmlString:) instead, you need to manipulate xml string by yourself.
Checkout the code here.

AWESOME!!!

How my I use this feature with Carthage?

If you want to try out quick, put github "toshi0383/TVMLKitchen" "load-main-bundle-resource" .
Otherwise I will merge it after CI passes and cut a new release for you. 😉

Shipped.

I'll leave load-main-bundle-resource branch for a while.

Awesome!! Thank you very much! I’ve already tested the load-main-bundle-resource, you can delete it whenever you like to!

mit sonnigen Grüssen

MARCO
kowalski

+41 44 341 8000
marco@mandelkind.swiss

MANDELKIND eG Schweiz
Bahnhofstrasse 100
CH-8001 Zürich

Am 14.05.2016 um 19:07 schrieb Toshihiro Suzuki notifications@github.com:

I'll leave load-main-bundle-resource for a while.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #82 (comment)

Anytime!