How create site without head (<jdoc:include type="head" />)

More
9 years 5 months ago #58436 by MikeM
Hi!
I try create site based in my own scripts, so i no need in mootols or Joomla core jQuery, because i load it from google CDN.
I no need select2, masonry and other scripts
Structure of my project - simple - bootstrap4.css + jquery +my app.js
But i cant do it, becase something turn on core scripts and styles (more 1 mb)

So i delete <jdoc:include type="head" /> from my template as most simple method

Now how i can generate title and other meta im my template. I do this earlier with native joomla -
title as <title><?php echo $this->title; ?></title> as example
But ow i ca do this whith Flexi?

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #58438 by ggppdk
Hello

that is handled by Joomla and not FLEXIcontent

see this old (related) thread in Joomla-CMS (Github)
github.com/joomla/joomla-cms/pull/2688

about FLEXIcontent, what we do

- is avoid JS scripts inside the body,
so that in future people maybe allowed to move this to the page footer if Joomla adds supports for this
or if someone tries to use a plugin for this

- also for JS libraries we have parameters in component configuration to allow adding manually in frontend

BUT the scripts that make use of jQuery and select2, etc will be loaded, we do not support not loading these


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #58439 by MikeM
i found this in mod_flexicontent.php
Code:
/* // Load needed JS libs & CSS styles FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools'); flexicontent_html::loadFramework('jQuery'); flexicontent_html::loadFramework('flexi_tmpl_common'); // Add tooltips if ($add_tooltips) JHTML::_('behavior.tooltip');

it is better in parameters in module?

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #58449 by ggppdk
Hello

such code exists in module and in views too


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #58532 by iamrobert
Hi Mike,

I use Zurb Foundation - so I always want to disable bootstrap/css etc. You can try through your template but FLEXIcontent will override these values.
The most reliable way that I have found is with:

jcc-js-css-control:
joomla-extensions.kubik-rubik.de/jcc-js-css-control

I have modified it slightly for FLEXIcontent and instructions are here:
github.com/iamrobert/remove-flexicontent...ter/jscsscontrol.php

Cheers,

Robert
The following user(s) said Thank You: MikeM

Please Log in or Create an account to join the conversation.

More
9 years 5 months ago #58533 by MikeM
Hi iamrobert! Thank you for decision.

So i went on my way.
I dont want use some plugins for it, i want do it only in php with core joomla.
I delete <jdoc:include type="head" />, and try create all with my scripts

I ask this question, because i dont know how made meta tags, hovever i think i know how it do (may be uncorrect, but it works :cheer: )
I decide this with core joomla addcustomTag
In index.php of my template i add in <head> this:
Code:
<?php foreach($this->_custom as $key => $value) { echo $value; } ?>

And then in my flexicontent template item.php i add
Code:
$doc->addCustomTag( '<meta property="og:type" content="article" />'); $doc->addCustomTag( '<meta property="og:title" content="'.$item->title.'" />' ); $doc->addCustomTag( '<meta property="og:section" content="'.$somevariable.'" />' );

When rendering page - it looks like
Code:
<meta property="og:url" content="http://site.com/alias" /> <meta property="og:description" content="Post-graduate student of Moscow State University beat a female guard dorm homemade spear." /> <meta property="og:type" content="article" /> <meta property="og:title" content="Post-graduate student of Moscow State University was attacked with a homemade spear at the female guard" /> <meta property="og:section" content="Education" /> <meta property="og:image" content="http://site.com/images/stories/flexicontent/item_17_field_21/m_j0403195.jpg" />

<meta property="og:description"> - generate Flexi , but i dont know where
<meta property="og:section" > and <meta property="og:image"> - i take from custom field in template

It works with any tags, including css and scripts like
Code:
$doc->addCustomTag( '<script src="test.js" type="text/javascript"></script>' );
render as
Code:
<script src="/test.js" type="text/javascript"></script>

I think it very quite conveniently with Flexicontent - because i can use different scripts/styles/metas in different Flexi views
The following user(s) said Thank You: iamrobert

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.720 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save