I would recommend adding a File field to your Channel, and possibly an Image Manipulation for the resized version. Then you won’t be using a plugin or PHP to try to perform regex on a string. The output would be as simple as:
Full size:
{news_image wrap="image"}
With a “Small” constraint defined:
{news_image:small wrap="image"}
And simply omit this variable from your tags when you don’t want it to appear.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.