Widget to add an image and link in SP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 08:54 AM
Hi guys,
I want to create a widget where you can browse for an image and it will be added onto the panel and also an option to add a link wrapping the image. I fiddle around with widget options schema but couldn't get it working and wondered if this was the way to go about it?
Many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2017 02:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2017 02:39 PM
Did you find it?
It will help to me if you know.
Thanks.
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2017 02:30 AM
Hi Diego,
Not sure if the approach I took was the most elegant, but since you asked here's what I did to achieve the results I was after.
1. Create a new widget or clone the existing icon link widget.
2. Add two new options schemas, one for the image URL and the other for the link. In my case both of them were strings.
3. Bind the data to the HTML
<div>
<h3>{{::options.title}}</h3>
<a href="{{::options.imglink}}" target="_blank">
<img src="{{::options.testimg}}" alt="" />
</a>
</div>
As you can see, since the link to the image is a string you will have to upload the image to servicenow first and then copy the filename with extension and paste into the imagelink instance option. This work as expected for me. Let me know if you have any questions.