Bulk replace content inline hyper link as CCK link field
Submitted by hswong3i on Fri, 2010-03-26 00:34
I have a Drupal site that need to replace some content inline hyper links as CCK link field. The reason is: link field is more simple and user-friendly for my client, which don't need the BUeditor to input the link into content.
So simply:
- Add new link field (e.g. "field_link" within this example) for the existing content type (e.g. "newslink" within this example)
- Use Devel and run the following code snippet, which loop though all target content, parse the hyper link, and insert it into link field
- Activate the autonodetitle, so replace the node title with field_link's title
- Also hide the body of this content type
- Update the Views will corresponding changes
NOTE: always backup database before critical hack :P
- hswong3i's blog
- 1305 reads


Add new comment