Is "<jdoc:include type="head" />" required, and a couple more template questions

213 views
Skip to first unread message

rando...@gmail.com

unread,
Sep 8, 2017, 11:40:38 AM9/8/17
to Joomla! General Development
Hi,

I've got a nice template made up.  Based around Zurb foundation.

However whilst the template all nice in HTML, Joomla messes it up.

For example, if I put <jdoc:include type="head" /> at the top,  Joomla imports MooTools and all sorts of other garbage that is not required by Zurb.  And the template layout just doesn't work (e.g. CSS menus etc are all broken).

Removing <jdoc:include type="head" /> makes the template look worse, not better !

So, question 1. 
Is "<jdoc:include type="head" />" required and is there any way I can "tone-down" what Joomla brings in and make it less "bloaty" ?

Question 2. 
My template has a header of "<html class="no-js" lang="en">"   But Joomla messes it up and mangles it to read "<html class="whatinput-types-initial whatinput-types-mouse whatinput-types-keyboard" slick-uniqueid="3" data-whatinput="keyboard" data-whatintent="mouse" lang="en">"

Help !

Thanks !




Michael Babker

unread,
Sep 8, 2017, 12:20:16 PM9/8/17
to joomla-de...@googlegroups.com
Everything that is placed in your document head with the jdoc:include has been explicitly loaded by something in the system (an extension trying to use a component with a JavaScript dependency to MooTools as an example).  So yes, you need this otherwise you are missing a lot of things that extensions do (not just loading scripts and stylesheets, many extensions also set metadata in the head for things like social sharing or SEO purposes).  If you need some control over what is actually getting spit out in the head element, you can write a plugin hooking into the `onBeforeCompileHead` event to make the changes you need, but this should be done with care.

Joomla core does not alter your base <html> tag.  So you most likely have an extension mangling it.  Possibly a plugin hooking into the `onAfterRender` event.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages