Subtype Entity View for Plugin

Hey Elgg Developers,

I'm writing a plugin that requires custom entities. These are working, but my subtype view isn't.

I have registered the subtype in my plugin's activate.php file "add_subtype('object', 'custom_object');".

I have created a file in my plugin's directory "/mod/myplugin/views/default/object/custom_object.php", but I have been unable to get Elgg to use this view when I call "elgg_view_entity($custom_object_entity)", where $custom_object_entity is an ElggObject with a subtype property of "custom_object".

The view is working if I rename the file from "custom_object.php" to "default.php". I have tried deactivating and reactivating the plugin, clearing the cache, and renaming the subtype and file to remove the underscore.

Please help!

n.b. I'm using Release - 1.9.0-dev, Version - 2013051700

  • What you're doing should work. I'm currently working on a new plugin (in Elgg 1.8) and everything works fine.

    When developing a plugin is't always a good idea to disable caching, as you don't have to worry about issues.

    Please keep in mind that Elgg 1.9 is still in heavy development and some things could not work. Maybe you could report this issue in github (https://github.com/Elgg/Elgg/issues) so the developers can tell you what's going on.

  • Thanks Jerome, I'll try to see if I can replicate this issue in a test plugin. If I encounter the same behaviour, I'll file a report.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking