page list permissions links
Permalink
Hi,
I have a page list menu and want to display page links with permission restrictions to all users.
when the user clicks on a restricted page they should be redirected to the login page.
is this possible ?
thanks :)
I have a page list menu and want to display page links with permission restrictions to all users.
when the user clicks on a restricted page they should be redirected to the login page.
is this possible ?
thanks :)
thanks ... this removes the link so that the guest cannot see the page.
I want the guest to see the page link then on click be redirected to the login / register page.
I want the guest to see the page link then on click be redirected to the login / register page.
then change the settings of the autonav block to allow them to see things they don't have access to
hmmm page list, i guess ill have to use the autonav cheers
Hi all,
was there ever a solution to the original post? I'm trying to carry this functionality out with the Dojo Page Filter. Unfortunately, I'm working to a tight deadline here so any help at all is greatly appreciated!
Thanks :)
Joe
was there ever a solution to the original post? I'm trying to carry this functionality out with the Dojo Page Filter. Unfortunately, I'm working to a tight deadline here so any help at all is greatly appreciated!
Thanks :)
Joe
I've just modified the Page List Plus addon to do this, but it should be easy to override the core Page List in a similar way.
Just copy it to your blocks folder and look at the core Auto Nav module for inspiration:
These are the changes I made...
db.xml
=======
- add
and in Settings -> Database XML -> Refresh core database tables and blocks
That'll add a displayUnavailablePages field to the btpagelist table.
page_list_form.php
==================
- add
That'll show the checkbox when you add or edit the Page List block so you can switch this on or off.
controller.php
==============
in save() you'll need
just before the parent::save($args), to save youe setting in the btpagelist table for each block.
in getPages() add
just before the if ($num > 0) {
This will ignore permissions when building the page list.
Near the top of get pages, change the following code so it caters for displayUnavailablePages.
This ensures we read the selection before we prepare each Page List block
Hope that helps.
Russell
Just copy it to your blocks folder and look at the core Auto Nav module for inspiration:
These are the changes I made...
db.xml
=======
- add
<field name="displayUnavailablePages" type="I1"> <unsigned ></unsigned> <notnull ></notnull> <default value="0" ></default> </field>
and in Settings -> Database XML -> Refresh core database tables and blocks
That'll add a displayUnavailablePages field to the btpagelist table.
page_list_form.php
==================
- add
That'll show the checkbox when you add or edit the Page List block so you can switch this on or off.
controller.php
==============
in save() you'll need
$args['displayUnavailablePages'] = isset($args['displayUnavailablePages']) ? 1 : 0;
just before the parent::save($args), to save youe setting in the btpagelist table for each block.
in getPages() add
if ($row['displayUnavailablePages'] == true) { $pl->ignorePermissions(); }
just before the if ($num > 0) {
This will ignore permissions when building the page list.
Near the top of get pages, change the following code so it caters for displayUnavailablePages.
if ($this->bID) { $q = "select num, cParentID, cThis, orderBy, orderBy2, ctID, displayAliases, keyword, attributes, rss, displayUnavailablePages from btPageListPlus where bID = '$bID'"; $r = $db->query($q); if ($r) { $row = $r->fetchRow(); $row['attributes'] = $this->parseCAV($row['attributes']); } } else { $row['num'] = $this->num; $row['cParentID'] = $this->cParentID; $row['cThis'] = $this->cThis; $row['orderBy'] = $this->orderBy; $row['orderBy2'] = $this->orderBy2; $row['ctID'] = $this->ctID; $row['keyword'] = $this->keyword;
Viewing 15 lines of 20 lines. View entire code block.
This ensures we read the selection before we prepare each Page List block
Hope that helps.
Russell
Click Edit page and on the top bar click Permissions.
Below you have "Who can view this page?"
Just uncheck first checkbox - Guest.
Now, when the user clicks on this page, will have to be logged in to see the text.