Page 1 of 2

[solved] Image Linking issue (1.5.1)

Posted: Thu Mar 12, 2009 8:16 pm
by Dipankar
It might sound funny,

In CMS Made Simple 1.5.1, how can we hyper link a image to a target cmsms page... In the earlier I use to use " [glow=red,2,300]Insert Link to cmsms page[/glow]" (orange colored tree) to hyper link a image to a cmsms page, but in CMS Made Simple 1.5.1 I get some additional unwanted text once I use " Insert Link to cmsms page"....

Any help in this regard will be highly appreciated...

Thanks

db

Re: Image Linking issue (1.5.1)

Posted: Thu Mar 12, 2009 9:02 pm
by RonnyK
Current stable is 1.5.3.

Could you check what happens in that release, as changes have been made in the later versions...

Ronny

Re: Image Linking issue (1.5.1)

Posted: Mon Apr 06, 2009 2:26 am
by mr_compsci
I am experiencing the same problem with 1.5.3.  The CMS Self Link option doesn't work on images.  It takes an image tag and converts it into something like this:

Code: Select all

{cms_selflink page="home" text="<img style="width: 300px; height: 33px;" src="uploads/headline_welcome.gif" alt="" />"}
When I save the page and view it, Smarty complains:
string(131) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: 'right;' (Smarty_Compiler.class.php, line 1547)" string(137) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: 'margin-left:' (Smarty_Compiler.class.php, line 1547)" string(130) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: '15px;' (Smarty_Compiler.class.php, line 1547)" string(138) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: 'margin-right:' (Smarty_Compiler.class.php, line 1547)" string(271) "Smarty error: [in content:content_en line 1]: syntax error: invalid attribute name: '15px;" src="uploads/images/PerformanceBlockFP2009-NOB.jpg" alt="" width="260" height="360" />
I'd guess that this is because the attributes in the image tag aren't escaped.   I don't recall having this issue before, but I'm not sure I ever tried making an image into a link to a internal page before.

Re: Image Linking issue (1.5.1)

Posted: Mon Apr 06, 2009 7:07 am
by alby
mr_compsci wrote: I am experiencing the same problem with 1.5.3.  The CMS Self Link option doesn't work on images.  It takes an image tag and converts it into something like this:

Code: Select all

{cms_selflink page="home" text="<img style="width: 300px; height: 33px;" src="uploads/headline_welcome.gif" alt="" />"}
When I save the page and view it, Smarty complains:
You can use

Alby

Re: Image Linking issue (1.5.1)

Posted: Mon Apr 06, 2009 1:50 pm
by mr_compsci
Sure, that works, but is this a bug and will it be fixed?  Some of my users are only comfortable with the WYSIWYG editor (isn't that the point of a CMS?) and won't be willing to try using smarty tags.

Re: Image Linking issue (1.5.1)

Posted: Mon Apr 06, 2009 4:08 pm
by alby
mr_compsci wrote: Sure, that works, but is this a bug and will it be fixed?  Some of my users are only comfortable with the WYSIWYG editor (isn't that the point of a CMS?) and won't be willing to try using smarty tags.
Then I have not problem with correct quotes:
{cms_selflink page='home' text=''}

Alby

Re: Image Linking issue (1.5.1)

Posted: Sun Jun 07, 2009 7:37 pm
by paulbaker
I agree with mr_compsci.  I have the same trouble too.  Let me explain what happens when I try to make an existing image a cmsms link:

Open the page to edit content.
Single click the image I want to link.
Image shows with "squares" around it.
Click orange link icon (horse).
Select page I want to link to.
Text {cms_selflink page="class-6m" text=" appears before link and text "} appears after link.
Click apply button.
In the site I get an error message before the image, which does correctly link:
string(158) "Smarty error: [in content:content_en line 3]: syntax error: invalid attribute name: '1-2" width="300" height="212" />"' (Smarty_Compiler.class.php, line 1547)"

This is the HTML for the part that is causing the error:

{cms_selflink page="class-6m" text=""} 

Yes, alby, I can edit the HTML in the way that you show and the problem is resolved.  But, as mr_compsci says, lots of users are not capable of doing that...

Re: Image Linking issue (1.5.1)

Posted: Fri Jun 12, 2009 7:33 pm
by fredp
mr_compsci wrote: Sure, that works, but is this a bug and will it be fixed?  Some of my users are only comfortable with the WYSIWYG editor (isn't that the point of a CMS?) and won't be willing to try using smarty tags.
I agree, the WYSIWYG editor is crucial for many users.  The more smoothly integrated CMSMS and TinyMCE are, the better.

The problem appears in 1.5.4, as well. It looks like a bug. As an experiment, I modified TinyMCE.module.php to use single quotes around cms_selflink's text= argument, instead of double quotes.  That seemed to resolve the problem in my test case.  Although, I suspect it might be prudent to also escape single quotes in the selected text argument string, in case it contains single quotes.

I'll submit a bug report.

Edited: changed term 'parameter' to 'argument' for clarity.

Re: Image Linking issue (1.5.1)

Posted: Fri Jun 12, 2009 7:46 pm
by RonnyK
I just checked in the 1.6 release and do NOT get the error... After inserting an image, and then selecting the image, for a link to a CMSMS page, the link is inserted, and working....

Better check in the 1.6 release, which is to be released at 15-16 june.

Ronny

Re: Image Linking issue (1.5.1)

Posted: Fri Jun 12, 2009 9:41 pm
by paulbaker
That's great news RonnyK.  :D  I will look out for that release.

Re: Image Linking issue (1.5.1)

Posted: Sat Jun 13, 2009 9:06 pm
by Dr.CSS
The problem is that the self_link uses {cms_selflink} style, go to tiny admin and the advanced tab and change the self link to style and it will use the image instead of the text of image link to make a link...

Re: Image Linking issue (1.5.1)

Posted: Sun Jun 14, 2009 6:30 am
by fredp
mark wrote: The problem is that the self_link uses {cms_selflink} style, go to tiny admin and the advanced tab and change the self link to style and it will use the image instead of the text of image link to make a link...
Hi Mark,

Thanks for the post!  I was under the, probably false,  impression that the style was a "legacy" style and that {cms_selflink} style was the new/preferred way to go. I hadn't thought to try style to see if it behaved differently. I now see that the style user interface will be much more familiar to my client. Since this solves a couple of my concerns at once, I'll stick with it and see how far I can get.

Thanks again,
Fred P.

Re: Image Linking issue (1.5.1)

Posted: Wed Jul 01, 2009 8:41 am
by blast2007
I think the main issue of  function.cms_selflink.php between 1.5.4 and 1.6 iis that in 1.6 release there's these lines
345

Code: Select all

$label = cms_htmlentities($label);
361

Code: Select all

$title = cms_htmlentities($title);
439

Code: Select all

$linktext = cms_htmlentities($linktext);
not present in 1.5.4 version.
All text in selflink is html escaped.

Re: Image Linking issue (1.5.1)

Posted: Sat Aug 01, 2009 1:29 pm
by tonybatt
Blast2007 you are truly a man amongst men.

I have a site in development and after upgrading to 1.62 all  my rollover faded image links turned to a bunch of text,
i removed the 3 lines you flagged up and we are rolling now to upgrade the online version

Thank you

Test site is http://www.daviesbatt.co.uk/cavendish/

Re: Image Linking issue (1.5.1)

Posted: Sat Aug 01, 2009 10:16 pm
by blast2007
tonybatt wrote: Blast2007 you are truly a man amongst men.
:o

There is an open bug for this issue.
We hope it will receive a reply from dev members.

regards
blast