Standard Image extends the functionality of the native HTML <img> tag. Notable features include automatic reduction of the size of the image served to the client, and the ability for images to maintain their original aspect ratio.
Alternative text description of the image used for screen readers and SEO.
- `height`
string
Height
Sets the height of the element. The default units are pixels. include the percentage symbol % to user percentage values.
- `id`
string
Give this control a unique id. Can be accessed in the client DOM (eg, document.getElementById('myid') or in the server DOM using [? $myid ?] or [? $('myid') ?]).
- `imagePosition`
string
Image Position
Controls the position of the image within its bounds when maintainaspect="crop" is set. Accepts CSS position values such as "center center", "50% 50%", "left top", etc.
Default = "center center".
- `maintainAspect`
string
Maintain Aspect
How the image should respond if the width and height set are a different ratio to the image's natural size.
true - The image will shrink to avoid distortion.
false - The image will obey the width and height, and possibly distort.
"crop" - The image will obey the width and height, and will allow cropping to avoid distortion.
Default = true.
- `src`
string
Image Source
The source / location of the image.
- `width`
string
Width
Sets the width of the element. The default units are pixels. include the percentage symbol % to user percentage values.
- `float`
string
Whether to float the image left or right. Default = "". Possible other values: "left", "right".
- `floatOffset`
string
If this image is floating inside a paragraph, by using the float attribute, floatoffset controls the distance of the image from the top of the paragraph.
- `lazy`
string
Lazy Loading
Controls when this image loads.
"auto" - The image will lazy load only when it does not have a fixed width or height.
"defer" - The image will load once the rest of the page has loaded.
"inview" - The image will load when it is about to appear on screen.
"0" - The image will load immediately.
Default = "auto".
- `modalCaptionDescription`
string
Modal Caption Description
Description that will be revealed when the image is included in a modal.
- `modalCaptionTitle`
string
Modal Caption Title
Caption Title that will be revealed when the image is included in a modal.
Tutorials
Take advantage of Oncord's automatic image resizing, cropping and thumbnail generation.
Using the <standard:image /> control
The <standard:image> control can be used as a general replacement for the standard HTML <img
/>
tag in most situations, to introduce some additional functionality.
Using the <standard:image> control to generate appropriately sized image thumbnails can
drastically reduce account bandwidth usage, and help to improve website page speed.
When the src attribute of this control references an image uploaded to the website, Oncord will generate a thumbnail at the dimensions
of the width and height attributes
specified. So where an admin has uploaded overly large images to the website, a smaller thumbnail can be generated and used instead.
Common attributes:
Src - The location of the image. This should be referenced relative to the
website root domain. For example; src="/media/website_pages/about-us/img1.jpg".
Width - The width of the image in pixels. Do not include 'px'. For example;
width="200", rather than width="200px".
Height - The height of the image in pixels.
Again, do not include 'px'.
All other attributes of the standard html <img> tag also work - such as alt, title,
class, id and style.
Where an image thumbnail is generated, the maintainAspect
attribute controls whether the aspect ratio of the image is maintained.
The available values are "crop", "true" and "false" (default: true). When this attribute is set to crop,
the image will be cropped to that of the smallest dimension while maintaining aspect ratio.
Basic Example:
<standard:image src="/media/website_pages/about/boat.jpg" title="Boat Sailing" alt="A boat sailing on the open sea" width="300" height="300" maintainaspect="true" />
In the below examples, the 1459px by 1094px image boat.jpg
is being resized with width="245"height="245"
using the different aspect ratio settings.
MaintainAspect="true"
The image is scaled down proportionally.
MaintainAspect="false"
The image is squished to both dimensions.
MaintainAspect="crop"
The larger dimension is cropped.
100% Width Images
Images often need to be shown at 100% width, overriding what has been set within the width attribute in order to generate a thumbnail. In
that case, you can use the style attribute to set the width or height appropriately:
You can also generate an image thumbnail using the API, for those times when an <img /> tag is not appropriate. For instance, you
might want to generate a thumbnail for use in a style attribute or custom jQuery gallery.
Oncord's UI Controls API includes a pre-built rotator, which helps reduce development time, while providing users with an
improved experience updating content via the visual editor.
Some notable features of the Oncord rotator:
May be placed and configured via the visual page editor.
Supports html content and other Oncord UI controls such as sections, not just images.
Supports YouTube videos, where videos are stopped between slides.
Customize the rotator controls with your own images or icons.
Supports responsive content.
Customize the transition time and effect to be used between slides (slide or fade).
Show multiple content items per slide (eg. 4 testimonials per slide).
Introducing The Rotator UI Control
You can add a rotator to a website page or design through use of the <layout:rotator> UI Control.
Alternatively, a rotator can be added to the page via the visual editor. Click "Insert" on the left-hand side of the screen while
editing a website page, and drag-and-drop a "Rotator" element into position on the page.
In order to take advantage of all the features and possibilities of the rotator UI control, take note of all the "Attributes"
available in the API reference here.
The <layout:rotator> control can handle any standard content. Each direct child of the rotator will be turned into its own slide.
The rotator includes standard next / previous controls, however you can alternatively add custom links instead.
Place your custom navigation elements within links that are assigned with unique IDs.
Add the attributes moveNextId and movePreviousId to the <layout:rotator> control, where the IDs that you provide correlate
to the IDs used by your next / previous buttons.
Set the attributes arrowVariant="none" minimapVariant="none", to remove Oncord's default rotator navigation elements.