Pages

Saturday, November 10, 2012

ELGG - How the elgg menu works

What happens when you call elgg_view_menu of elgg core of some of the existing or your own menus?


In this short article I will go through the most important steps the ELGG engine doas when the menu is created for calling view.
As you probably know the individual menu item or the menu in elgg is created by calling function elgg_register_menu_item('menu_name', array(menu parameters)). More info you can find on elgg documentation.
If the named menu doesn't exist it is created. The menu "object" in Elgg is not a real object from OOP point of view. It is an array containing information about the menu as styling, sections and the actual individual menu items. These Menu items are the only objects in the menu array.

elgg menu diagram


On the simple schema above is explained how elgg_menu_is created. 
blue indicates elgg core functions or fields, red indicates user views (or default views)
light arrow indicates calling function bold arrows is returning to original calling view.


view calls elgg_view_menu('menu_to_display', array(additional parameters)):

core function elgg_view_menu() queries from $CONFIG->menus['menu_to_display']
calls ElggMenuBuilder with information how to order menu items in the menu and reorders the items as required. Here as well passes to menu additional parameters if found.
calls elgg_view with 'menu_to_display' view as parameter. If no 'menu_to_display' exists default view is called. Menu with additional parameters is passed as parameter
 
Here you can do whatever you wish with custom 'menu_to_display' view. Default view looks for sections in the menu (at least one - default section is found) and calls view section.
Section view calls item view.
The default menu view calls the section view which calls item view.
Default section and item views are available to be overridden by any plug-in or theme. 


in next topic explained:
ElggMenuBuilder
ElggMenuItem
Css

Tuesday, November 6, 2012

ELGG Social Networking tool  

Social Networking Framework. 

About

Elgg is open source social networking engine. It works out of box with basic functionality as following friends, messages, groups, blog, pages. There is large number of mostly free plugins available. Plugin installation is due to engine design extremely simple and most of the time there is very little developer input required.

 Customization. 

Different story is when it comes to the customization of existing code. Usually some moderate knowledge of PHP, HTML and CSS is required. ELGG can be potentially tweaked to any functionality one could imagine. It can serve very well as portfolio site, blog site or news site. #ELGG could be downloaded free of charge from community site. The same site provide active community forums and feedback to your problems.

Community. 

Comparing the wordpress ir joomla community there is relatively small number of developers due to #ELGG core developer team policy. elgg.org is strictly community website with no refrence to commercial development allowed except the official commercial version http://www.elgg.com. Elgg.com is identical open source software. The extra price is for the hosting, setup and maintenance. Hiring an hight standard elgg developer can be significantly cheaper than hiring equivalent wordpress specialist. Some are available here elgg development 

Responsive design. 

Now days very often mentioned term in web design. ELGG core engine offers only plugin to offer simplified website version when viewed from mobile device. There are few responsive themes available "on community website". A lot of developers try to offer elgg plugins on their own site since advertizing of commercial plugins on community site is not possible. It is worth to google before start building the website. Some elgg plugins can be found on this elgg store.

Design and Database.

Elgg uses atribute value database model which means it is extremely flexible but for larger websites with more traffic some performance tweak is recommended.  The only option for Database is Mysql and if I haven't mentioned ELGG is coded in PHP.

Elgg loosely follows MVC approach where elgg engine acts as model and partly as controller. The plug-in developer most of the time creates views and components to enhance the functionality.

More about elgg could be found here on this web design blog