Image block options

We offer you a certain block of the type image, for dedicated image areas in your page.

Basic image block

This basic image block gives you an editable image as an <img> tag in your HTML.

<?php $scms->image("containerName",[]]);?>

Only JPG/GIF/PNG images are allowed to be uploaded

Background image block

If you want to attach a background image to a div, you can use this option. SingleCMS then renders a style="background-image: url('...'); into your div.

<div id="sideImage" <?php $scms->image("containerName",["backgroundImage"=>true]]);?>>

Please set all your custom styles and classes via the options of the block (see below), because if you specify it outside of the block in the HTML tag missmatches can occur and options may be lost

Users

Per default only the admin account is allowed to edit the data of the blocks. To also allow other users, you can use the following block syntax

<?php $scms->image("containerName",["users"=>["noAdminUser","user2"]]);?>

You can define as many users as you want. The users do not already have to be created in the backend. Just insert them here and create them later.

Class

If you want to style the block in a certain way, SingleCMS provides you with the option to attach classes to the blocks

<?php $scms->image("containerName",["class"=>"class1 class2"]);?>

Style

If you want to style the block in a certain way, SingleCMS provides you with the option to set you style to the image.

<?php $scms->image("containerName",["style"=>"width:60%;"]);?>

Last updated