Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • TCB replied on the discussion topic custom river menu for blogs based on api call response
    Thanks RvR, First.. let me say that I appreciate your quick responses to my questions.. you are extremely knowledgeable!   So your solution would work if I didn't have the requirement to get "real-time" verification... view reply
  • TCB added a new discussion topic custom river menu for blogs based on api call response in the group Beginning Developers
    Hi, I'm using Elgg 2.3.14 and I've added a custom menu handler in my start.php: elgg_plugin_hook_handler('register', 'menu:river', 'river_menu_handler'); And the block of code in my handler that calls a...
    • Quickly answer is validate it using your API call once, e.g. when blog is published/edited, or using separate action by admin/moderators.

      Make hook using entity events for this.

      After validating add metadata's name/value to the published blog, e.g.:

      $entity->verify = true;

      Now you can just check this metadata's value on your river menu:

      if((bool) $entity->verify )  {
      
           //value is TRUE
      
             $items[] = \ElggMenuItem::factory([
                 'name' => 'verify',
                 'href' => 'http://mytestapi.com',
                  'text' => elgg_view_icon('round_checkmark'),
                  'title' => 'This post has been verified',
                  'priority' => 200,
             ]);
             return $items;
      
      } else {
      
           //value is FALSE
      
           $items[] = \ElggMenuItem::factory([
                  'name' => 'verify',
                  'text' => elgg_view_icon('ban'),
                  'title' => 'This post has not been verified',
                  'priority' => 200,
           ]);
          return $items;
      
      }
    • Thanks RvR,

      First.. let me say that I appreciate your quick responses to my questions.. you are extremely knowledgeable!  

      So your solution would work if I didn't have the requirement to get "real-time" verification status.  We want to always check to make sure that the value of the data in the blog stored with Elgg has not changed when comparing it to the data that is stored in a remote distributed ledger when the post is created... so setting the verify attribute to true would not enforce those real-time checks.  We will always store an original version of the post with an outside source first and then run the comparison whenever the page renders for blogs.

  • TCB replied on the discussion topic Retrieving a river items entity data
    Ohh... wow.. sorry that was my oversight. Didn't even see that I had the '$' there.  Thanks Jerome. view reply
  • TCB added a new discussion topic Retrieving a river items entity data in the group Beginning Developers
    Hi, I'm using Elgg 2.3.14 and I need to retrieve the data within the entity of river items to add custom properties to a new river menu item.  In my start.php I'm registering a new plugin hook handler for my menu item...
  • TCB replied on the discussion topic Blog library override
    Thanks RvR... I think we posted at the same time.  I had figured after playing around with the code last night that I could override the views to accomplish what I needed to do but I will look at your solution to guide me through some of the... view reply
  • TCB added a new discussion topic Blog library override in the group General Discussion
    Hi, I'm using elgg 2.3.14 and looking for some advice on how to change the behavior of the bundled blog plugin.  What I'm trying to do: When loading the blog view, for each blog entry I need to make a rest call to a...
    • Override views which calls this function:

      mod\blog\views\default\resources\blog\all.php
      mod\blog\views\default\resources\blog\group.php
      mod\blog\views\default\resources\blog\owner.php

      You can use this hook also:

      $options = [
          'type' => 'object',
          'subtype' => 'blog',
          'distinct' => false,
          'no_results' => elgg_echo('blog:none'),
      ];
      
      $viewer = function ($entities, $options) {
          return theme_elgg_view_entity_list($entities, $options);
      };
      
      echo elgg_list_entities($options, 'elgg_get_entities', $viewer);
       
      Where theme_elgg_view_entity_list is your custom function to view entities, e.g.:
       
      function theme_elgg_view_entity_list($entities, array $vars = array()) {
          $offset = (int)get_input('offset', 0);
      
          // list type can be passed as request parameter
          $list_type = get_input('list_type', 'custom_type');
      
          $defaults = [
             'items' => $entities,
             'list_class' => 'custom_class',
             'full_view' => true,
             'pagination' => true,
             'list_type' => 'custom_type',
             'list_type_toggle' => false,
             'offset' => $offset,
             'limit' => null,
         ];
      
         $vars = array_merge($defaults, $vars);
      
         if (!$vars["limit"] && !$vars["offset"]) {
           // no need for pagination if listing is unlimited
           $vars["pagination"] = false;
         }
      
         return elgg_view('page/components/custom_view', $vars);
      }

      Or add any callback which you want to use.

    • Thanks RvR... I think we posted at the same time.  I had figured after playing around with the code last night that I could override the views to accomplish what I needed to do but I will look at your solution to guide me through some of the parts I haven't figured out yet.

  • TCB replied on the discussion topic Changing the color of a menu icon
    Dangit.. why do I keep forgetting about flushing the caches.. that was all I needed to do after the update.  Thanks. view reply
  • TCB added a new discussion topic Changing the color of a menu icon in the group General Discussion
    Using Elgg 2.3.4 I'm trying to override the default color of an icon.  When viewing the page and checking the style in the Chrome dev console, I see the style is set to : .fa-check:before { content:...
    • Why you not checked this in the Chrome Developer directly before changing Elgg CSS file?

      Of course, this will not work bcz:

      1 - .fa-check {color:green}

      2 - Need to run flush the caches

      3 - Learn how to customize CSS

    • Dangit.. why do I keep forgetting about flushing the caches.. that was all I needed to do after the update.  Thanks.