Page 1 of 1
CGSmartimage - use a %-ual operation?
Posted: Mon Feb 24, 2014 1:38 pm
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
Re: CGSmartimage - use a %-ual operation?
Posted: Mon Feb 24, 2014 2:20 pm
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="">
Re: CGSmartimage - use a %-ual operation?
Posted: Mon Feb 24, 2014 3:07 pm
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
Re: CGSmartimage - use a %-ual operation?
Posted: Mon Feb 24, 2014 3:19 pm
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.
Re: CGSmartimage - use a %-ual operation?
Posted: Mon Feb 24, 2014 7:51 pm
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
Re: CGSmartimage - use a %-ual operation?
Posted: Mon Feb 24, 2014 8:28 pm
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?
Re: CGSmartimage - use a %-ual operation?
Posted: Tue Feb 25, 2014 8:21 am
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?
Re: CGSmartimage - use a %-ual operation?
Posted: Tue Feb 25, 2014 8:28 am
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.