Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

HTML Widget in Author: how do I simply display content?

I want to create an HTML widget that simply displays static content (offline file: text with images) when the widget is opened by the reader. Any ideas?

Mac mini, Mac OS X (10.7.3), 500GB HD; 4GB RAM; iPad2 64GB

Posted on Apr 30, 2012 8:45 PM

Reply
16 replies

Apr 30, 2012 11:53 PM in response to BasilBaker

No sure why you would want to do this. If the content is purely static, you might as well just include an image.


But, if you insist, you can create the content as HTML and bundle it into a widget. You'll have to add a Default.png image and an Info.plist file and put the whole lot into a directory with a .wdgt extension. (A widget bundle normally also includes an Icon.png file, which appears to be unused by iBooks; I don't know whether you can just leave that file out, or whether you need to include a dummy one.)


See here for more info on what's in a widget bundle.


You can use Dashcode to develop the widget, or put it together by hand. Beware that Dashcode has a lot of serious bugs and frequently trashes your work, so save often and keep multiple backups.


Michi.

May 1, 2012 12:42 AM in response to MichiHenning

Michi, thanks. I don't know why I'm being coy here so I'll just let the cat out of the bag in case I didn't describe my project well enough. I am talking about a story within a story here. Imagine a character in a story opens a 'newspaper' (here is the content: http://www.basilbaker.com/Bearly_News/bearly_news_main_page.html). This content is currently part of a live website. I just want to take my content and insert the entire thing in a "window" (i.e. the html widget) for the reader to "read" what the character is reading. Understand? The html widget doesn't have to link 'live' i.e. I dont want the reader to have to be connected to the internet because I want the html content to be available at all times. Please let me know if you need more detail.

May 1, 2012 12:46 AM in response to BasilBaker

OK, I see what you mean. Still, to do this, I don't think you need an HTML widget. You can just take a screenshot of the content, turn it into an image, and embed the image into your book.


Think about what happens when a reader taps an image: it expands to full screen.


Now think about what happens when a reader taps an HTML widget: it expands to full screen.


If the HTML widget doesn't provide interaction, the experience to the reader is essentially indistinguishable from expanding an image to full screen…


Michi.

May 1, 2012 12:56 AM in response to BasilBaker

BasilBaker wrote:


Michi, wow you're up late, man! Me too :-)

Only 6:00pm in Australia… 🙂


Yeah, I thought of doing this but I am assumed the image quality (jpeg?) wouldn't be high enough for text to be legible. Also, I wanted the reader to be able to scroll through that 'newspaper' content just like on the site now.

You could use PNG, which doesn't suffer compression artifacts.


But, in widget, I don't believe it's possible to have the scrolling you would get in a web. Widgets have a fixed-size canvas. From memory, around 960 x 600 maximum size (it might be a few pixels more or less in either axis).


Hmmm... I seem to remember that, if you have a widget with a URL to a local file, that file is opened in a Safari window inside the widget. This might just give you what you want, if you can put up with having to put link into the widget, effectively saying "click here" or "read more…"


You'll have to experiment to see how well this works.


Michi.

May 1, 2012 1:04 AM in response to MichiHenning

Thanks, mate!


Perhaps the concept could also be described as a widget that is in essence a browser window within the book (i.e. link does not take reader out of iBooks). Is this what YOU mean? If the reader must be online, that's not a deal breaker I suppose. What if I saved that page as a web archive file (*.mhtml) and then have the "browser" widget display that? Appreciate your help!

May 1, 2012 1:06 AM in response to BasilBaker

BasilBaker wrote:


Perhaps the concept could also be described as a widget that is in essence a browser window within the book (i.e. link does not take reader out of iBooks). Is this what YOU mean?

Yes, that's what I had in mind. I think that a URL to a local file will work that way, but I haven't tried this myself.


I have no idea whether a URL to a web archive would work. You'll have to experiment, I'm afraid.


Michi.

HTML Widget in Author: how do I simply display content?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.