Adam, thanks for your answer.

I've added the bits to my main template, now in my actual content template, how do I make it so <script> and <style> tags go to the place holder?

They seem to be rendered inline with the document itself (like in the content template) rather than being put in the proper data-holes.

By on 1/5/2016 9:44 PM ()

Perhaps I am misunderstanding you here, but, if you are asking whether WebSharper will change your template and move any inner <script> and <style> tags to the master placeholders, the answer is that it won't.

If that's what you need, instead of hardcoding the scripts and styles in your inner template, you can define new resources for them, and annotate these resources on the F# code unit (function, etc.) that generates the content that needs those resources. This way WebSharper can put them in the proper managed placeholders automatically.

By on 1/6/2016 7:03 AM ()

Thanks Adam, yes I was looking to have my script/style tags moved if it was possible to define this in the template.

I'll look into resources, those should be quite useful when I create reusable views.

I think considering a template driven approach for this would be helpful though, I used sparkviewengine in the past and with those two features it was easy to achieve what I need:

<use content="" />

https://github.com/SparkViewEngine/spark/wiki/use-element

<content name="">

https://github.com/SparkViewEngine/spark/wiki/content-element

By on 1/6/2016 9:19 AM ()

The placeholders scripts, meta, and styles are "managed" placeholders, e.g. their content is auto-managed by WebSharper. The sentence above simply means that these holes will not show up as members on the Doc value inferred from the template.

So all in all, your typical template would look something like in this announcement.

By on 1/5/2016 4:45 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper