Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

  • 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

Activity

  • Sarah added a new discussion topic add plugin to every elgg page in the group Beginning Developers
    If a plugin like "Shareaholic" should be used on every frontend page (not admin pages), is this possible without adding all views manually? (Because views count may vary from time to time, this would not be the desired solution) The...
  • Sarah replied on the discussion topic all views to extend
    Thanks, Okay, I know that guide, but if the plugin view should be shown on every elgg page, I have to insert all views manually into start.php? A good example for this requirement is the Shareaholic plugin which shows buttons fixed on the bottom... view reply
  • Sarah added a new discussion topic call tidypics upload form directly in the group Beginning Developers
    Is it possible to call the tidypics upload form from my own plugin? The link is https://www.mydomain.com/elgg/ajax/view/photos/selectalbum/?owner_guid=38 but only works from the photos overview page, not when called from another page. Which URL...
  • Sarah added a new discussion topic all views to extend in the group Beginning Developers
    Is it possible to extend every view with my plugin view, or do I have to count them manually in start.php?
    • Thanks, Okay, I know that guide, but if the plugin view should be shown on every elgg page, I have to insert all views manually into start.php? A good example for this requirement is the Shareaholic plugin which shows buttons fixed on the bottom left side. This is also only shown on the start page and has the init option:

      elgg_extend_view('object/summary/extend','Shareaholic/Shareaholic');

      Isn't there any possibility to see this on every (internal) page?

    • I know it's been a long time since you asked this question but I came looking so I figured someone else might too. 

      I don't think there is a clean way to do what you're describing, however you can contextually extend whatever view they all have in common. For example,  most likely all of your view will eventually run through the "page/elements/body" view (or "page/layouts/content", etc). 

      So your start.php can look something like this:

      <?php
      elgg_register_event_handler('init', 'system', 'plugin_init');
      
      function plugin_init() {
          elgg_register_event_handler('pagesetup', 'system', 'pagesetup_handler', 1000);
      }
      
      function pagesetup_handler() {
          if (elgg_is_active_plugin('PLUGIN_NAME') && elgg_is_logged_in()) {
            if (elgg_get_context() == "CONTEXT") {
                elgg_extend_view('page/elements/body', 'other/view', 501);
          }
      }

      I use this to add an AJAX modal to plugin forms. 

    • Adam, we recommend moving away from the pagesetup event if possible. It will likely be formally deprecated soon.

      Problem being it's tied to the first elgg_view() call, which is a very unreliable indication of "about to build a page".