What you need:
– Basic knowledge in HTML and CSS.
– A Mac and Xcode (no programming skills required) for exporting the app.

Include via JS

For including content Laker uses the TMT CSI Javascript Library by Massimo. Use the following markup to include a html file into a dossier. Note that you must specify a unique “id” and the path to the file.

<div id="includeFooter“ csi:src="inc/footer.html"></div>

The included html file contains exactly the code snippet which should be included, for example:

<div class="footer">
<div class="content-element">
All images: © Florian Franke, <a href="http://www.franke-photography.com">http://www.franke-photography.com</a></div>
<!-- Div content-element --></div>
<!-- Div Footer -->

Client-side including is not very search engine friendly, but it’s the only solution that works in iOS apps.

If you have another idea, please comment below!

Laker is now on github! Please discuss issues, suggestions or tipps in the github forums of Laker. Thanks! ;)

2 Responses to “Include via JS”

  1. I’m planning to make a book made but lots of includes. Each level (basic, intermediate and advanced) will be a mix of different includes. So, a chapter will be the sum of these specific includes. Do you think it will work?

    The idea is to make a huge book, and then, at the beginning of every chapter, a menu let’s you decide which version do you want to read. Each button redirect you to a different page with it’s own set of includes. So, maintain all three versions of the book will be a matter of maintaining the different fragments that compose a page.

    Imagine: chapter 1, basic level, will embed sub content 1.1, 1.4 and 1.19. The same chapter, level intermediate will load 1.1, 1.2, 1.4, 1.10, 1.12 and 1.19. The advanced level will load all the content.

    Also it will be cry beautiful if, in the future, you implement some kind of annotation or highlight, and also some degree of control from a user perspective of font size and type.

    Thank for your beautiful work and for taking the time for reading this email!!!

  2. Hey Javier,
    hm, good question, I’m not sure, if I understood you correctly. But if you just need to include files within files, I see no problem.

    I think you just have to try it out! ;)
    And let me know how it goes!

    florian

Leave a comment, suggestion or question.

You must be logged in to post a comment.