How to add <!doctype html> to all pages?

AndreV
Participant

Hey guys,

I just started in a job where we manage a multilanguage website with loads of pages. On all pages, the doctype declaration is missing, which is kind of a must-have, I believe.

Where is the starting point to add the <!DOCTYPE html> declaration to the top of the page? I tried the template what is being used and tried ../base.html, but nothing helped. 

Any help is appreciated, thanks 

1 Accepted solution
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

@AndreV 

 

Make sure to include the <!DOCTYPE html> declaration in the base.html file and then extend it in every template.

 

{% extends "./layouts/base.html" %}

 

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!

 




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

4 Replies 4
AndreV
Participant

Thank you, everyone, for the help, I appreciate it. The doctype declaration in ./layouts/base.html was placed after some static modules (used for settings/configuration) were called but before the <html> tag. However, I’m not sure those modules are in the right place, but now that I moved the <!DOCTYPE html> declaration above the modules, it works fine. 

GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

@AndreV 

 

Make sure to include the <!DOCTYPE html> declaration in the base.html file and then extend it in every template.

 

{% extends "./layouts/base.html" %}

 

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!

 




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


MBERARD
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Hi @AndreV ,

 

that's weird, adding the missing tag in base.html should have resolved the problem. Is the tag still missing by now?

 

Best,

 

Matthieu

matt_scott
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

This should really be in the template files, I assume the templates have been custom built?
All the default hubspot ones include this

When you edit a page you will see settings > template > edit this template

Hopefully most of you're pages are built based off a few templates and you just need to update it in a few places.

If you see an {% extends ... %} tag in the template instead of the usual html at the top you should go to the file path of the extends file, this is like a master file that is pulled into sub templates

Matthew Scott
Head of Development & Hubspot Solutions Architect | Deeply Digital

B2B marketing agency: Specialist B2B content marketing and demand generation for SaaS vendors and HubSpot Users | Deeply Digital | HubSpot Partner since 2010


01926 334003

deeplydigital.co.uk

3 Morton Street, Leamington Spa, CV32 5SY, UK