Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Template strategy

$
0
0
Hi

These are just my thoughts regarding code bloat and just adding javascript to master cshtml. This reminds me that few years ago some people argued against Silverlight and Flash with the statements why downloading so much code and today people need some feature, google after it, find let say kwicks and add implementations with mootools and the site already uses jquery plus much more. Today we see even more and more sites with 200k+ javascript, css etc and if not properly configured.... Geez poor trees are cut down for energy...

The problem is that I need some features (jquery kwicks) only on some parts of the website (tutorials and/or similar) and would not like to add it into Master. If add it into Page template or some function - due to the fact that Masterpage references are outermost (closest to the closing </body> tag) thus causing that reference to jquery blows (resets) all jquery plugins referenced to that point.

So I see only 2 options:
  1. keep adding everything into masterpages or
  2. to additional masterpage.cshtml in shared code (is this possible) without any (or minimal-common) and move all referencing of scripts either into Page Templates or Functions.
I must say option 1. is not real "solution"...

Is it possible to control "location" of the javascript referencing in the chain:
  1. Masterpage.cshtml
  2. Page Template
  3. Function
  4. Content Page
thanks

mel

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>