CGSmartimage - use a %-ual operation?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
map_1961
Power Poster
Power Poster
Posts: 410
Joined: Fri Apr 20, 2007 7:26 pm

CGSmartimage - use a %-ual operation?

Post by map_1961 »

Hi. We start to work with CGSmartimage in order to make pictures responsive.
In the help section we found: "... the module will look in its database for information about the maximum resolution of the requesting device. If that information cannot be found a remote web service will be queried for the resolution information. If suitable information can be found then the max_width and max_height parameters will be adjusted to rescale the image.

We tried to use the following tag to call the module:
{CGSmartImage src='uploads/images/news/Center-News/2014/1920x1080_DSC_0222.jpg' width='100%'}
...but it accepts no width='100%' .

Who knows how to use the module in order to scale the requested image to - for example - 90% of the content container size?

Thx x 1.000


MAP_1961
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: CGSmartimage - use a %-ual operation?

Post by JohnnyB »

Can you try using the parameter that just generates the URL and assign= to a variable?

Then you can use a regular image tag:
<img src="$TheImage" width="100%" alt="">
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
User avatar
map_1961
Power Poster
Power Poster
Posts: 410
Joined: Fri Apr 20, 2007 7:26 pm

Re: CGSmartimage - use a %-ual operation?

Post by map_1961 »

JohnnyB wrote:Can you try using the parameter that just generates the URL and assign= to a variable?

Then you can use a regular image tag:
<img src="$TheImage" width="100%" alt="">
Thx JohnnyB: we tried so. As soon as we use a piture call the way u proposed (regular image tag) cgsmartimage recognizes and changes the imput of 100% into 100pixels.

Thx anyway to be so kind to answer and think about a solution!

map_1961
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: CGSmartimage - use a %-ual operation?

Post by velden »

(optional) notag="" - Do not output an img tag, only the url to the cached image. This has no effect when CGSmartImage is used from within a stylesheet.

Code: Select all

<img src="{CGSmartImage notag="1" ... }" width="100%" ...>
That's what JohnnyB meant I think.
User avatar
map_1961
Power Poster
Power Poster
Posts: 410
Joined: Fri Apr 20, 2007 7:26 pm

Re: CGSmartimage - use a %-ual operation?

Post by map_1961 »

velden wrote:
(optional) notag="" - Do not output an img tag, only the url to the cached image. This has no effect when CGSmartImage is used from within a stylesheet.

Code: Select all

<img src="{CGSmartImage notag="1" ... }" width="100%" ...>
That's what JohnnyB meant I think.
Hi velden. We tried to solve like this. But using this hint no more use of the wysiwig editor is possible. This can not be a solution because few people are ablte to work on content in source code.

Thx so far and for your all effort...

MAP_1961
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: CGSmartimage - use a %-ual operation?

Post by velden »

I don´t understand you±
We tried to use the following tag to call the module:
{CGSmartImage src='uploads/images/news/Center-News/2014/1920x1080_DSC_0222.jpg' width='100%'}
...but it accepts no width='100%' .
What´s the difference? That code is not what you want your editors to add manually too isn't it?
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: CGSmartimage - use a %-ual operation?

Post by paulbaker »

I think OP means the solution works technically but is not suitable because his editors wouldn't be able to implement the code change, he prefers a WYSIWYG solution?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: CGSmartimage - use a %-ual operation?

Post by velden »

paulbaker wrote:I think OP means the solution works technically but is not suitable because his editors wouldn't be able to implement the code change, he prefers a WYSIWYG solution?
I'm not aware of an WYSIWYG implementation of CGSmartImage other then {cgsi_convert} which OP does not mention.
Locked

Return to “Modules/Add-Ons”