How to set a page as public

How set a page as public when use the 'private site' (walled garden) configuration.

  • With external pages plugin. Look at it and ask if you have more questions.

  • @sem.. ;-) i think he wants to have a particular page set ok for access @ logged-out state when elgg's walled-garden is activated - currently elgg wil block most content @ walled garden -- will need somethwangmajigz coded to allow walled-garden logged-out access @ particular URI`s ;(

  • DhrupDeScoop is right.... 

    I have i page handler and an action... these need have public access... how to do this?!

  • Sem is correct - take a look at the external pages plugin for an example of how to do this.

  • You can use my Loginrequired plugin to give access to a certain page while at the same time having a walledgarden site:

    http://community.elgg.org/pg/plugins/project/804349/developer/iionly/elgg-181-login-required

    Just add the URL of the page to the allowed URL's in start.php.

     

  • there was some discussion abt a few weeks ago in this area.. if you can find that post again.. probably might have some more (code) details in there. ;-0

  •  

    I could not find anything to help me plug in external pages ...

    This is the start.php

    <?php

    /**

     * Plugin for creating web pages for your site

     */

     

    elgg_register_event_handler('init', 'system', 'expages_init');

     

    function expages_init() {

     

    // Register a page handler, so we can have nice URLs

    elgg_register_page_handler('about', 'expages_page_handler');

    elgg_register_page_handler('terms', 'expages_page_handler');

    elgg_register_page_handler('privacy', 'expages_page_handler');

    elgg_register_page_handler('expages', 'expages_page_handler');

     

    // add a menu item for the admin edit page

    elgg_register_admin_menu_item('configure', 'expages', 'appearance');

     

    // add footer links

    expages_setup_footer_menu();

     

    // register action

    $actions_base = elgg_get_plugins_path() . 'externalpages/actions';

    elgg_register_action("expages/edit", "$actions_base/edit.php", 'admin');

    }

     

    /**

     * Setup the links to site pages

     */

    function expages_setup_footer_menu() {

    $pages = array('about', 'terms', 'privacy');

    foreach ($pages as $page) {

    $url = "$page";

    $item = new ElggMenuItem($page, elgg_echo("expages:$page"), $url);

    elgg_register_menu_item('footer', $item);

    }

    }

     

    /**

     * External pages page handler

     *

     * @param array  $page    URL segements

     * @param string $handler Handler identifier

     */

    function expages_page_handler($page, $handler) {

    if ($handler == 'expages') {

    expages_url_forwarder($page[1]);

    }

    $type = strtolower($handler);

     

    $title = elgg_echo("expages:$type");

    $content = elgg_view_title($title);

     

    $object = elgg_get_entities(array(

    'type' => 'object',

    'subtype' => $type,

    'limit' => 1,

    ));

    if ($object) {

    $content .= elgg_view('output/longtext', array('value' => $object[0]->description));

    } else {

    $content .= elgg_echo("expages:notset");

    }

     

    $body = elgg_view_layout("one_sidebar", array('content' => $content));

    echo elgg_view_page($title, $body);

    }

     

    /**

     * Forward to the new style of URLs

     *

     * @param string $page

     */

    function expages_url_forwarder($page) {

    global $CONFIG;

    $url = "{$CONFIG->wwwroot}{$page}";

    forward($url);

    }

     

  • I did it!

    I created a hook handler like this:

     

    elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'interplayers_public_pages');

    function interplayers_public_pages($hook, $type, $return_value, $params) {

     

        $return_value[] = 'form_contato';

        $return_value[] = 'form_contato/';

        $return_value[] = 'action/contato/enviar/';

        $return_value[] = 'action/contato/enviar';

        

        return $return_value;

    }

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.