Close Menu
    Facebook X (Twitter) Instagram
    Trending
    • Satchel Pelts List for Red Dead Redemption 2
    • Create a Video Wall With FFmpeg
    • Mitsubishi Outlander Towbar Electrics
    • Mitsubishi Outlander Towbar Installation
    • Telephone Block List
    • Hard Drive Repair After Wrong Voltage Mishap
    • How To Send Excel Workbook As Email Using Button
    • Compare EV Chargers
    YouTube Instagram Facebook RSS
    Technology Spy
    • Tutorials & Help
    • Reviews
    Technology Spy
    You are at:Home»Development»SharePoint»How To Insert Rollup Images Into SharePoint XSLT
    SharePoint 2010 Logo

    How To Insert Rollup Images Into SharePoint XSLT

    0
    By Matt on October 9, 2014 SharePoint

    While modifying a webpart using a custom XSLT file I needed to include an image in the output. I did this by adding a “Rollup Image” column and then referencing it in the XSLT file. This column type is useful because it presents the user with an easy interface to select an existing image within SharePoint or to upload one from their computer.

    By linking to a custom XSLT file you can change the way the list items are displayed on the page.

    Within an XSLT file you can include references to the Rollup Image column by simply using :

    <xsl:value-of select="@PublishingRollupImage" disable-output-escaping="yes"></xsl:value-of>

    This will insert a fully populated IMG tag into your HTML :

    <img style="border: 0px solid;" alt="" src="/sites/mySite/PublishingImages/myImage.jpg" width="200" height="100" />

    However, you have to accept the form above. If  user inserts a large image into the list item then that image will be inserted into your page at its full resolution. What if you want to apply a different style or fix the image dimensions? That can be done by using the following alternative syntax :

    <img src="{substring-before(substring-after(@PublishingRollupImage,'src=&quot;'), '&quot;')}" alt="{@Title}" width="80" height="60" />

    This gives you more control over the IMG tab and allows you to add additional attributes. In the example above the width and height of the image can be specified so that it is displayed as expected regardless of the size of the source image. You can also add “id” and “style” attributes as required.

    Remember that if you are using an Announcements webpart the Rollup Image column must be added to the announcements list and also be included as a displayed column in the webparts current view.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleASUS M5A97 and Coolermaster Hyper 212 EVO PC Build
    Next Article SharePoint 2010 URL Tricks You Need To Know

    Related Posts

    SharePoint 2010 URL Tricks You Need To Know

    Leave A Reply Cancel Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    109

    Recent Posts
    March 24, 2025

    Satchel Pelts List for Red Dead Redemption 2

    January 29, 2025

    Create a Video Wall With FFmpeg

    May 24, 2024

    Mitsubishi Outlander Towbar Electrics

    Categories
    • 3D Printing
    • Android
    • Arduino
    • Development
    • ESP8266
    • Excel
    • Gaming
    • General
    • GIMP
    • Home Automation
    • JavaScript
    • Linux
    • Microsoft Office
    • Mobile Devices
    • Oracle APEX
    • Python
    • Raspberry Pi
    • Reviews
    • Security
    • SharePoint
    • Tutorials & Help
    • VBScript
    Web Tools

    A set of quick and basic online tools for web designers and software developers :

    • Hash Generator
    • Text to HTML List
    • Text to HTML Table
    • URL Encoder and Decoder
    • UNIX Timestamp Calculator
    • LED Resistor Calculator
    • Extract Email from Text
    • Mortgage Calculator
    Tags
    Android APEX Apple Arduino Black Friday Coolermaster csv Elite Dangerous email ESP-01 ESP8266 EV Excel file handling Format gaming GIMP Gritin Home Assistant Home Automation Linux lists Media os.stat os.walk Outlander Power Python Qi RDR2 Review scam Security SharePoint 2010 string Syncwire text text files TrueCrypt Ubuntu USB-C VBA VBscript Windows 10 Xbox One
    About

    Welcome to Technology Spy, a site devoted to gadgets, computers, programming and all things technology! You’ll also find product reviews for items I own as well as tutorials, guides and scripts for the software I use.

    Archives
    Other Resources
    • MattsBits
    • Raspberry Pi Spy
    YouTube Facebook Instagram Pinterest RSS

    Entries RSS | Comments RSS

    Copyright © 2025 - All Rights Reserved - Matt Hawkins

    mastodon.social@MattHawkins

    Type above and press Enter to search. Press Esc to cancel.