Adding System Pages to Auto-Nav

Permalink 1 user found helpful
Is there a way to add a system page, like Profile, to the auto-nav block. I can't seem to find it. I have reviewed the settings and permissions of the Profile page and checked System Pages in the site map, but it doesn't show up in auto-nav.

EDIT: Still haven't figured it out.

coleatron
View Replies: View Best Answer
coleatron replied on at Permalink Reply
coleatron
Oh dear. I made a big mistake. In an effort to figure it out (I think I did figure it out, by the way), I moved the system pages in the site map under a page titled site-stuff, and then I logged out. Now I can't login! The pages are moved so when I try to login I get a page not found error. Any advice on how to fix this problem?
boomgraphics replied on at Permalink Reply
boomgraphics
Try to log in by going tohttp://yoursite.com/site-stuff/...
If you aren't using pretty URLs it might be something likehttp://yoursite.com/index.php/site-stuff/...
but I'm not one hundred percent sure about that. You could also go into the database and try to change the stored paths under PagePaths and then click browse in the table view, but i don't know if that will screw it up or not.
boomgraphics replied on at Permalink Reply
boomgraphics
These paths are what mine looks like in the database:
ppID cID   cPath
1      5     /login
2      6     /register
3      7     /profile
4      8     /profile/edit
6      10   /profile/avatar
7      11   /profile/messages
8      12   /profile/friends
9      13   /page_not_found
10    14   /page_forbidden                     
11    15   /dashboard                             
12    16   /dashboard/sitemap             
13    17   /dashboard/sitemap/full      
14    18   /dashboard/sitemap/explore     
15    19   /dashboard/sitemap/search
coleatron replied on at Permalink Reply
coleatron
I changed the page paths in the database to reflect yours but it still doesn't work. I can access the site-stuff page, but none of the system pages off of it. If I go to site-stuff/login I can get to the login page, but when I click login I get a page not found error.
coleatron replied on at Permalink Reply
coleatron
So I ended up fixing the problem by saving my content elsewhere, deleting my website, and reinstalling Concrete5.

Now I have it up and running again and I need help with the original problem.

I have created an Alias of the Profile page and its subpages under the Page that I want it in, and tried to create a new auto-nav of the profile page and its subpages. It adds Profile, but not the subpages. But the link doesn't work. I get a 404 error when I click it.

Any ideas?
jshannon replied on at Permalink Best Answer Reply
jshannon
As discussed, line 200 of the autonav block's controller is
public $displaySystemPages = false;


Change that to true. Unfortunately, there's no way to change this through an interface (though you can if you're hardcoding the block into a template).

James
jshannon replied on at Permalink Reply
jshannon
PS (for those that come across this in the future):

1. This is a core file, so any updates to the core will overwrite this. The best way I can think of to solve this is to copy the entire block to your blocks directory and rename it appropriately (I don't think you can just duplicate the controller). Or just remember to make this same change after upgrading.

2. This will "expose" all system pages in the nav, including some pages that aren't very helpful without a parameter (such as /profile). You can always set the 'exclude from nav' attribute on these pages.

James
TheRealSean replied on at Permalink Reply
TheRealSean
pps :)

You can use
$controller->displaySystemPages = true;


in your template, so that you do not override your core file.
jshannon replied on at Permalink Reply
jshannon
But that only works if you're hardcoding the block into the template, right?

ie, if you're using it as a "block", by adding it through the "edit page" interface, is there any way to do this?

James
TheRealSean replied on at Permalink Reply
TheRealSean
You would need to use a custom template, to do this, but you can leave the core alone,

Ie root/blocks/autonav/templates/header_nav/view.php <-- change within this

then if you are loading from a page left click block go to "Custom Template" choose your new Template to apply.

From a Scrapbook you use "Custom Template" link and if your including the global block(stored in the scrapbook) within you header.

$block = Block::getByName('Header_Navigation');  
   if( $block && $block->bID ) $block->display('templates/header_nav');
jshannon replied on at Permalink Reply
jshannon
Oooh. Nice. Clever.
mikemiller replied on at Permalink Reply
mikemiller
An old post that I thought I would add to as I found an easier solution that doesnt require any code change - just add an external link to the Home node that points to the system page (eg `index.php/register') and this will add to the auto nav