Walled Garden access

I am running my site in walled garden mode and everything was fine till I had a requirement to make blogs view only public. I was able to make blogs public through external pages plugin and/or public pages plugin. My problem though is now blogs are not created with Public access in walled garden mode, they are always private, friends and logged in. Can I create blogs with public access in walled garden mode?

The only work around I have now is making site public, create blog, and make site private back again.

Thanks in advance for any solutions.

  • "Public pages" (or access when logged out with walled-garden enabled) is not the same as the "public" access level. The access level defines the accessibility on a content item level (e.g. a blog posting can be seen when logged out or only when logged in or only by friends etc.). With walled-garden the access restriction is on page level, e.g. the login page, registration page and external pages are visible to people logged out. With walled-garden enabled (in the default setting) a blog with access level "public" can still not be seen by logged out users because the blog page itself is not accessible.

    There are two options for you to make blogs visible to logged-out visitors with walled-garden enable.

    1. Use the 'public_pages', 'walled_garden' plugin hook to define these pages as "public pages" that need to be accessible to view the blog postings, i.e. return an array with the urls that need to be made "public" within the callback function of the plugin.
    2. Use the Login required plugin (http://community.elgg.org/plugins/804349/1.8.3/elgg-1819-login-required) for defining the urls that need to be accessible to view the blogs instead of using the Elgg core walled-garden option. Take a look at start.php of the plugin. In the function login_required_default_allowed_list() you can add the urls. The Login required plugin is also fully compatible with any pages defined via the plugin hook in option 1 (if the Login required plugin is placed below the plugin in which these plugin hooks are defined).
  • Hello iionly,

    Thanks for your reply. I can already make the pages/views etc. public that is not an issue. The problem is that when the site is in walled garden mode I do not get an option to created a public blog. My access is limited to private, friends and logged in. So in walled garden a user can never create a public blog and so that blog is never accessible outside even if the page is public.

    Should I:

    1. Manually overrride the access files so that public option is displayed when user is creating blog even if the site is in private mode.

    2. I also need to hide the headers, menus etc. for the blog that is public. Should I be overiding the core blog views in a plugin so that they do not have headers in it.


    Thanks for the help.

  • Oh indeed. I wasn't aware that the "public" access level is not selectable with the core walled-garden option enabled. Theres a plugin hook that removes the public access level if the site has walled-garden enabled. It seems it does not work to unregister this plugin hook to get the "public" access level to show up again.

    You can use my Login required plugin instead of the core walled-garden option to have your site in walled-garden but still have the "public" access level.

    May I ask what you are aiming at with the public blogs? Should every user be able to add blogs that are visible when logged out (even all blog postings being public) or do you as admin only want to add just a few specific info pages that should be accessible when logged out? In the latter case you might want to try out the Anypage plugin (http://community.elgg.org/plugins/868809/1.5.1/anypage). This plugin would allow you to add static pages that can be defined as public pages and you can also layout these pages without the site header, menus etc. showing.

    If you want every user to be able to add public blog postings, you would have to code some modifications indeed. Overriding the views is most likely not enough as you would also have to prevent the Elgg layout to be used for the pages, i.e. you would have to add your own page handler function. If the header and menus should be displayed when viewing a blog when logged in but not when logged out, you would also have to consider this in your modifications.

  • You can register a plugin hook to re-add the public access level

    That access level is only useful if you use the plugin hook to allow public access to pages where they are displayed so it may be confusiting UI.  You'll probably want to limit that option to only entities that have walled garden access.

  • I finally got it done.

  • Hello,

    Out of the above mentioned options, (I'm wanting to make the admin's blogs indexable by google), which option is the easiest for an ordinary person (not a programmer) to install and set up?

    If the easiest option is that Any page, could you please tell me how I install and use it?



  • Well, I just tried Anypage and it did not allow logged out users to access it. I can see it would not allow access to blogs, anyway.

    So, could you please tell me what you mean by "'public_pages', 'walled_garden' plugin hook"? How do I do it?

  • Anypage plugin is meant for kind of "static" pages (like about, terms and privacy pages). It can be installed like any other Elgg plugin. In the plugin settings you can add new pages and make them "public". But then you would need to also add a menu entry on your own to access such an anypage page. As I said, it's mainly useful for adding a few pages that do not change that often.

    Walledgarden is explained at http://learn.elgg.org/en/stable/guides/walled-garden.html. Making a page public (beyond the default pages) requires a bit of coding as explained in the docs. Alternatively, my Loginrequired plugin can be used for making a site a walledgarden site. It requires a bit less coding to make a page public with it but you would still need to touch the code a little bit to customize it. If you want only admin blogs to be public, you might want to use my News plugin for admin blogs. Then it would be easier to make all news postings (admin blogs) public pages while keeping user blogs within the walled garden. Otherwise you would have to make single admin blog entries public pages.

  • Hello,

    Thanks for your answer.

    I've just installed your News plugin. It's asking me to set access to either: Logged in Users, private or friends. Are you sure the news post will be outside the walled garden, accessible by googlebot?


  • There is an access level for content items (blogs, news, files etc.) that defines who can see this content item, e.g. "public" access level allows logged-out visitors to see this item whereas "logged in" access level restricts the visibility to logged-in users.

    Then there's an additional access restriction on page level if you set your site as a walled garden. The walled garden blocks access for logged-out visitors on page level. If a page is not a "public page" the visitor won't be able to access the page even if there are only content items with "public" access level shown on this page.

    So, if your site is in walled garden mode but you want certain content items still be visible for logged out visitors you need to make the page they are shown on a public page. This can be done either by using the 'public_pages', 'walled_garden' plugin hook as explained in the Elgg docs or in case of the Loginrequired plugin by adding the page url of this page in the login_required_default_allowed_list to the array of allowed urls. It's basically the same in both cases. For example for the News plugin you could simply add the url segment news with a wildcard as allowed url:

    $add[] = 'news/.*';

    "news" is the pagehandler used by the News plugin and with the placeholder you make all url starting with yoursite.url/news to public pages and therefore all news items (displayed on a page of the News plugin) will be visible to logged-out users also in walled garden mode as long as the news item itself has the public access level.