Mecha CMS

User guide.

Add Featured Image to a Page

To add featured image to a page, you need to install the broken link extension and broken link plugin.

  • Navigate to the page editor then click the Image tab.
  • Click the Image field to select an image file.
  • Determine the exact image width and height in the Width and Height field to automatically resize and crop the uploaded image. Leave it empty to keep the original image width and height.

![]()

The image data will be available in $page->image object so you can add this data to the template like so:

<?php if ($page->image): ?>
<img alt="" src="<?php echo $page->image; ?>">
<?php endif; ?>

To delete the uploaded image, go to the page editor then click the Image tab. Select the Remove field then click the Update button at the bottom of your page editor.

![]()