b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Demo
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Releases
  • Skins
  • Plugins
  • Locales
 
  • « Archives Widget Plugin
  • Star Renderer Plugin »

Adjust Headings Plugin

Categories: Renderer Plugins, 6.x

This plugin (available in b2evo 6.7) will automatically adjust the headings of all posts and/or comments to make them consistent.

For example, if you have one post containing <h1> sub-headings and another containing <h4> sub-headings when your normal sub-headings should be <h3>, this plugin will adjust all of them to <h3>. Of course, that is for the highest level of sub-headings. If you use sub-sub-headings, they will be adjusted down to <h4>, <h5>, etc.

Author
Last tested in version

Let's assume we want to normalize the highest sub-heading level to h3:

The plugin will perform these tasks:

  1. Scan the text for <h[1-6]( .*)?> and determine the existing highest level in the text. Maybe it's h1 (example A), maybe it's h3 (example B).
  2. Adjust all headers so that the highest one is the set top level:
    • Example A:
      • h1 becomes h3
      • h2 becomes h4
      • h3 becomes h5
      • h4 becomes h6
      • h5 becomes h6 (we can't go over h6 in HTML)
      • h6 becomes h6
    • Example B:
      • h1 doesn't exist
      • h2 doesn't exist
      • h3 becomes h3
      • h4 becomes h4
      • h5 becomes h5
      • h6 becomes h6

Let's have an additional example:

We set the plugin collection setting Highest level heading to 2 for <H2> and the source text is:


<h4 id="">Heading</h4>
haha I put a small heading before a large one to trick you!
<h3 id="">Another heading</h3>

The detected highest level is h3. The plugin settings request that the highest be h2. So the plugin should change the text to:


<h3 id="">Heading</h3>
haha I put a small heading before a large one to trick you!
<h2 id="">Another heading</h2>

Per Collection Settings

Adjust Headings Plugin
  • Apply rendering to posts: how the content of the post will be rendered by plugin (for more information about apply rendering, please read: )
  • Apply rendering to comments: how the comments will be rendered by the plugin (for more information about apply rendering, please read: )
  • Highest level heading: specify the highest heading level to use: 1 for <H1>, 2 for <H2>, etc.
Tags: 6.10.7

No feedback yet


Form is loading...

Plugin Repository

Plugins are little PHP scripts that allow you to add features that are not (yet) built into the b2evolution core.

How to...

  • Introduction to Plugins
  • How to install a plugin (after downloading it)
  • How to make a new plugin
 Upload a plugin!
Submit your own plugin

User log in

Lost your password?
Register »

Search by keyword

Filtering options

Retain only results that match:

XML Feeds

  • RSS 2.0: Posts, Comments
  • Atom: Posts, Comments
What is RSS?

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque