Prime 357

We'll learn something

Site Menu

  • Home
  • Recent Posts
  • Forum
    • Programming Languages
      • C++
    • Website Design & Content Management
      • Wordpress >> Drupal
  • Blogs
  • Books
    • C++
    • Changing hosts - Dummies Guide
    • Wordpress >> Drupal
  • Download Centre
  • Contact us
Home Forums Website Design & Content Management Systems Wordpress to Drupal


Image - OpenID

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password

Navigation

  • Recent posts

Books

  • C++ (The Book)
  • Changing Hosts - a Dummies Guide
  • Wordpress to Drupal

Recent comments

  • Thanks
    2 weeks 1 day ago
  • I'm running the conversion
    3 weeks 4 days ago
  • Can't reproduce
    3 weeks 6 days ago
  • Strange one
    3 weeks 6 days ago
  • No customer support
    5 weeks 2 days ago
  • Came to the rescue
    6 weeks 6 days ago
  • Permalink - %postname%
    7 weeks 5 hours ago
  • Downloads are now ready.
    7 weeks 1 day ago
  • Sorry, I'm just having some
    7 weeks 1 day ago
  • Awesome
    8 weeks 2 days ago

New forum topics

  • funny little bug in mac version
  • Error: Unable to Insert into Node_revisions table when converting from wordpress 2.6.0 to drupal 6.4
  • index.php?
  • where do i download?
  • Source connection settings are correct but it appears it's the wrong database
more

Who's online

There are currently 0 users and 4 guests online.

Who's new

  • puzz1ed1
  • bugmenot
  • ClaudiaB
  • beiduo
  • chourmovs

[Solved] “Drupal titles are not HTML rendered ”

  • View
  • Revisions
Posted on: Tue, 27 May, 2008 - 23:41
Steve

Joined: 2008-03-27
Offline
[Solved] “Drupal titles are not HTML rendered ”

You've probably noticed the ugly title but unfortunately Drupal doesn't render the title, that is, it doesn't interpret the code and display the correct character(s).

In the above example, the codes either side of the title are actually left and right double quotes, the curly type. Using the same code in the body of text “here for instance” and as you can see, they are (codes) correctly rendered or interpreted.

Why mention this I here you ask. Well, it seems like Wordpress does render titles and as such those codes are transferred to Drupal in the conversion process. After conversion, you may see some ugly titles as you see for this forum post. It's not a fault of the conversion process, it's just the way Drupal handles titles.

I'm now researching ways of addressing this problem and most likely it will entail the search and replace feature. Currently the search and replace feature only addresses the body and teaser and not titles. This will be addressed in the next version.

My Google Search led me to this site and this site in relation to HTML character codes.

Steve
My running website

  • 255 reads

Posted on: Tue, 3 Jun, 2008 - 20:29 #1
Steve

Joined: 2008-03-27
Offline
“Worked it out” Here's a spade ♠

As you can see from the subject line, I've worked it out. I've successfully created a function that parses a string of text, strips out the html symbol codes and replaces them with the actual symbols.

This will be incorporated in the next version (1.04).

Steve
My running website

Posted on: Sun, 22 Jun, 2008 - 12:54 #2
mroswell

Joined: 2008-06-22
Offline
This would be great for Aggregator

I've got apostrophes and ampersands becoming their html symbol codes here: http://friendlycoffeehouse.org/aggregator

Any chance you could help me (and others) to resolve that?

(Depending on the latest news, you may have to scroll through a couple of pages to see this effect.)

WOULD LOVE to fix this, and I'm guessing your function holds the key!

Posted on: Sun, 22 Jun, 2008 - 13:48 #3
Steve

Joined: 2008-03-27
Offline
Short, very short, pseudo code version.

image - text fileJust to get some info out very quickly, here is the very, very, short pseudo code version. I'll pen something more complete a little later.

1. Create a text file, which contains all (or most) of the html codes and their corresponding html numerical codes. A sample is displayed opposite. (This file resides in the same directory as the converter program - therefore a full copy can be seen there)

2. Load the contents of the text file into an array or dictionary.

3. It's a two part pass method that I implement.

4. First pass, must check for all the html alphabetic codes (<, >, ") etc. and convert them to their numerical counterparts (&#60 ;, &#62 ;, &#34 ;) etc. (note, there is a space preceding the semi-colon, only there so as to correctly show the numerical code. If removing the space, the symbol is displayed)

5. Second pass, now run a RegEx conversion function over the text replacing all numerical codes with their unicode equivalents. This is the RegEx search pattern "\&#(\d+);".

Please note, when I do write up a more thorough explanation it will be in non PHP terms as I'm not yet skilled in PHP.

Hope this helps in the interim.

n/a
Posted on: Sun, 22 Jun, 2008 - 21:36 #4
DrupalUser

Joined: 2008-05-20
Offline
PHP

I'm sure PHP guru's would be able to translate the code to PHP.

Posted on: Wed, 25 Jun, 2008 - 16:07 #5
Steve

Joined: 2008-03-27
Offline
Here's a follow up

The code can be found here. It's not PHP code but I'm sure PHP developers can work it out.

Steve
My running website

 Subscribe in a reader

free hit counter


RoopleTheme