Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-08-14 19:57:10
- sidesh0w
- New Member
- Registered: 2004-12-21
- Posts: 2
[issue] WordPress import + Textile = bug?
After importing entries from a WordPress database to a test TextPattern install, all of my posts were showing up with extra markup; I’d handwritten all the WP posts’ HTML, but TextPattern surrounded each paragraph with another <code><p></code> element, and tossed a bunch of <code><br /></code>s all over the place. This despite having <code>$use_textile</code> set to 0 in <code>txp_prefs</code> <em>before</em> running the import.
The markup in the <code>body</code> field of <code>textpattern.articles</code> is fine, but <code>body_html</code> is borked. As near as I can tell, this is the offending code in <code>import_wp.php</code>:
<pre><code>//Ugly, really ugly way to workaround the slashes WP gotcha
$a[‘Body’] = str_replace(‘<!—more—>’,’‘,$a[‘Body’]);
$a[‘Body_html’] = $textile->textileThis($a[‘Body’]);[/code]</code></pre>
I’m new to TxP, so I’m probably doing something wrong, but is this an import bug?
Offline
Re: [issue] WordPress import + Textile = bug?
Actually no, you are not doing anything wrong. The import script simply assumes that you want to have all your old posts textiled.
If you have access to phpmyadmin or something similar you can run the following query:
<code>UPDATE `textpattern` SET Body_html = Body, textile_body = 0</code>
This will turn off textile for all existing posts, and update the Body_html field to look exactly like the stuff you can see in the edit field.
Backup your db, just in case you don’t like ther results, or your server explodes. ;)
Offline
#3 2005-08-14 21:30:18
- sidesh0w
- New Member
- Registered: 2004-12-21
- Posts: 2
Re: [issue] WordPress import + Textile = bug?
Hey, Sencer—thanks for the superfast reply. You rock. :)
Yep—once I figured out that the content of my posts are stored in two different fields (<code>body</code> and <code>body_html</code>), it was pretty easy to do as you suggested.
I guess I’m wondering if that assumption the script makes is right in the first place; shouldn’t it check to see what you’ve set as a preference in the TxP admin?
Last edited by sidesh0w (2005-08-14 21:35:52)
Offline
#4 2005-08-17 17:23:30
- skinnylatte
- Member
- Registered: 2004-10-04
- Posts: 13
Re: [issue] WordPress import + Textile = bug?
I ran into the same issue, attempted what sencer recommended, and now all my posts don’t have linebreaks or formatting.
Is there any way to import wordpress entries without running into such markup weirdness?
Offline
#5 2006-02-23 23:40:51
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [issue] WordPress import + Textile = bug?
We need samples of export files in order to maintain Textpattern’s import feature.
Alex
Offline