Coding a SubNav into Footer.php Page
Permalink
I am working on a custom website project and trying to build an "autonav" element within the footer page. I feel like I am close but not quite there... I have setup the site structure so that I can test the coding/setup as I go... I have sub-pages off of a main page "Magazine" that is to be the submenu that appears in the Footer section. I could make it static but want to set it up as an auto-nav so it may update as the site structure might change.
So what are the correct "controller" settings to make this work correctly?
Any guidance is appreciated... tga
<div id="subnav" <?php global $cp; if (is_object($cp) && ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage())) { echo ' style="bottom:20px;"'; }?>> <div id="menu-wrap" class="submenu clearfix"> <div id="menu-tab" class="toggle"><img src="<?php echo $this->getThemePath(); ?>/images/menu-tab.png" alt="View Menu" /></div> <!-- menu-tab ends --> <div id="menu" class="items"> <?php $bt = BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'beneath'; $bt->controller->orderBy = 'display_asc'; $bt->controller->choosePage = 'magazine'; $bt->controller->displaySubPages = 'none'; ?> </div><!-- #menu ends --> </div><!-- #menu-wrap ends -->
Viewing 15 lines of 16 lines. View entire code block.
So what are the correct "controller" settings to make this work correctly?
Any guidance is appreciated... tga
Thanks for the info and help... I was actually just working by trial n' error deduction based on the Concrete interface for creating an AutoNav block content within a page....
This is much more explanatory and now the trick to find the right combination of controllers to make it work...
Thanks... tga
This is much more explanatory and now the trick to find the right combination of controllers to make it work...
Thanks... tga
If you like to work by trial and error then here's a great reference for that:
http://www.merriam-webster.com/...
;-)
http://www.merriam-webster.com/...
;-)
Ohhhhh we got jokes I see... hahaha :-p
A little Christmas cheer.
I am soooooo close it's driving me bonkers... I am displaying the first "subpage" of the Custom main menu item or in this case 116 (Magazine page)... but all I am seeing is the first sub-page (Subscribe) for it right now... but there should be 5 other pages...
What am I missing? :-\
<div id="subnav" > <?php $bt=BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'custom'; $bt->controller->displayPagesCID = '116'; $bt->controller->orderBy = 'display_asc'; $bt->controller->displaySubPages = 'all'; $bt->controller->displaySubPagesLevels = 'all'; $bt->render('templates/header_menu'); ?> </div><!-- #footer ends -->
What am I missing? :-\
I'm not exactly clear what your situation is but try this:
<?php $bt=BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'custom'; $bt->controller->displayPagesCID = '116'; $bt->controller->orderBy = 'display_asc'; $bt->controller->displaySubPages = 'none'; $bt->controller->displaySubPagesLevels = 'enough'; $bt->render('templates/header_menu'); ?>
That didn't seem to make any difference... the site structure looks like this:
HOME
.....INSTRUCTIONS
.....STYLE
.....INFLUENCE
.....MAGAZINE
..........SUBSCRIPTION
..........NEXT PAGE
..........NEXT PAGE
..........AND SO ON....
As shown in the attachment... only the SUBSCRIPTION page/link is showing in the menu bar area... but not the rest of the pages on that level. And I want them to display from left to right (as indicated by the red arrow)...
Does this help shed some more light? ;-\
HOME
.....INSTRUCTIONS
.....STYLE
.....INFLUENCE
.....MAGAZINE
..........SUBSCRIPTION
..........NEXT PAGE
..........NEXT PAGE
..........AND SO ON....
As shown in the attachment... only the SUBSCRIPTION page/link is showing in the menu bar area... but not the rest of the pages on that level. And I want them to display from left to right (as indicated by the red arrow)...
Does this help shed some more light? ;-\
Silly question...
Do the other pages at the same level as 'Subscription' have their 'Exclude from Nav' attribute set?
As for the horizontal display, you would need to add a new template to the system. I have attached a modified 'breadcrumb.php'. To add it to your system just rename it 'horizontal.php' and upload it to '[root]/blocks/autonav/templates/horizontal.php'. Then modify your call to:
$bt->render('templates/horizontal')
Do the other pages at the same level as 'Subscription' have their 'Exclude from Nav' attribute set?
As for the horizontal display, you would need to add a new template to the system. I have attached a modified 'breadcrumb.php'. To add it to your system just rename it 'horizontal.php' and upload it to '[root]/blocks/autonav/templates/horizontal.php'. Then modify your call to:
$bt->render('templates/horizontal')
Another thought. They might be rendering vertically but not displaying because of the small height of the div. Have a look at your View Source to see if they are actually being rendered.
The view source confirms that they are being generated... so it appears that it's the fact that it's displaying vertically and not horizontally.... I was wondering if that might be the issue today... grrrrr
Let me try what you provided in the previous post... Thanks.
Let me try what you provided in the previous post... Thanks.
Never trust your eyes. Let 'Inspect Element' be your eyes.
okay... downloaded the file, renamed... loaded into the specified location... and updated footer.php file with the modified render statement... then the menu disappeared altogether... the orange bar is still displaying but the SUBSCRIBE link (or anything else) simply vanished from view...
viewed source and saw the following at the end:
????
viewed source and saw the following at the end:
<br /> <b>Fatal error</b>: Call to undefined method AutonavBlockController::getNavItems() in <b>/home/tgadams/readtheinstructionscarefully.com/style/concrete/blocks/autonav/templates/horizontal.php</b> on line <b>2</b><br />
????
I think I see the issue. Did you put it in '[root]/CONCRETE/blocks/autonav/templates'.
If you did, you need to stay out of the concrete folder.
It goes in '[root]/blocks/autonav/templates'. Make those folder if they don't exist.
If you did, you need to stay out of the concrete folder.
It goes in '[root]/blocks/autonav/templates'. Make those folder if they don't exist.
That's not it because I can put horizontal.php in the core '[root]/concrete/blocks/autonav/templates' folder and it works fine so it must be something else. Double check that it's in '[root]/blocks/autonav/templates'
Another thought... Make sure your overrides cache is off at 'Dashboard->System and Settings->Cache and Speed Settings'
what's the trick again to get into the dashboard for the site when one has trouble...?
at this point, I cannot get logged into the site in order to access the dashboard and I remember there was a round about way... *sigh*
at this point, I cannot get logged into the site in order to access the dashboard and I remember there was a round about way... *sigh*
I did fix the level... I did put it in the core... not the file is in the root but still seeing the same error message:
READTHEINSTRUCTIONSCAREFULLY.COM is actually the domain for this project... The concrete site is in the .com/STYLE/ directory until I'm ready to go live, then it gets moved up a level to the "root" in this case... ;-)
<b>Fatal error</b>: Call to undefined method AutonavBlockController::getNavItems() in <b>/home/tgadams/readtheinstructionscarefully.com/style/blocks/autonav/templates/horizontal.php</b> on line <b>2</b><br />
READTHEINSTRUCTIONSCAREFULLY.COM is actually the domain for this project... The concrete site is in the .com/STYLE/ directory until I'm ready to go live, then it gets moved up a level to the "root" in this case... ;-)
Yes I edited my post once I realized I was being an idiot in the domain name.
Another thought... Make sure your overrides cache is off at 'Dashboard->System and Settings->Cache and Speed Settings'
Try the 'Breadcrumbs' template to see if that one works. I know it's not exactly what you're after but my template is exactly the same except I left out the ">>" between the links.
Another thought... Make sure your overrides cache is off at 'Dashboard->System and Settings->Cache and Speed Settings'
Try the 'Breadcrumbs' template to see if that one works. I know it's not exactly what you're after but my template is exactly the same except I left out the ">>" between the links.
what is odd is that I don't see the breadcrumbs.php or header_menu.php in the root/ area... only in the core... so I guess I will add a copy of the breadcrumb.php to the same spot as the horizontal.php template then...
What happens if you just add a regular area to the footer and then add an autonav through the regular editing process. Set the options in there and choose 'Horizontal' as the custom template.
I wouldn't bother adding extra breadcrumb and header_nav to the root. They're supposed to be in the core. I tested it out and you can have custom templates in either the core or the root but if they are in the core, they will disappear when you update the site. I don't think that's the issue.
I wouldn't bother adding extra breadcrumb and header_nav to the root. They're supposed to be in the core. I tested it out and you can have custom templates in either the core or the root but if they are in the core, they will disappear when you update the site. I don't think that's the issue.
well well well well well.... that did it... now I am seeing the the attached view.... AND my administrator menu is back!!
gonna look at doing a few minor tweaks to it... but YEA!!!!!!
thanks for your help... one module down... tomorrow's adventure is the jQuery main header piece/menu... that should be REALLY fun!
chat with you again Michael... tga
gonna look at doing a few minor tweaks to it... but YEA!!!!!!
thanks for your help... one module down... tomorrow's adventure is the jQuery main header piece/menu... that should be REALLY fun!
chat with you again Michael... tga
But does 'horizontal' custom template work? I see it's set to breadcrumbs which puts the '>' separator between the links which implies that the user is deep into the website hierarchy.
that wasn't working... I copied the breadcrumb.php to the root area as you mentioned... then updated the code to render the breadcrumb instead... then it worked...
If you want to get rid of the '>' symbol, just rename 'breadcrumb.php' to 'horizontal.php' and edit it to put spaces (a bunch of '&n b s p;'s) in place of the '>' at the top (inside the <span>></span>)
That's all I did to create my horizontal.php that worked on my system but failed on yours.
That's all I did to create my horizontal.php that worked on my system but failed on yours.
You never told me your Admin Bar was missing. That implies something else is broken. Oh well, tomorrow's another day!
No worries man... I already edited to have "spacing" instead of the ">" in between each link... ;-)
Also, the Admin bar is showing as I indicated in the last attachment I sent... so all is well... The only minor tweak left is to make the menu links black text... I had it set that way earlier today and now it's white... so I will look at that later...
But tomorrow's adventure is the jQuery main menu header element... Don't go too far... I'm sure I'll be on here again... hahaha
Also, the Admin bar is showing as I indicated in the last attachment I sent... so all is well... The only minor tweak left is to make the menu links black text... I had it set that way earlier today and now it's white... so I will look at that later...
But tomorrow's adventure is the jQuery main menu header element... Don't go too far... I'm sure I'll be on here again... hahaha
The reason you need to rename your modified 'breadcrumb.php' to something else is because now that you modified the breadcrumb template, you can't actually use it as an actual breadcrumb nav because now it's missing the '>'.
I follow you.... I made the change and everything still seems to be fine... So now I have a a file named footer_menu that I am calling in the render statement...
Thanks for the clarification... tga
Thanks for the clarification... tga
Glad to hear everything got worked out.
Just a quick question... Is there a reason you need to hard-code that nav into the template? It seems like a lot of work for something that could be added as a Global Area and tweaked from the front-end.
Just a quick question... Is there a reason you need to hard-code that nav into the template? It seems like a lot of work for something that could be added as a Global Area and tweaked from the front-end.
I view it as global because I changed/updated the Footer.php file with this modified nav... Basically, I took what only contained the Admin nav bar and added this additional nav bar to it... This way it will appaar on every page as a "global" element. Also it gave me more control over the look because of the design the client wants... if that makes sense.
What you have done is certainly acceptable. No real criticism. I understand that this is a global and I support your desire to place it in the footer of every page. It's just that in my experience, I've regretted hard-coding things into the template files because it complicates things when the client changes their mind or if you want to freshen the site down the road.
I guess my suggestion would be to try to put the Global Area code in the footer like so:
Then put the page in edit mode and add an autonav to this Global Area and tweak the options to show the pages you want, including assigning your footer_menu custom template. This literally takes about 2 minutes to accomplish rather than going back and forth experimenting with different hard-coded options.
I guess I've learned to use all the features offered by the concrete5 development environment and only dig in to hard-coding when the front-end is not equipped to solve your specific issue.
As I say, what you accomplished is certainly a fine, workable solution. I'm just giving you some things to think about and try.
Now, onwards to jQuery!!
I guess my suggestion would be to try to put the Global Area code in the footer like so:
<div class="clients_wishes"> <?php $a=new GlobalArea('Footer Menu'); $a->display(); ?> </div>
Then put the page in edit mode and add an autonav to this Global Area and tweak the options to show the pages you want, including assigning your footer_menu custom template. This literally takes about 2 minutes to accomplish rather than going back and forth experimenting with different hard-coded options.
I guess I've learned to use all the features offered by the concrete5 development environment and only dig in to hard-coding when the front-end is not equipped to solve your specific issue.
As I say, what you accomplished is certainly a fine, workable solution. I'm just giving you some things to think about and try.
Now, onwards to jQuery!!
I certainly appreciate the insight... don't get me wrong.... I simply did what I thought was correct or what worked for me being a novice at this still.... I'll have to re-read your post and try to absorb it more... I understand what you're driving at but don't totally get it... if that makes sense... hahaha
You're right... onward to jQuery fun... will start that once I get up... need a little more rest... :-)
You're right... onward to jQuery fun... will start that once I get up... need a little more rest... :-)
Quick question.... what is the difference between a "fullheader.php" and the "header.php"? This base Concrete theme that I'm using and modifying has both of those files... I had started making updates in the "header.php" file yesterday and now that I'm focused on the header work today, I'm realizing there are two of them... And they both appear to contain the same code accept for one minor difference that the "fullheader" has a body ID specified.
So what's the difference? :-\
So what's the difference? :-\
I don't have access to your theme so I can only suggest that you'd have to look at the very top of your template files (full.php, left_sidebar.php, etc) to see which one has:
$this->inc('elements/header.php');
and which one has:
$this->inc('elements/fullheader.php');
If you go "Edit->Design" and swap your page out for the page type that includes the fullheader.php, you might get a clue as to why they created two different header files.
$this->inc('elements/header.php');
and which one has:
$this->inc('elements/fullheader.php');
If you go "Edit->Design" and swap your page out for the page type that includes the fullheader.php, you might get a clue as to why they created two different header files.
That makes sense.... However, considering that I plan to modify and/or create Page Type templates, I will probably just stick with one and make sure that is being called as the "header" for all of them....
You say it is a concrete5 base theme that you're modifying. Which theme is it? I don't see a 'fullheader.php' in my core themes.
I am using the Boldy theme as the base... you or someone else recommending it over using some others... ;-)
Boldy is nice. When you mentioned it was a 'base' concrete them, I thought you meant a 'core' theme. I'll shut up now and let you get back to work.
No worries man... I appreciate your input and will continue to look forward to it... ;-)
THNX a bunch. Was fidling around with putting page list in footer through page list. This is clean and exactly what i needed.
http://www.weblicating.com/doku/doku.php?id=cheatsheet/...