Skip to content

Module · Veva.Modules.Assets

Upload once, fit anywhere.

One media library for every file on the site. Folders give files stable /library/ addresses, and each image is resized, cropped and sharpened on the server for the place it appears.

dotnet add package Veva.Web.Essentials

What it does

Every file, one library.

Folders are addresses

A folder's alias puts its files at /library/folder/file. The permanent link, /library/?itemid=, never changes.

Images sized on request

Add width, fit, cover, crop or sharpen actions to an image's address and get that version back.

Rules per folder

A folder can accept one file type only, and run an image procedure on every image uploaded to it.

Focus points

Save a focus point on an image, so crops keep what matters.

Metadata, handled

EXIF and IPTC are read into the library. Processed images leave GPS and other metadata out.

Stock photos

The Unsplash and Pexels modules add a tab to the Add Content dialog, so editors pick photos in place.

How it works

From an upload to the right size.

  1. 01

    Upload

    In the admin, from a url, from Unsplash or Pexels, or over MCP.

  2. 02

    File it

    The folder's alias, file type and image procedure apply.

    Image procedure
  3. 03

    Ask for a size

    Add actions to the address, such as &action=cover:800x800.

    /library/?itemid=
  4. 04

    Made once

    The server makes that version on its first request and keeps it.

  5. 05

    Place it

    In an Image component, or as {image.FriendlyUrl} in a document.

For developers

Image addresses in your components.

IAssetUrlService builds the address of an asset at the size you need, from a property or from a document field in the data binding.

Extension points

API

Change how images are made or where files come from. In Veva.Modules.Assets.Domain:

  • IImageProcedureStepHandler: one step of an image procedure
  • IActionParser: turns URL actions into steps
  • IMetaDataService: reads metadata from files
  • IAssetSource: a source of files in the Add Content dialog
Photo.razor
@inject IAssetUrlService AssetUrls

<img src="@ImageUrl()" alt="@Image?.Description" loading="lazy" />

@code {
    [EditorBrowsable, Parameter, DisplayName("Image")]
    public AssetProperty Image { get; set; }

    // 800px wide, lightly sharpened
    private string ImageUrl() =>
        Image?.AssetId is Guid id && id != Guid.Empty
            ? AssetUrls.GetAssetUrl(
                id, 800, null, ResizeMode.Fit, SharpenStrength.Light)
            : null;
}

Keep reading

Guides for this module.

All articles

Guide

Image actions

Resize, crop and sharpen images through their address.

Read the guide

More of Veva

Explore the other modules.

Each one is a package. Reference it, restart, and its components are in the editor.

All modules

Page builder

Compose pages from components, then preview and publish

Open

Documents

Structured content you list, filter and serve anywhere

Open

Search

Crawl, index and search the whole site

Open

Veva core

BuildVeva(), modules, components, themes and hooks

Open

Integrations

Data sources, sign-in, mail, analytics and media

Open

Type to search the docs, components and API.

↑↓ to move ↵ to open Esc to close Search by Veva