Jump to content

Featured Replies

Posted

How can I add a custom template to my theme head?

I created it through theme designer - templates.

Im not sure what you mean by "add" it. Are you looking to insert code somewhere within it?

  • Author
24 minutes ago, Marc said:

Im not sure what you mean by "add" it. Are you looking to insert code somewhere within it?

Example: I have created a custom template that only contains a link-rel   preload for image.
This template I want to add before close the head tag in my theme.

Select your theme and choose the template option.

  1. You can create a custom template.
  2. Create a custom template and select to hook it to a specific template.

Could contain: Page, Text, File, Computer Hardware, Electronics, Hardware

Screenshot2024-10-14at17_06_46.thumb.png.0eeb824ab0038ba93b1c8e3139f41fbd.webp

  • Author
1 hour ago, Baian007 said:

Select your theme and choose the template option.

  1. You can create a custom template.
  2. Create a custom template and select to hook it to a specific template.

 

That's what I saw. But there is no option anywhere to add a custom template in the head, ie. this custom template does not contain any code to change or add to the different parts of the site, but only contains a link rel preload, or prefetch - and should be added to the head in site.
Or, as in the theme editor there is a Custom CSS that adds inline CSS directly to the site head, so there should also be a Custom template in the theme editor, so that optimization preloads, prefetch, etc. can be easily entered.

Have you tried adding your code to the Page header or global Template?
Check view the template and hook your code to the part you wish.

Could contain: Page, Text

Could contain: Page, Text

Edited by Baian007

29 minutes ago, Adlago said:

That's what I saw. But there is no option anywhere to add a custom template in the head

I'll add in the 2 steps, if you wish to use a custom template. But you really only need to do one, which is adding your code in as a HOOK directly in the place you want it.

Anyway...

Step 1: custom template

Could contain: Page, Text, File, Webpage

Step 2: adding it in before the </head>

Could contain: Page, Text

Edited by Nathan Explosion

I did the same thing - I created a template and hooked it to the offline page.

Could contain: Text

  • Author
12 minutes ago, Nathan Explosion said:

Step 1: custom template

Thanks Nathan,
I had that idea when I was looking at this - but even now I've checked a list from System 5 times. My list is missing front/ global/ global template...

2 minutes ago, Adlago said:

My list is missing front/ global/ global template...

So maybe you could actually provide a screenshot of what you DO see, so people don't have to guess what you are seeing?

Anyway...here it is, in all it's glory, in the listing of available hooks for System on a test installation of Beta 1

Could contain: Page, Text, File

 

  • Author

this is my list

Could contain: Page, Text, File, Webpage

And you're on beta 1, yes?

Are you using IN_DEV? Yes or no.

Edited by Nathan Explosion

  • Author
2 minutes ago, Nathan Explosion said:

And you're on beta 1, yes?

Could contain: Page, Text

4 minutes ago, Nathan Explosion said:

Are you using IN_DEV? Yes or no.

No

 

OK - your actual issue has now been fleshed out to be clearer. Good luck - sounds to me like you may have an issue with static\templates\core_front_global.php not containing the correct template information for beta 1. If I was you, I'd ensure that all of your files are replaced with the ones in the current beta 1 download package.

  • Author
4 minutes ago, Nathan Explosion said:

OK - your actual issue has now been fleshed out to be clearer. Good luck - sounds to me like you may have an issue with static\templates\core_front_global.php not containing the correct template information for beta 1. If I was you, I'd ensure that all of your files are replaced with the ones in the current beta 1 download package.

Could contain: Page, Text, Chart, Plot, Number, Symbol

  • Author

I have now downloaded Beta 1 again.
I compared the size of front global php file - exactly the same

I also re-uploaded the templates directory, cleared the site cache - the situation with the list is the same - missing front/ global/ globalTemplate

13 minutes ago, Adlago said:

I have now downloaded Beta 1 again.
I compared the size of front global php file - exactly the same

I also re-uploaded the templates directory, cleared the site cache - the situation with the list is the same - missing front/ global/ globalTemplate

Feel free to add that to the bug tracker

Recently Browsing 0

  • No registered users viewing this page.