aboutsummaryrefslogtreecommitdiffstats
path: root/doc/Widgets.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/Widgets.md')
-rw-r--r--doc/Widgets.md35
1 files changed, 33 insertions, 2 deletions
diff --git a/doc/Widgets.md b/doc/Widgets.md
index 8442bf687..7761b1833 100644
--- a/doc/Widgets.md
+++ b/doc/Widgets.md
@@ -117,6 +117,7 @@ Some/many of these widgets have restrictions which may restrict the type of page
* forums - provide a list of connected public forums with unseen counts for the current logged-in channel.
<br />&nbsp;<br />
+* activity - provide a list of authors of unread network content for the current logged-in channel.
* album - provides a widget containing a complete photo album from albums belonging to the page owner; this may be too large to present in a sidebar region as is best implemented as a content region widget.
* args:
@@ -128,14 +129,44 @@ Some/many of these widgets have restrictions which may restrict the type of page
Creating New Widgets
====================
-If you want a widget named 'slugfish', create widget/slugfish.php containing
+### Class Widgets
+
+To create a class-based widget named 'slugfish' create a file with the following contents:
+
+````
+<?php
+
+namespace Zotlabs\Widget;
+
+
+class Slugfish {
+
+ function widget($args) {
+
+ ... widget code goes here.
+ ... The function returns a string which is the HTML content of the widget.
+ ... $args is a named array which is passed any [var] variables from the layout editor
+ ... For instance [widget=slugfish][var=count]3[/var][/widget] will populate $args with
+ ... [ 'count' => 3 ]
+
+ }
+
+````
+
+The resultant file may be placed in widget/Slugfish/Slugfish.php , or Zotlabs/SiteWidgets/Slugfish.php . It also may be linked from a git repository using util/add_widget_repo.
+
+
+
+Traditional function based widget:
+
+If you want a widget named 'slugfish', create widget/widget_slugfish.php containing
<?php
function widget_slugfish($args) {
- .. widget code goes here
+ .. widget code goes here. See above information for class-based widgets for details.
}