What good uses to be found by search engines?

Yes, using an HTML-Widget is not the best solution.

This are the solutions I can come up with from the top of my head:

Hidden Content

Just use the a hidden section on you page and insert all the information. Hype provides the words used in your Animation on export in your HTML. Apart of that you can also just enter the word you want to be found like so:

<div style="display:none;">
	<h1>My headline</h1>
	<p>Nullam quis risus eget urna mollis ornare vel eu leo. Nullam quis risus eget urna mollis ornare vel eu leo. Donec sed odio dui.</p>
		<h2>Sub headline</h2>
		<p>Nullam quis risus eget urna mollis ornare vel eu leo. Nullam quis risus eget urna mollis ornare vel eu leo. Donec sed odio dui.</div>
		<a href="some link">some link</a>
		...
</div>

This is only to illustrate hand written structured content for the search engine

Fetching data from within Hype from external content (page context)

<div style="display:none;">
	<h1 id="myHeadLine1">My headline</h1>
	<div id="myContent1">Nullam quis risus eget urna mollis ornare vel eu leo</p>
	...
</div>

Inside of Hype you can the fetch the data with Javascript and replace it in your animation using

/**
* hypeDocument.setInnerHtmlByClass 1.0
* @param {String} class name to overwrite (don't include dot)
* @param {String} content or HTML used to overwrite class
*/
hypeDocument.setInnerHtmlByClass = function(cl, content) {
    var hypeDiv = document.getElementById(this.documentId());
    var hypeElm = hypeDiv.getElementsByClassName(cl);
    for(var i=0; i<hypeElm.length; i++){
            hypeElm[i].innerHTML=content;
    }
}

Array('myHeadLine1', 'myContent1').forEach(function(key) {
	var content = document.getElementById(key);
    	if (content) {
    		hypeDocument.setInnerHtmlByClass (key, content.innerHTML);
    	}
});

This code was written in the post and not tested in Hype but should work :slight_smile:

In Hype everywhere you want the content set you assign the ID form your hidden content node as a classname. So you reduce redundancy.

Using this technic has the problem that you can't preview it properly in Hype as Hype doesn't offer editing or adding to the HTML-Body (I still don't understand why they don't offer it). There is a work around for previewing:

Either solution requires to edit the HTML on publication for SEO...

Example for second approach

externalContent.hype.zip (40,9 KB)

4 Likes