[solved] Image Linking issue (1.5.1)

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Dipankar
Forum Members
Forum Members
Posts: 19
Joined: Wed May 09, 2007 4:51 am
Location: India

[solved] Image Linking issue (1.5.1)

Post 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
Last edited by Anonymous on Mon Oct 26, 2009 6:55 pm, edited 1 time in total.
Dipankar Banerjee
www.dbanerjee.com
Kolkata
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Image Linking issue (1.5.1)

Post 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
mr_compsci
New Member
New Member
Posts: 5
Joined: Thu Oct 23, 2008 1:47 pm

Re: Image Linking issue (1.5.1)

Post 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.
alby

Re: Image Linking issue (1.5.1)

Post 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
mr_compsci
New Member
New Member
Posts: 5
Joined: Thu Oct 23, 2008 1:47 pm

Re: Image Linking issue (1.5.1)

Post 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.
alby

Re: Image Linking issue (1.5.1)

Post 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
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: Image Linking issue (1.5.1)

Post 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...
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: Image Linking issue (1.5.1)

Post 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.
Last edited by fredp on Tue Aug 18, 2009 9:38 pm, edited 1 time in total.
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Image Linking issue (1.5.1)

Post 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
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: Image Linking issue (1.5.1)

Post by paulbaker »

That's great news RonnyK.  :D  I will look out for that release.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Image Linking issue (1.5.1)

Post 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...
fredp
Forum Members
Forum Members
Posts: 218
Joined: Sun Jul 27, 2008 1:36 am
Location: USA

Re: Image Linking issue (1.5.1)

Post 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.
Nearly all men can stand adversity, but if you want to test a man's character, give him power.
- Abraham Lincoln
User avatar
blast2007
Power Poster
Power Poster
Posts: 508
Joined: Wed Aug 01, 2007 5:36 pm

Re: Image Linking issue (1.5.1)

Post 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.
tonybatt
New Member
New Member
Posts: 9
Joined: Fri May 08, 2009 8:39 am
Location: Stevenage UK

Re: Image Linking issue (1.5.1)

Post 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/
User avatar
blast2007
Power Poster
Power Poster
Posts: 508
Joined: Wed Aug 01, 2007 5:36 pm

Re: Image Linking issue (1.5.1)

Post 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
Post Reply

Return to “Layout and Design (CSS & HTML)”