Themes for FlatPress 1.3 in XHTML 1.0 Strict or HTML5?

Ask questions about FlatPress themes, present your themes, request new themes.
Post Reply
User avatar
fraenkiman
Posts: 223
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Themes for FlatPress 1.3 in XHTML 1.0 Strict or HTML5?

Post by fraenkiman » Sun Feb 25, 2024 10:16 pm

Hello everyone,

The plugins, for example jQuery, from FlatPress 1.2.1 or newer are intended for HTML5. If a theme has been written for XHTML 1.0 Strict, it must be rewritten in HTML5.
This usually affects the following template files: cpheader.tpl, header.tpl.

The header in XHTML 1.0 Strict looks like this:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
The header in HTML5 must look like this:

Code: Select all

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{$fp_config.locale.lang}">
Please pay attention to this if you want to migrate a theme to FlatPress 1.3.

With best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

eagleman
Posts: 196
Joined: Sat Mar 02, 2019 12:10 pm

Re: Themes for FlatPress 1.3 in XHTML 1.0 Strict or HTML5?

Post by eagleman » Mon Feb 26, 2024 12:17 pm

Ok, I have converted a few themes.
What have I to do now? Convert them all in XML or HTML5 language?
What's the better option?

User avatar
fraenkiman
Posts: 223
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Themes for FlatPress 1.3 in XHTML 1.0 Strict or HTML5?

Post by fraenkiman » Mon Feb 26, 2024 9:48 pm

Hello eagleman,

In my opinion, HTML5 is the better option. The standard plugins are designed for use in HTML5 documents.

Background:
You can also embed HTML5 videos with BBcode or with Arvid's audio and video player plugin. In the standard plugins (e.g. jQuery, Photoswipe, Lightbox2) scripts are no longer announced with type="text/javascript, as was mandatory when using XHTML 1.0 Strict.
In addition, if the browser is notified of doctype XHTML 1.0 Strict but finds HTML5, this can lead to unsightly views because they are not valid. It used to be the case that search engines did not index a website with invalid HTML code. I can't tell you for sure whether this is still the case today. My motto is still the same: Valid HTML code makes the search engine bot happy - if the content fits, as long as you want to be found with your FlatPress blog.

If you find themes where the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/ is included in the templates (cpheader.tpl, header.tpl ...), simply replace it with

Code: Select all

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{$fp_config.locale.lang}">
Bonus:
If you want to be really meticulous, open each individual page (entries, contact, the individual panels in the admin area...) and copy the page source text from the browser into the W3C validation service as direct input.
This will then show you whether the HTML code is valid or contains errors.
This is a little more time-consuming.

However, you can also leave this effort to the person who downloads the theme and applies it to their blog.

With best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests