Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

No external hosted images in TinyMCE? :-(


Go to End


12 Posts   34061 Views

Avatar
dio5

Community Member, 501 Posts

17 December 2007 at 6:32am

I think this is a major flaw/bug, but it seems that the TinyMCE in the cms doesn't
allow embedding of images that are hosted externally?

Try to paste this code in the html-mode of the SS TinyMCE and save:

<a href="http://www.flickr.com/photos/dieterorens/2055245161/" title="Untitled by dio5, on Flickr"><img src="http://farm3.static.flickr.com/2184/2055245161_e8b3519dff_m.jpg" width="240" height="161" alt="" /></a>

You end up with an image that doesn't have a src-attribute in the TinyMCE, and an empty src on the frontend.

Why isn't there an option to choose external embedding. Now it seems we can only use images that are on the same site. And who doesn't include flickr-images??

This is pretty critical for me. The thing I'm building is for someone who's used to wordpress. Wordpress easily allows this, has YouTube embedding (no I don't want the widget/module.. ) etc...

How can I explain this to him? Not being able to include flickr imagelinks is quite incomprehensible...

Avatar
Tim

Community Member, 201 Posts

17 December 2007 at 10:03am

The Flickr gallery module may be what your after.

- Tim

Avatar
dio5

Community Member, 501 Posts

17 December 2007 at 10:16am

Edited: 17/12/2007 10:17am

No, that's not what I'm after, thanks.

I just want to be able to insert an image that's not uploaded in SS and not in the uploads folder, whether it's from flickr or whatever.

I just found out a very dirty hack that does the trick:

Comment out line 220 of HTMLEditorField.php.
like this:

else {
		//$parts[$partSource['src="']] = "";
	}

Now it doesn't reset other urls to "".

Of course this is not a very sound way, because it still allows resizing in the content field, etc that won't work...

There should be a way to just include/embed an external image. I think this is just forgotten and I hope this will be tackled in the upcoming version.

Now I got to find out why and where it strips out empty alt attr's.

Avatar
dio5

Community Member, 501 Posts

17 December 2007 at 11:28am

Couldn't immediately find where empty alt-attributes are stripped, so I just added something to HTMLEditorField, right before the return statement:

if(strpos($result, "alt=") === false)
{
      $result = substr_replace($result, ' alt="" />', -2);
}

Now the code is also clean when people don't fill out the description field when inserting 'local' images.

Avatar
Fuzz10

Community Member, 791 Posts

20 December 2007 at 3:36am

Thanks for the hacks ... Need them also ..

It seems that only once (end)users are really starting to work with SS, these little bugs get filtered out..

I didn't even notice it myself, a client had to point it out.

Avatar
Sam

Administrator, 690 Posts

10 January 2008 at 3:43pm

Thanks, dio5. I've committed the patches that you suggested to trunk.

In time, we may have better support for external images, so that, for example, the image dialog knows how to handle them. But for now, the changes you made to the job.

You can see the change here: http://open.silverstripe.com/changeset/47827

It will make its way into 2.2.2.

Avatar
stigm

Community Member, 1 Post

29 February 2008 at 11:47am

This is a nightmare... Not only is there no external hosted images in SS, I cannot sensibly add images to content without the images becoming links to a 'full size' version of the image. This happens when there is no resizing of the image done at all.

Also when someone right clicks on an image they can edit the image using the traditional TinyMCE popup and not the rhs SS image tab - where they are presented with a bizzare set of details like:

Image URL: assets/Uploads/Custom-Page-Resources/12-2.jpg?r=556
Alignment: --not set--
Vertical space: nul
Horizontal Space: nul

The image HAD alignment which is now lost.

I am trying to finish a SS CMS driven site to present to the client next week for them to start putting content live - but at this stage it will just turn into a big nasty image mess!

Someone needs to redesign the entire image tab system to something that actually works... My ass is on the line here! This is a test case for using SS as the in-house CMS for small projects.

Please SS fix this so we can use SS CMS!

Avatar
Fuzz10

Community Member, 791 Posts

5 March 2008 at 12:45am

Edited: 05/03/2008 1:05am

The resize functionality is indeed broken. Resizing images used in the TinyMCE content just doesn't work through Internet Explorer. It's very hard to explain that to customers.

In FireFox all is good by the way.

Go to Top