Admin Images Shortcode


I’m trying to upload images to be used on Simple Pages via the Admin Images plugin. I’ve successfully uploaded one photo, and in the Admin Images plugin it specifically instructs:

If you are creating a simple page or otherwise entering HTML into omeka through your browser, you can use the shortcode "[admin_image id=999,size='fullsize']" to display your admin image.

So, I inserted the following shortcode into the body of one of our Simple Pages:

[admin_image id=1,size='fullsize']

But now when I try to view the page, I see this very lengthy error message:

Notice: Undefined index: id in /srv/sftp-chroot/classes/lis-462-ol-fa19/omeka-2.7/plugins/AdminImages/helpers/AdminImageFunctions.php on line 5

Notice: Trying to get property 'id' of non-object in /srv/sftp-chroot/classes/lis-462-ol-fa19/omeka-2.7/plugins/AdminImages/views/helpers/AdminImageTag.php on line 9

Fatal error: Uncaught Error: Call to a member function getUrl() on null in /srv/sftp-chroot/classes/lis-462-ol-fa19/omeka-2.7/plugins/AdminImages/views/helpers/AdminImageTag.php:10 Stack trace: #0 /srv/www/ AdminImages_View_Helper_AdminImageTag->adminImageTag(NULL, 'fullsize') #1 /srv/sftp-chroot/classes/lis-462-ol-fa19/omeka-2.7/plugins/AdminImages/helpers/AdminImageFunctions.php(5): Zend_View_Abstract->__call('adminImageTag', Array) #2 /srv/www/ admin_image_tag_shortcode(Array, Object(Omeka_View)) #3 [internal function]: Omeka_View_Helper_Shortcodes->handleShortcode(Array) #4 /srv/www/ preg_replace_callback('/\\[(\\w+)\\s*([^\\...', Array, '<h1>About our P...') #5 /srv/www/ in /srv/sftp-chroot/classes/lis-462-ol-fa19/omeka-2.7/plugins/AdminImages/views/helpers/AdminImageTag.php on line 10

I tried other ways of adding the image to the page, such as trying to directly insert an image and using the URL of the photo in Admin Images, but every time that I save changes to the page it deletes the image from the body. We’re using Omeka Classic 2.7.

The error looks like it’s saying that you didn’t pass an id argument to the shortcode. Could there just be a typo in the shortcode you actually inserted?

It was a dumb error. There needed to be a space between the id and size attributes. I copied and pasted from the Admin Images instructions which were misleading on that particular syntax: