Elgg 3 Documentation


I just tried to do the blog plugin tutorial with elgg 3, but its not working. Is the documentation not for elgg 3?

  • Yes I know thats for 2.3, I'm looking  at this tutorial for elgg 3.0: http://learn.elgg.org/en/3.0/tutorials/blog.html


    But when I do it, it gives me fatal errors (page not working, have to rename the plugin in /mod/ to disable the plugin and get the page working again)


    So I'm asking if the documentation hasnt been updated and therefor doesnt work for 3.0

  • Elgg 3.0 documentation is updated. Seems that you're doing something wrong. Check your server logs.

  • I checked everything four times, error log of my server doesnt give any errors for the particular timestamp. Is that 100 % sure, that the tutorial is correct? I copied and pasted everything according tothe tutorial, checked everything and I also checked the directories more than once. I'm absolutely sure, that I have everything exactly as in the tutorial.

  • In start.php use

    elgg_register_event_handler('init', 'system', 'my_blog_init');
    function my_blog_init() {
        // register a hook handler to override urls
        elgg_register_plugin_hook_handler('entity:url', 'object', 'my_blog_set_url');

    Instead of code that mentioned in docs

  • Thank you, that solved the fatal error issue. When I view /my_blog/add/, it outputs raw code and still doesnt work, but at least no fatal errors.


    Thats the output:

    Create a new my_blog post

    echo elgg_view_field([ '#type' => 'text', '#label' => elgg_echo('title'), 'name' => 'title', 'required' => true, ]); echo elgg_view_field([ '#type' => 'longtext', '#label' => elgg_echo('body'), 'name' => 'body', 'required' => true, ]); echo elgg_view_field([ '#type' => 'tags', '#label' => elgg_echo('tags'), '#help' => elgg_echo('tags:help'), 'name' => 'tags', ]); $submit = elgg_view_field(array( '#type' => 'submit', '#class' => 'elgg-foot', 'value' => elgg_echo('save'), )); elgg_set_form_footer($submit);

  • Add


    At the start of mod\my_blog\views\default\forms\my_blog\save.php

  • Thanks, that also solved this issue. I still cant get the page with all the blog posts (/my_blog/all/). Writing, saving and viewing blogs works however.

  • Sorry, I haven't free time to learn you Elgg or coding.

    Use the existing 'blog' plugin as an example, learn docs, use GitHub/Gitlab for sharing your projects and return on Community.