Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Adlago Posted October 14 Posted October 14 How can I add a custom template to my theme head? I created it through theme designer - templates.
Marc Posted October 15 Posted October 15 Im not sure what you mean by "add" it. Are you looking to insert code somewhere within it?
Adlago Posted October 15 Author Posted October 15 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.
Baian007 Posted October 15 Posted October 15 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
Adlago Posted October 15 Author Posted October 15 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.
Baian007 Posted October 15 Posted October 15 (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 October 15 by Baian007
Nathan Explosion Posted October 15 Posted October 15 (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 October 15 by Nathan Explosion Adlago 1
Baian007 Posted October 15 Posted October 15 I did the same thing - I created a template and hooked it to the offline page. Matt 1
Adlago Posted October 15 Author Posted October 15 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...
Nathan Explosion Posted October 15 Posted October 15 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
Nathan Explosion Posted October 15 Posted October 15 (edited) And you're on beta 1, yes? Are you using IN_DEV? Yes or no. Edited October 15 by Nathan Explosion
Adlago Posted October 15 Author Posted October 15 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
Nathan Explosion Posted October 15 Posted October 15 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.
Adlago Posted October 15 Author Posted October 15 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.
Adlago Posted October 15 Author Posted October 15 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
Marc Posted October 15 Posted October 15 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
Recommended Posts