Now, I only need to display the picture and ignore the text, so I have to get the image URL.
Because the image isn't uploaded by the upload picker, I can't using umbraco.library:GetMedia() to get the image URL. How to get the image URL from CDATA section? Thank you!
Is there any specific reason why you want to fetch the image only from at rich text editor? Why don't you just use a media picker? What is your use case for doing it like mentioned above?
If you want to do it the hard way I think you can benefit from reading through this article by Chriztian Steinmeier http://pimpmyxslt.com/articles/wysiwyg/ - This sound like the thing you're after. But I'm still curious as to why you want to do it that way :)
Hi, Jan, Thank you for your help. It works! Actually, when a writer inserts a image into RichTtext Editor, I need to fetch the image and show it in the photo slider like this:
For website visitors, they can visit the article page by clicking on the photo slider. If I use a media picker in the backoffice, the writer will feel confused. They have to point the article preview photo after they already inserted the photo in RichText Editor. I just want to make it easy and quick for the writer.
Thank you for your help again and Happy New Year 2013!
How to get the image URL from CDATA section
Hey,
I insert a image into the Richtext Editor(alias: articleContents), after I published the article, in umbraco.config file, the XML node like this:
Now, I only need to display the picture and ignore the text, so I have to get the image URL.
Because the image isn't uploaded by the upload picker, I can't using umbraco.library:GetMedia() to get the image URL. How to get the image URL from CDATA section? Thank you!
Hi Doing1024 and welcome to our :)
Is there any specific reason why you want to fetch the image only from at rich text editor? Why don't you just use a media picker? What is your use case for doing it like mentioned above?
If you want to do it the hard way I think you can benefit from reading through this article by Chriztian Steinmeier http://pimpmyxslt.com/articles/wysiwyg/ - This sound like the thing you're after. But I'm still curious as to why you want to do it that way :)
/Jan
Hi, Jan, Thank you for your help. It works! Actually, when a writer inserts a image into RichTtext Editor, I need to fetch the image and show it in the photo slider like this:
For website visitors, they can visit the article page by clicking on the photo slider. If I use a media picker in the backoffice, the writer will feel confused. They have to point the article preview photo after they already inserted the photo in RichText Editor. I just want to make it easy and quick for the writer.
Thank you for your help again and Happy New Year 2013!
Hi doing1024
I agree that the less the editor needs to worry about the better - from what you describe above this seems like a very elegant solution :)
Remember to mark the post as solved so others can quickly go to the post with the solution.
Happy new year to you as well and happy umbracoing :)
/Jan
is working on a reply...