Adlago Posted Monday at 12:26 PM Share Posted Monday at 12:26 PM How can I add a custom template to my theme head? I created it through theme designer - templates. Link to comment Share on other sites More sharing options...
Marc Posted Tuesday at 08:38 AM Share Posted Tuesday at 08:38 AM Im not sure what you mean by "add" it. Are you looking to insert code somewhere within it? Link to comment Share on other sites More sharing options...
Adlago Posted Tuesday at 09:03 AM Author Share Posted Tuesday at 09:03 AM 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. Link to comment Share on other sites More sharing options...
Baian007 Posted Tuesday at 10:50 AM Share Posted Tuesday at 10:50 AM Select your theme and choose the template option. You can create a custom template. Create a custom template and select to hook it to a specific template. Adlago 1 Link to comment Share on other sites More sharing options...
Adlago Posted Tuesday at 12:08 PM Author Share Posted Tuesday at 12:08 PM 1 hour ago, Baian007 said: Select your theme and choose the template option. You can create a custom template. 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. Link to comment Share on other sites More sharing options...
Baian007 Posted Tuesday at 12:29 PM Share Posted Tuesday at 12:29 PM (edited) 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. Edited Tuesday at 12:31 PM by Baian007 Link to comment Share on other sites More sharing options...
Nathan Explosion Posted Tuesday at 12:32 PM Share Posted Tuesday at 12:32 PM (edited) 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 Step 2: adding it in before the </head> Edited Tuesday at 12:37 PM by Nathan Explosion Adlago 1 Link to comment Share on other sites More sharing options...
Baian007 Posted Tuesday at 12:35 PM Share Posted Tuesday at 12:35 PM I did the same thing - I created a template and hooked it to the offline page. Matt 1 Link to comment Share on other sites More sharing options...
Adlago Posted Tuesday at 12:51 PM Author Share Posted Tuesday at 12:51 PM 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... Link to comment Share on other sites More sharing options...
Nathan Explosion Posted Tuesday at 12:57 PM Share Posted Tuesday at 12:57 PM 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 Link to comment Share on other sites More sharing options...
Adlago Posted Tuesday at 01:01 PM Author Share Posted Tuesday at 01:01 PM this is my list Link to comment Share on other sites More sharing options...
Nathan Explosion Posted Tuesday at 01:08 PM Share Posted Tuesday at 01:08 PM (edited) And you're on beta 1, yes? Are you using IN_DEV? Yes or no. Edited Tuesday at 01:10 PM by Nathan Explosion Link to comment Share on other sites More sharing options...
Adlago Posted Tuesday at 01:11 PM Author Share Posted Tuesday at 01:11 PM 2 minutes ago, Nathan Explosion said: And you're on beta 1, yes? 4 minutes ago, Nathan Explosion said: Are you using IN_DEV? Yes or no. No Link to comment Share on other sites More sharing options...
Nathan Explosion Posted Tuesday at 01:16 PM Share Posted Tuesday at 01:16 PM 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. Link to comment Share on other sites More sharing options...
Adlago Posted Tuesday at 01:21 PM Author Share Posted Tuesday at 01:21 PM 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. Link to comment Share on other sites More sharing options...
Adlago Posted Tuesday at 01:46 PM Author Share Posted Tuesday at 01:46 PM 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 Link to comment Share on other sites More sharing options...
Marc Posted Tuesday at 01:59 PM Share Posted Tuesday at 01:59 PM 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 Link to comment Share on other sites More sharing options...
Recommended Posts