Adding custom code into head section

Search
Other Pre-Sale questions
Forum

Adding custom code into head section

marvays's Avatar marvays
Hi. Can I use one of the extensions in the menu to insert code into the page in the head and body section? Like tracking codes, conversion codes, etc.? I don't like putting it in the page code directly. I would like to have it in some kind of extension on all websites. Thank you.
Peter van Westen's Avatar Peter van Westen ADMIN
You can use Sourcerer to place the code.
Put that in a module of type Custom and assign it to all pages or just the ones you need it on.
regularlabs.com/sourcerer
Please post a rating at the Joomla! Extensions Directory
marvays's Avatar marvays
Thx.

I tried it and it seems impractical. Maybe this is an interesting idea for your next extension. I see it as an interesting component for simple, but mainly clear management of these codes.

Administration could look the same as ReReplacer. The whole component could look like ReReplacer, with the difference that I will not search and replace, but just insert. I would immediately buy such a component, because I like order in codes 🙂


marvays's Avatar marvays
Heh... maybe i can use for it ReReplacer

Peter van Westen's Avatar Peter van Westen ADMIN
Yes, you could also do that...
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
Probably better to look for the closing </body> tag instead.
Please post a rating at the Joomla! Extensions Directory
marvays's Avatar marvays
Really? They always guess they want before HEAD. What is the difference?
However, I would definitely buy a component directly for embedding the code if you do it the way I wrote above 🙂
Peter van Westen's Avatar Peter van Westen ADMIN
Doesn't really seem to matter:
stackoverflow.com/questions/3694356/is-t...-not-in-body#3695553
I would definitely buy a component directly for embedding the code
I won't be making such a component, because:
well, you can do exactly this with ReReplacer...
Please post a rating at the Joomla! Extensions Directory
marvays's Avatar marvays
Hi. I have an additional question. How to create replacements so that the generation of the page is as minimal as possible? For example, Enable in area only body, or something else?
Peter van Westen's Avatar Peter van Westen ADMIN
ReReplacer needs to do the least amount of stuff if you set the Area to Everywhere or Body.
So set it to that if it doesn't really matter for your replacement.
Please post a rating at the Joomla! Extensions Directory
marvays's Avatar marvays
That's what I thought too. But if I use BODY or HEAD only, it doesn't work. I have to have Everywhere
Peter van Westen's Avatar Peter van Westen ADMIN
Well, yes, in your case, with that specific replacement, you are searching for '</head>'.
That only appears in the entire HTML code. So you need to set it to 'Everywhere'.
Please post a rating at the Joomla! Extensions Directory
marvays's Avatar marvays
Good. I understand that '</head>' is already outside the head 🙂
Peter van Westen's Avatar Peter van Westen ADMIN
Correct. The 'Head' only contains the stuff inside it.
Please post a rating at the Joomla! Extensions Directory
You can only post on this forum if you log in