Elgg
Wordpress

How enGap works for ELGG

enGap is HTML5 based mobile application.So whatever you see in the app is HTML5 pages. and the twist here is that this pages are downloaded from your website. The data is retrieved via webservice call to your website.
 This webservies are defined in mod/engap/start.php of the enGap plugin.The pages and templates are present in mod/engap/views/engap/ folder.
enGap is also using onsen ui, and angularjs.

Minimum Load on server

Views images,and data/entity are also cached in the mobile application. So this mobile app will also work in offline mode
We have taken special care to keep interaction with server as low as possible, and maximum utilisation comes from cached data,even when internet is present. When data comes from server, we do not force user to wait for it. in fact user dont even know that when data is updated.

index.php

mod/engap/views/engap/index.php is the main page of your application after users logs in. Here you can add and remove tabs at bottom. The content of each tabs can either be defined in same index.php as ons-template (like home). or can be defined in separate php file. Like group.php,members.php,more.php.

entity template

mod/engap/views/engap/entity folder contains the template(listview) for required ELGG entities. right now we added template for group and user. and you can add more entities over there. each entity contains two PHP file. list.php contains the template for one item on a list of that type of entities.full.php contains the full page view of a given entity.

page caching

all the pages which were demanded without query params, are not cached. All the list templates i.e entity\type\subtype\list.php are cached all the pages availabe at root level i.e views\default\engap\index.php are cached
You can modify the layout and structure of cached page anytime on server. and we made the app such that you don't even need to resubmit the app to App Store.The app caching can be forced to cleanup just by changing one version variable.

Note

direct javascript is not allowed in the code, Please note that click on any link will be opened into external browser. so avoid html link.

special directive

Special directive are like html tags. and their special presentation is implemented in the mobile app.
newsfeed
This is the list of all river items related to users friends.
<newsfeed   limit="11" ></newsfeed>
elggentity
Show one entity of given guid.The template used is mod/views/engap/entity/type/subtype/list.php.
<elggentity      guid="1239"></elggentity>
elggentitylist
It list all the entities of given type and given subtype. The template used is mod/views/engap/entity/type/subtype/full.php.
<elggentitylist  type="object"  subtype="event"  limit="9"></elggentitylist>
sidebar
Using this tag you show a content in a uniques slidein page. and this way you can converts elgg sidebar of each webpage into slide pages too.You need to add a button in ons-toolbar as follow
<ons-icon icon="ion-navicon-round" onclick="sidebar();"></ons-icon>
timeline
This is the list of all river items related to user.
<timeline   extra="entity_guid"  limit="11"></timeline>

API

load_page
you can put a php file at /views/engap/... path and load that page via this function load_page(path) like load_page(timeline) is loading mod/engap/views/engap/timeline.php
logout_user()
Allows the user to logout from your ELGG site.