Active
Project:
Wordpress Import
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2009 at 17:18 UTC
Updated:
16 Jul 2010 at 13:22 UTC
If a user had a caption in their blog entries, wordpress's caption code is printed on the page and is not addressed on import.
See screenshot.
| Comment | File | Size | Author |
|---|---|---|---|
| Screen shot 2009-11-28 at 9.20.40 AM.png | 137.58 KB | kmonty |
Comments
Comment #1
lavamind commentedLooks to me like we would have to imitate the way Wordpress itself handles those captions and modify the body. But since this process probably depends on some user-defined settings, I'm not sure that would be the best way...
Comment #2
lavamind commentedFurthermore, this and the video tags, should be things translated at the moment of exporting, by Wordpress, not when importing...
Comment #3
kmontyI started a new project to help with this: http://drupal.org/project/caption_filter
I'll write some script to handle converting the existing code to this method.
Comment #4
kmontyComment #5
lavamind commentedLet me know when the module has a public release so I can document it.
Comment #6
kmontyI actually found some bugs in it that I won't have time to fix until after the holiday, so I didn't commit to CVS. I'll let you know as soon as I get it committed.
Comment #7
kmontyJust to update, I released a version of Caption Filter but it isn't in the same format of Wordpress.
Wanted to relate this to #739798: Using Caption Filter to migrate captions from Wordpress
Not sure what queue this thread belongs in.
Comment #8
Melissamcewen commentedKmonty's filter is nice to duplicate the functionality of captions in Wordpress, but it would be much nicer to just get rid of the [caption] altogether upon import.
Comment #9
lavamind commented@Melissa M: Getting rid of [caption] would indeed be great but the problem is determining the appropriate markup to generate. If you have any ideas on this, please share.
Comment #10
Melissamcewen commentedI love Kmonty's module, which turns it into a div with a class that's "caption" so I can style it as such. It's really too bad it doesn't work with the markup on the wordpress sites I've had to import which is [caption ="blahblahblah"] rather than [caption=blablahblah]
Comment #11
kmontyWordpress's caption code is not simple and therefore far to difficult to use. Someone just needs to write some migration regular expressions and it is done.
Comment #12
lavamind commentedIn the Wordpress [caption] tag, what attributes to we need to migrate? Only "align" and "caption" ?
Comment #13
grasmash commentedI wanted to get rid of all of the caption tags without getting rid of their contents, so I did this:
ran a find and replace with this regex (replacing with empty string) to remove all "[caption with-anything-here]":
\[caption([^\]])*\]
then ran a literal find and replace to get rid of all "[/caption]"
you could also run a find and replace with this regex to get rid of all caption tags, including their contents:
\[caption.*\[\/caption\]
Comment #14
mattiasj commentedIt would be great to have the option before importing to totally strip all [captions], it would be great in some cases!