cgsi_getimages get image url

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
andrewvideouk
Forum Members
Forum Members
Posts: 156
Joined: Thu Aug 20, 2020 10:49 pm

cgsi_getimages get image url

Post by andrewvideouk »

Can some one help me please. I am trying to get a one image url from content or a variable. I have put notag and its still giving me a img tag. What am I doing worng,

output I would like http://site.com/picture.jpg

{cgsi_getimages imagesonly='1' notag='1' }{content}{/cgsi_getimages}

Thank you.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1825
Joined: Wed Feb 25, 2009 4:25 am

Re: cgsi_getimages get image url

Post by DIGI3 »

To get anything other than the tags you need to assign it:

Code: Select all

{cgsi_getimages assign='imageinfo' nocontent=1}{$content}{/cgsi_getimages}
Then you can cycle through the $imageinfo array:

Code: Select all

{foreach from=$imageinfo item=image}
  {$image.src}
{/foreach}
or access an image directly, 0 being the first, e.g.:

Code: Select all

{CGSmartImage src=$imageinfo[0].src noembed=1 max_width=640}
Not getting the answer you need? CMSMS support options
andrewvideouk
Forum Members
Forum Members
Posts: 156
Joined: Thu Aug 20, 2020 10:49 pm

Re: cgsi_getimages get image url

Post by andrewvideouk »

Thank you very much you are a life saver. I give it a try.
Post Reply

Return to “Modules/Add-Ons”