From af113e044fe8225a40ddd128f9226b973b0b6437 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 12 Apr 2010 22:23:05 +0000 Subject: Updated site pages docs. Added ability to pass arguments to custom keywords. Added user_list keyword. Reject logged out front pages that don't have [[login_box]]. git-svn-id: http://code.elgg.org/elgg/trunk@5710 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/sitepages/README.txt | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'mod/sitepages/README.txt') diff --git a/mod/sitepages/README.txt b/mod/sitepages/README.txt index bc4d02007..b2c36c71e 100644 --- a/mod/sitepages/README.txt +++ b/mod/sitepages/README.txt @@ -80,11 +80,13 @@ CONTENTS: keyword, but custom keywords provide a simple way for non-techy users to include ready-made views without the fuss of knowing what they're doing. - The below example creates the 'my_plugin_keyword' keyword that displays the - view at 'my_plugin/keyword_view.' + Custom keywords support arguments in the same format as views and entities. + These arguments are passed to the custom view via the $vars array. It is + the responsibility of the custom view to parse these arguments. - This is exactly the same as saying [[view: my_plugin/keyword_view]] but - much simpler for the user. + The below example creates the 'my_plugin_keyword' keyword that displays the + view at 'my_plugin/keyword_view.' This is exactly the same as saying + [[view: my_plugin/keyword_view]] but much simpler for the user. Example: register_plugin_hook('get_keywords', 'sitepages', 'my_plugin_keywords'); @@ -98,15 +100,17 @@ CONTENTS: return $value; } - NB: No variables are passed to the view when using custom keywords. - 4. HINTS AND QUIRKS - * A custom keyword is more complicated to implement, but simpler for the - end user. + * A custom keyword is slightly more complicated to implement, but is + much simpler for the end user to use. + + * Custom keywords can contain only alphanumeric and the underscore + character. - * The view and entity keywords have limited support for passing arguments, - but the arguments cannot contain '=' or ','. If you need complicated - arguments, it's best to create a custom keyword with a custom view. + * All keywords have limited support for passing arguments but the arguments + cannot contain '=' or ','. If you need complicated arguments for a custom + keyword, it's better to split the functionality into multiple keywords and + views instead of requiring complicated arguments. -- cgit v1.2.3