Strip Image_Assist filter tags from description when set automatically from teaser

WildBill - November 7, 2009 - 00:15
Project:Nodewords
Version:6.x-1.x-dev
Component:Third-party modules integration
Category:feature request
Priority:normal
Assigned:Unassigned
Status:fixed
Description

Thanks for adding the "Use node teaser if the description meta tag is not set" feature back in. Would it be possible to strip out the tags that are added by Image Assist? They look like this:

[img_assist|nid=24|title=Christopher Columbus and the natives|desc=|link=popup|align=left|width=340|height=259]

If you add an image near the top of your post (and it fits within the teaser) then it makes the description meta tag very ugly.

Thanks!

#1

kiamlaluno - November 7, 2009 - 10:29
Status:active» postponed (maintainer needs more info)

Are those tags added by the module automatically, or are they the input of the user?

Thanks for bringing this out.

#2

WildBill - November 10, 2009 - 01:08

They are added automatically by the module, when the user adds an image to a node. The tag and the rest of the body are saved in the Body field.

#3

WildBill - November 10, 2009 - 01:08
Status:postponed (maintainer needs more info)» active

#4

kiamlaluno - November 10, 2009 - 08:47

Thank for the information, WildBill.

It should be enough to find a matching with /\[img_assist.*\]/i, and replace it with an empty string.

#5

kiamlaluno - November 10, 2009 - 09:14
Version:6.x-1.3-beta5» 6.x-1.x-dev
Status:active» fixed

The code has been changed, and committed in CVS.

Thanks again for your help.

#6

WildBill - November 10, 2009 - 23:27

Cool, thanks Kiam.

#7

VSZ - November 16, 2009 - 08:16
Status:fixed» active

The same problem with Image Browser v2 code.
It appears in automatically generated description as

[ibimage==5778==thumbnail==preview==blank==ibimage_right]

#8

kiamlaluno - November 16, 2009 - 14:22
Status:active» fixed

I will open a different issue for this case (see #634106: Strip the text added by Image Browser).

#9

WildBill - November 17, 2009 - 16:35

I wonder if it would be worth creating a field in the admin settings, so that ALL of these tags could be omitted. Something like a "Strip content which matches the following pattern" or something like that. Then the user could enter [img_assist*] on one line, and then [ibimage*] on another line, and the asterisk would act as a wildcard of course. Not sure how difficult that would be though.

#10

kiamlaluno - November 17, 2009 - 19:20

It should not be too difficult, and it would make sense.
I think that to consider users who don't want to bother by knowing the details, the settings should contain an option for the known text to filter, and an option for a custom regular expression for advanced users.

#11

kiamlaluno - November 17, 2009 - 19:32
 
 

Drupal is a registered trademark of Dries Buytaert.