Skip to main content
Share Your Experience: Take the 2024 Developer Survey
3 votes
Accepted

How to include scripts in <head>

Default Joomla behaviour is to add scripts to the head element. Try looking where <jdoc:include type="head" /> appears in your template (under template/YOURTEMPLATE/index.php) - it may have ...
RichardB's user avatar
  • 3,082
3 votes
Accepted

Modification of the generated Joomla head (<jdoc:include type="head" />)

You get the `HtmlDocument' object: $doc = JFactory::getDocument(); // echo "<br><pre>"; print_r($doc); echo "</pre>"; // to check what you have here You can get only the head Data: ...
Zollie's user avatar
  • 2,936
2 votes
Accepted

jump after header top bar

If you put on the browser devtools on your site, then in the Inspector you can see that as you scroll down there is a CSS class header-sticky which is added to your <header id="sp-header> ...
Robbie Jackson's user avatar
2 votes
Accepted

How do I add async attribute for scripts?

You'd better not edit ("core hack") Joomla's core files because that's a recipe for disaster. The async attribute is available if you use the HTMLHelper to include your CSS file. See Joomla ...
pe7er's user avatar
  • 2,058
2 votes

Place article specific scripts in head section

There are a few other ways to outline for what you're asking about. SEO Considerations If you run Google Lighthouse on your site to measure the performance, you may find that there may be performance ...
Patrick Jackson's user avatar
1 vote

Place article specific scripts in head section

You could add a script (or CSS) to the doc head using the HTML Helper use Joomla\CMS\HTML\HTMLHelper; HTMLHelper::_('script', 'path/to/your/js/script.js', ['version' => 'auto', 'relative' => ...
pe7er's user avatar
  • 2,058
1 vote

Export as Excel with PHPSpreadsheet as download how to keep Joomla Messages?

You could change the logic of your processing in the Model so that the spreadsheet is only presented if there is data retrieved to be displayed, in which case Closing the Application would make sense. ...
Irata's user avatar
  • 3,947
1 vote

Manipulate Meta Description Content using Joomla Module

Yes, you can do that with something like: use Joomla\CMS\Factory; $keyword = Factory::getApplication()->input->get('yourarea', '', 'string'); $document = Factory::getDocument(); if($keyword) { ...
pe7er's user avatar
  • 2,058
1 vote
Accepted

Joomla 4.1.5 <meta name="keyword"> doesn't show

If you have created your own template... The following code is working when posted inside index.php: use Joomla\CMS\Factory; $app = Factory::getApplication(); $document = $app->getDocument(); $...
Plamen's user avatar
  • 747
1 vote
Accepted

How to use HTMLHelper for other file types?

No, not out of the box. The method handling this, Joomla\CMS\HTML\HTMLHelper::includeRelativeFiles(), and related methods are protected. You'd have to extend the HTMLHelper class to gain access to the ...
Sharky's user avatar
  • 11.4k
1 vote

How to remove CSS and JS from Joomla 4 header?

If you create a template with an index.php file in it and just put <head> </head> at the top and then something like this... <body> <header> <jdoc:include type="...
TheKLF99's user avatar
  • 111
1 vote

How do I add async attribute for scripts?

If you want to add attributes to all scripts, use a system plugin with onBeforeCompileHead event. defined('_JEXEC') or die; use Joomla\CMS\Plugin\CMSPlugin; class PlgSystemExample extends CMSPlugin {...
Sharky's user avatar
  • 11.4k
1 vote

How to include scripts in <head>

Turns out I DID have the ScriptsDown plugin installed, although it didn't show up the first time I searched for it in my early exploration of this issue. I'm guessing I had a typo. Anyways, this was ...
Nick's user avatar
  • 33
1 vote
Accepted

Custom header content depend on article

There are numerous ways to customise something depending on something, so I can only answer by suggesting some ways to do some things. First of all, generally in Joomla one tries to do minimal coding ...
jamesgarrett's user avatar
  • 3,299
1 vote
Accepted

How to debug joomla behaviors?

There's a sourcerer tag used in the facebook og tag generator. If you switch the view source you can see it like this: <meta property="og:description" content=" <!-- You can place html ...
jamesgarrett's user avatar
  • 3,299
1 vote

Changing the headerlogo in beez3 template the image isn't fit to the headerlogo

No, I don't have another template - I know what I 'm talking about and this is about the Beez that comes with Joomla 3. I replaced the image with another of the same size and it's not looking bigger ...
FFrewin's user avatar
  • 19.7k
1 vote

Jquery is not included in my component's head

To expand on Lodder's answer, using JHtml::_('jquery.framework'); at the top of your component's views and before any other calls to your custom js, will ensure that jQuery will be loaded, before ...
FFrewin's user avatar
  • 19.7k
1 vote

Jquery is not included in my component's head

Joomla adds it all over the place. Do a search for JHtml::_('jquery.framework'); in the core files and see how. The javascript frameworks do seem a bit messily implemented. There is some ...
RichardB's user avatar
  • 3,082
1 vote
Accepted

Jquery is not included in my component's head

It's not up to the template or Joomla to load jQuery. You'll normally find jQuery being loaded on a lot of the default pages cause an extension does, however Joomla is not required to load it by ...
Lodder's user avatar
  • 26.9k
1 vote

Change header image Joomla 3.6.0

Assuming that by "header image" you are NOT reffering to "Kiperowil" logo in header, but to trucks images in slider underneath, you can change them in 'Vinaora Nivo Slider' published in position-4. I ...
Mikan's user avatar
  • 3,007
1 vote

Return JSON using the Joomla Framework

Here you go (for use in controller methods mapped to by webservices plugin-mediated routes predominantly): This works in J! 3 & J! 4 In your controller's class, add the following public method (I ...
Joe Hacobian's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible