Body HTML Feature (persistent)


#1

As with HEAD HTML I would want a persistent BODY HTML to avoid erasing after re-publishing. Any solution?


#2

At this time that’s not possible, but thanks for the request!


(Jonathan Deutsch) #3

One thing you can do is at export time, uncheck “Also save .html file.” It won’t help in previews, but at least this way it won’t overwrite HTML changes for exported documents.


#4

Thanks … I am doing it this way but this breaks the easy preview feature (as mentioned).
BTW is it possible to rename the default JS and folders names in Hype?


(Jonathan Deutsch) #5

The folder/file names are based on the name you save it as; there’s not any customization beyond this.


#6

Any news… this feature would make my development so much easier. I started implementing a script that fetches content from the surrounding HTML page by ID and assigning it to Hype Elements by Class… this way I have content that can be easily updated by a CMS and seach engines can index the page nativ and with the dynamic content.

The following features would make hype development so much easier (please include it in the next update!):

  • Edit Body HTML: I could add HTML to the body (my actual ID based content nodes) so I could see my page in the preview without having to export it on every test flight (Edit Body). It could also just be a slot … this would also benefit others who could use this to add certain JS libs etc. before the closing body-tag

Alternative

  • Allow a export template selection in the document settings and provide a folder in which one can add HTML template files (like adobe flash does it)! This would be great! As I also develop ads based on HYPE and I could create templates that build the wrapper for a floorAd etc.

#7

I found a workaround for development (using jQuery). Keep in mind that this is for development only. Once I finish setting up a site I transfer the content manually to the index.html and have it static for crawlers. Put the following into your headHTML:

<!-- jQuery -->
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
	
<!-- body content for development -->	
<script>	
$(function(){$('body').append(function(){/*!

	<div style="position:absolute; left:0px; top:0px; z-index:1000;">Hello World</div>
	<p>Put your HTML here</p>

*/}.toString().replace(/^[^\/]+\/\*!?/,'').replace(/\*\/[^\/]+$/,''))});
</script>

The method has the following benefits:

  • Custom body content is accessible from within Hype 3 development and previews (allows using the convenient preview button).
  • Content is not polluted with JS string concatenation (multi-line var definitions are only possible in ES6)
  • Easily transfers when finally publishing your site/work

Based on:


#9

Thanks for sharing this slick solution!


#10

Hi, any news on custom Body? Would be very helpful for me too!


(Jonathan Deutsch) #11

There has been some work done to help specifically for cases where there are known manipulations you want to make (say like an ad where you always want clickTag code). But we don’t make feature or release date promises ;).