For defining customization options, the content attribute of <meta> elements should be filled in with the custom values picked by the user, when the template is rendered. I see that they’re left as they are in the original, unrendered template, such as:
<meta name=”text:Flickr Username” content=”“/>
It could be tremendously useful if the Tumblr compiler would fill in the content attributes such as:
<meta name=”text:Flickr Username” content=”atesgoral”/>
For templates that employ progressive enhancement via JavaScript, the <meta> tags could be checked at runtime to change enhancement behaviour based on user settings. This would be better than riddling the template with things like:
<script type=”text/javascript”>
var meta = {
Flickr Username: “{text:Flickr Username}”,
{if:EnableFontReplacement}
EnableFontReplacement: true,
{/if:EnableFontReplacement}
…
};
if (meta.EnableFontReplacement) {
// Do font replacement
}
…
</script>
If the content attributes of the <meta> elements reflected the current settings, reading the settings at runtime would be as simple as:
var meta = {};
$(“meta”).each(function () { meta[this.name] = this.content; });
if (meta[“if:Enable Font Replacement”]) { …
One could even take this further to strip out the type labels and save content values with the proper type (String, Boolean etc.)
-
flymmr liked this
-
gdub liked this
-
magnetiq submitted this to featurerequests