Group activity

  • Nikolai Shcherbin replied on the discussion topic Questions about notifications
    @elggnoob If you see in the admin panel (/admin/cron) that all cron jobs are running, it means that everything is working as expected. FYI: 1, 2, 3 view reply
  • elggnoob replied on the discussion topic Questions about notifications
    Thank you for pointing me in the right direction, Jerome. Much appreciated. After some investigation I found out that my webhoster required an additional script in my webspace to activate those cronjobs. Their customer service created that script... view reply
  • Jerome Bakker replied on the discussion topic Questions about notifications
    In order for most notifications to work you need to have the CRON configured on your website. https://learn.elgg.org/en/stable/admin/cron.html Make sure you've set this up correctly. You can see if this is setup correctly by going to... view reply
  • elggnoob added a new discussion topic Questions about notifications
    Hello, as my site progresses, I find new topics to ask questions about. Today, I am wondering about notifications: In my notifications settings on [domain]/settings/notifications/[username] I have marked all available settings for...
    • In order for most notifications to work you need to have the CRON configured on your website. https://learn.elgg.org/en/stable/admin/cron.html

      Make sure you've set this up correctly. You can see if this is setup correctly by going to /admin/cron there you can see the last time the cron ran (And also the last 5 cron logs).

      In order for notifications to work you need to have the minute cron working. Other plugins can use the cron for scheduled tasks on different intervals so they all need to be setup.

      Every hosting provider has different ways to set this up so look into how this should work for your hoster.

    • Thank you for pointing me in the right direction, Jerome. Much appreciated.

      After some investigation I found out that my webhoster required an additional script in my webspace to activate those cronjobs. Their customer service created that script for me and now all the notifications from day 1 to now keep pouring in by e-mail. :)

      Meanwhile, there are also other cronjobs activated (up to "hourly").

      Is there something else I need to still do regarding cronjobs? Or is that now set up sufficiently?

      Thanks again for the support. This is all new to me, but I'm learning a lot and if you follow my posts, you can see my progression. I hope. ;)

    • @elggnoob

      If you see in the admin panel (/admin/cron) that all cron jobs are running, it means that everything is working as expected.

      FYI: 1, 2, 3

  • Would I be able to get the message and notifications icons shown in media view with this code or do I have to separate the $search and $site_menu nonetheless?  In my example, I just hid them under the navbar. Note: topbar has 2... view reply
  • but where do the actual links come from, e.g. to settings or profile? From register, menu:topbar event.  You can find all files using Developer Tools -> Inspect -> Events If I would want to add a link to that menu, where... view reply
  • elggnoob replied on the discussion topic Notification and E-Mail icons in topbar for mobile view?
    Thanks for the start. I decided to post my train of thought here, because there is so little up-to-date information for Elgg 6 available online, and I thought that maybe my noob topics help others in the future. Someone please correct me, if... view reply
  • You'll need a looot of CSS customization. Start with this snippet from our custom plugin: <?php elgg_import_esm('page/elements/topbar'); echo elgg_format_element('div', ['class' =>... view reply
  • elggnoob added a new discussion topic Notification and E-Mail icons in topbar for mobile view?
    Hello, my site looks more and more like I envisioned it in January and I'm quite glad with my progression. One thing that I've been trying to figure out though - and failed to - is how to make the notification and e-mail icons in the...
    • Thanks for the start. I decided to post my train of thought here, because there is so little up-to-date information for Elgg 6 available online, and I thought that maybe my noob topics help others in the future. Someone please correct me, if something is wrong. Reminder: I have zero background in PHP programming. I learn everything about Elgg by trial&error and trying to understand what is happening in the code.

      First of all, the way how I understand things now, there are only two files needed for this situation:

      \vendor\elgg\elgg\views\default\page\elements\topbar.php (as posted by Nikolai)

      and

      \vendor\elgg\elgg\views\default\elements\layout\topbar.css

      I try to understand what everything in Nikolai's code does:

      elgg_import_esm('page/elements/topbar');

      I assume that this calls topbar.mjs to create the collapsing menu script.

      echo elgg_format_element('div', ['class' => 'elgg-nav-logo'], elgg_view('page/elements/header_logo'));

      This is the area where the website's name from the settings page is being shown. Alternatively, if you find the right place in CSS, I think you might be able to insert an image logo here instead, but this is not wanted in general, according to the code notes that I found in some file. ;)

      echo elgg_view('core/account/login_dropdown');

      This adds the login menu with its own dropdown area for visitors that are not logged in yet. It disappears when you are logged in.

      $search = elgg_format_element('div', [
       'class' => 'elgg-nav-search',
      ], elgg_view('search/search_box'));

      This creates the search field.

      $site_menu = elgg_view_menu('site', [
       'sort_by' => 'text',
      ]);

      This shows the main navigation in the topbar, which means the links to e.g. blog or pages.

      Note for later (and Nikolai): I hide this navigation in my individual layout!

      echo elgg_format_element('div', [
       'class' => 'elgg-nav-collapse',
      ], $search . $site_menu);

      This is where it starts to get a bit complicated. This area defines which areas of the topbar will be moved into the hamburger collapsing menu on mobile view (I think). In this case, it moves the search field and the site menu area (or in my case: only the search field).

      Now, on top of search and site menu, it also moves the topbar menu (this apparently automatically happens in mobile view as it's not called in the function above). That topbar menu is crucial to the topic of this thread. It's unclear to me how/where this is generated. I found some files for it (see below), but where do the actual links come from, e.g. to settings or profile? What I mean: If I would want to add a link to that menu, where would I do that? I haven't figured that one out yet.

      Either way, that topbar menu is a hover menu. I don't know what the official term for this is, so I continue with hover. It means that if I move the mouse over the menu (which says "Account"), a menu magically appears under it showing all the entries/links of that menu. Except, for reasons I haven't figured out yet as well, the message and notification links get moved out of that hover and get their own icons and fields in the menu on full web view. But as soon as you're in mobile view, the message and notifications icons disappear and get moved into the hover menu as well. This is supposed to happen. And this is exactly what I'm currently trying to change: I want those two icons to stay in the topbar as icons also in mobile view. More on that effort below.

      echo elgg_view_menu('topbar');

      This calls the above mentioned hover menu into the topbar.

      The notification icon comes from this file (I think):

      \vendor\elgg\elgg\mod\site_notifications\classes\Elgg\SiteNotifications\Menus\topbar.php

      The message icon comes from this file (I think):

      \vendor\elgg\elgg\mod\profile\classes\Elgg\Profile\Menus\topbar.php

      Both files don't seem to be needed in this case, as this indeed seems to be purely solvable in the CSS file. However, theoretically speaking, if one would create an additional topbar menu which would be shown next to the actual topbar menu, I would assume that you could move those two icons here to that new menu. However, you probably have to change a lot more, as this is Elgg and if I learned one thing during my first month with Elgg, it's that everything is at least 10 times more complicated than you think. ;) But at least I hope that my general line of thought is correct here.

      echo elgg_format_element('div', ['class' => 'elgg-nav-button'], '');

      This adds the "nav button" to the topbar. That "nav button" is the hamburger menu button which is being shown in mobile view.

      Now, in the topbar.css I mentioned above, I found various areas of this topbar.php page and was able to manipulate them for testing reasons, e.g. the width of things. I was able to make the "nav button" show all the time. I was able to make the message and notifications icons show larger, meaning with their link texts under them. I was also able to e.g. change the color of the hover areas. Through that I got an idea about what does what which is how I learn about Elgg.

      So far, so good. This is where I am at at the moment of writing this post. The answer lies in the CSS for @media. Patience, young padawan, would Obi-Wan Kenobi say.

      To Nikolai (in case you are reading this): I use the "Default plus" theme which is available for Elgg 6 on the elgg.org website. That theme uses the same code as the original topbar.php, except that the main menu navigation is hidden:

      elgg_import_esm('page/elements/topbar');
      
      echo elgg_format_element( 'div', ['class' => 'elgg-nav-logo'], elgg_view('page/elements/header_logo'));
      
      echo elgg_view('core/account/login_dropdown');
      
      echo elgg_format_element('div', ['class' => 'elgg-nav-button'], '<span></span><span></span><span></span>');
      
      $contents = elgg_format_element('div', ['class' => 'elgg-nav-search'], elgg_view('search/search_box'));
      // $contents .= elgg_view_menu('site', ['sort_by' => 'text']);
      $contents .= elgg_view_menu('topbar');
      
      echo elgg_format_element('div', ['class' => 'elgg-nav-collapse'], $contents);

      Would I be able to get the message and notifications icons shown in media view with this code or do I have to separate the $search and $site_menu nonetheless? I ask, because your code indeed, as you warned, breaks the navigation, but the Default Plus theme works as is. So it would be easier to build on that. From how I understand it, your code doesn't separate the notifications and messages icons from the topbar. The difference lies in the handling of search and main menu. Which both are not needed for my task.

      Do I thus assume correctly that what I try to achieve can be done by using the "Default Plus" theme + changes in the topbar.css? That would be most welcome. And please, let me know if anything in my above line of thought is incorrect. I want my noob posts to be helpful for other people as well.


       

    • but where do the actual links come from, e.g. to settings or profile?

      From register, menu:topbar event. 

      You can find all files using Developer Tools -> Inspect -> Events

      If I would want to add a link to that menu, where would I do that?

      In elgg-plugin.php or Bootstrap class of your custom plugin.

      You can unregister the exists events and/or add your own.

      Learn more

    • Would I be able to get the message and notifications icons shown in media view with this code or do I have to separate the $search and $site_menu nonetheless? 

      In my example, I just hid them under the navbar.

      Note: topbar has 2 sections "default" and "alt".

      The Messages and Notifications menu items are located in the default section.
       
      As I wrote above, you should solve this with the CSS code.

      Use your browser's developer tools (there is a mobile preview option).

      You can look at our demo and take the code from there, but you need to register on this site (there is an option to delete an account in the user settings).

  • Thanks once again for your reply and info! I found the necessary files and also the CSS to edit the class for the background-image and am now able to at least change the header area to hopefully suit my vision for my site. I will think about what... view reply
  • Imagine the header image being shown under the name "Durward Murphy", between the <hr> line and the white text field ("Illo necessitatibus...", with the same width as the text field (I assume that's 100% of that profile... view reply
  • 1 - Override these files: \vendor\elgg\elgg\views\default\page\default.php \vendor\elgg\elgg\views\default\page\elements\header.php \vendor\elgg\elgg\views\default\page\elements\header_image.php 2 - Customize CSS Note: It's a... view reply
  • Hello, [I use Elgg 6.1.1 with "Default Plus" theme.] Users can upload individual header images for their posts in various plugins, e.g. blogs, pages, user profile or event manager. This image is then inserted between the header of...
    • 1 - Override these files:

      \vendor\elgg\elgg\views\default\page\default.php
      \vendor\elgg\elgg\views\default\page\elements\header.php
      \vendor\elgg\elgg\views\default\page\elements\header_image.php

      2 - Customize CSS

      Note: It's a default layout

      \vendor\elgg\elgg\views\default\page\default.php
      

      Changing this view will affect  on all site pages, not just the blog.

      Otherwise, you'll need to create a custom layout and specify it in the full blog view.

       

      Can the height and width of the header image be defined; as a random example, let's say, set to 500x500 pixels?

      All in CSS  ¯\_(ツ)_/¯

      Where does the text "Leave blank to keep current header. Maximum allowed file size is 512 MB" in the add/edit pages come from?

      1, 2, 3

    • Imagine the header image being shown under the name "Durward Murphy", between the <hr> line and the white text field ("Illo necessitatibus...", with the same width as the text field (I assume that's 100% of that profile entry).

      Check out live Demo ;)

    • Thanks once again for your reply and info!

      I found the necessary files and also the CSS to edit the class for the background-image and am now able to at least change the header area to hopefully suit my vision for my site. I will think about what I could do with the area. Maybe leaving it hidden is nonetheless the more suitable solution for me, as that individual header doesn't add anything valuable to my site. It just takes space that is not needed.

      Regarding my hope for this function: I think that it won't be possible. I would have to change the cropping aspect-ratio from "header" to 1:1 in order to create a square and then move the created cropped square image out of the header area and into the view of the plugins (under the title section). I don't think this is easily possible, if at all.

      So in order to get the option to have a very easy and noticeable "add image" option for the users in various plugins (e.g. blog, pages, event manager, profile), the correct method would most likely be to add a custom image upload field and add it to the form and full view of the plugins. That's beyond my capabilities for now. I add it to my wishlist. And yes, I know that it's possible to add an image to the description area with the CKEditor. The problem is just that for 90% of my users, this is apparently too difficult. They need an "in your face" upload button that says "put your photo here". ;)

      P. S. It states that the "Blog Tools" plugin adds the option to add an image to a blog. I don't see this option anywhere though. Was this option taken out?

  • most listing pages in Elgg support the URL parameters 'limit' and 'offset', so if you  make it https://{mydomain}/groups/activity/917?limit=500 it should work view reply
  • I just wanted to ask you about this ) There is a separate event for this menu. You can also unregister it in your plugin instead of deactivating the plugin. 'Elgg\Pages\Menus\PagesNav::register' => ['unregister' =>... view reply
  • I found the culprit: The "Pages Tools" plugin must be overwriting this, despite "my plugin" being at the bottom of the list. After deactivating "Pages Tools", the sorting order works as intended. Thanks again... view reply
  • Thank you once again for your patience and clear explanations. I appreciate it and I understand now how register/unregister works and should be able to apply it correctly by myself from now on. I followed your instructions and my site uses my own... view reply
  • In your custom plugin: elgg-plugin.php 'events' => [     'register' => [          'menu:pages_nav' => [            ... view reply
  • Thanks once again for the answer. The tip with the "developer tools" is excellent. That helps a lot. I followed your advice, found the file (I don't know how I missed it before, since it's quite visible within the folder... view reply
  • IKE.TEKNIS replied on the discussion topic date format display incorrect
    Hi Nikolai, Sorry my english, please Thanks you for the best help. I resolve this problem, editing language file with correct data format and now i see date correctly view reply
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