Jump to content

Display not-editable image in the backend


lenoir
 Share

Recommended Posts

Hi,

I wonder if there's a way to display an image in the backend, to help fill out some fields. In this particular case, I want do display a map of buildings with all entries numbered, so the client can look up the number in the image and select the right entry from a dropdown menu.

Thank you!

Link to comment
Share on other sites

Or a simple hook to modify the page edit form 🙂 

<?php
$wire->addHookAfter("ProcessPageEdit::buildFormContent", function($event) {
  $page = $event->process->getPage();
  if($page->template != 'yourtemplate') return;
  $form = $event->return;
  
  $f = $this->wire(new InputfieldMarkup());
  $f->label = 'Help';
  $f->icon = 'picture-o';
  $f->value = "<img src='https://via.placeholder.com/350x150'>";
  $form->insertAfter($f, $form->get('title'));
});

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...