Adding Menu Buttons to default.master.php
I had this cracked previously (see here)
However, I've only just got around to having time to add my home button back after the last upgrade and am now having a problem.
As an aside, yes, I did add the changes to the core default.master.php as I'm using the default theme and they were only minor changes that I don't mind redoing when I need to - please don't suggest I write my own theme, I'm not quite there yet
When I try to add the new menu buttons as I did previously, the buttons are setting the target as: > chairexerciseisforyou.net/forum/chairexerciseisforyou.net
Obviously, there's something changed to add the > chairexerciseisforyou.net/forum url before the menu buttons, but I am still completely new to this so don't have a scoobie how to work around it.
Someone must have customised their menu with non-standard buttons, so I'm hoping it will be an easy solution (again), though everytime I search for this I seem to get only people with custom themes or people who can't find the default.master.php file at all!
Can someone please lend me a tiny amount of their valuable time to let me know what to do?
In the meantime, I'm using pockets...
Thank you all again for you time!
Best Answer
-
peregrine MVP
for some reason I thought there already a plugin for this, but i searched and couldn't find one. Here is one.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
2
Answers
i add 'buttons' via a simple plugin. this is the only method in the plugin class...
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Could you explain, what ppl do to deploy this plugin please matt
There was an error rendering this rich post.
well... this is intentionally not a 'deployable' plugin as the way to add/remove link is to mod the code... to make it a deployable plug i would need to write a dashboard settings controller and manage the button defs somewhere (either db table or config)
that's why it's not released as a plug.
but to build your own its easy peasy. follow the instructions on http://vanillawiki.homebrewforums.net on how to create a plugin from scratch. inside the class definition add the method listed above.
modify the information in each AddLink(Name of button, Text for button, link for button)
Add or remove as many $Sender->Menu->AddLink lines as you want in each of the two sections i set up. the first group of addlinks re links that will be added for all vistitors to the site, guest or registered members. the second section limits those links to only logged in users.
and who is matt?
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Mate sorry, bloody ipads.
Cheers fir that , will check in a bit.
There was an error rendering this rich post.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Thanks for the reply
Not a great solution for someone who doesn't know what any of that goobledegook means, but I'll take a look and give it a go as I really should learn...
Will get back to you!
Basically, he's written the plugin for you.
Add the description block with your name and the name you want to give the plugin and change the menu names and place it in a plugin directory with exactly the same name as you defined.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
for some reason I thought there already a plugin for this, but i searched and couldn't find one. Here is one.
http://vanillaforums.org/addon/addmenuitem-plugin
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I thought he was telling me what code to put in a plugin once I'd built it...
BUT I like your solution much better Peregrine! I feel like someone has built a plugin just for me - even though I know it will benefit many others!
Will be trying it out tonight Aussie time. Thank you very much!
Goodonya peregrine , good luck mummypig
There was an error rendering this rich post.
Yeah, it works! Couldn't wait until later to check it, had to do it right away. Very simple to use too. Thank you again!!
It does lead me to the question of what I need to do to make the buttons I've added appear at a particular spot on the menu bar... any ideas?
Css , the menu can be tricky because in std mode it uses margin positioning.
Are you referencing home | youtube | spark people ? menu
on this page: http://chairexerciseisforyou.net/forum/
There was an error rendering this rich post.
Yeah. Just wondering if I could rearrange it so I could have easily change the position of 'mark all viewed', perhaps so it came after 'discussions'.
It's nothing to do with the plugin, more to do with my lack of knowing which files to change where. And, if it's PHP involved, with what!
So, if it's CSS I can likely work it out once I know which file to change. Any heads up on that?
And thanks again.
PS - would be interested in knowing what you both think of the site layout etc. It's designed for a specific group of people who asked for my help and needed to be as accessible and simplistic as possible. Some are partially sighted and use readers, so I've tried to avoid java where possible (though most commercial readers now cope with it).
I like different. So yuuup all good.
Its hard for us to know what is being fired with php, because we are client side.
But i would wrap new menu in a div and give it a class, that can be positioned and styled accordingly.
Also menus are easier controlled wrapping in unordered lists, you can then scale easier.
There was an error rendering this rich post.
_aargh... cancelling when in edit mode deletes your post....
_
Yes 422, I would like to reposition 'mark all viewed' so it comes before the buttons I've added.
If it's a case of CSS, I can work it out if I know which file. I thought it might be the general style.css file, but all that seems to show is that the menu items are a simple unbulleted list, displayed inline, and not the position of each item.
So, I had a look at the default.master.php file, but discovered that 'mark all viewed' doesn't appear as a menu item there.... no idea where to look now as there's lots of files....
Edited to add: and then your post comes back later again when you've already written another...
rearranging title in menu may work with this
$Configuration['Garden']['Menu']['Sort'] = array('Discussions', 'Conversations', 'User', 'Questions', 'Activity', 'Applicants', 'Dashboard');
but then again it may not.
rearranging titles that are added through addtitle don't see to work with the above.
I suppose you could try reseting the array with
$Sender->Menu->Sort =
or with jQuery (try running the below to show how to reverse the links in menu on this board - it will view in a pop-up box - but you get the idea, no)
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
The issue is:
< a href="http://chairexerciseisforyou.net">Home</ a>
< a href="http://www.youtube.com/ChairExercise?feature=mhee">YouTube</ a>
< a href="http://sparkpeople.com/">SparkPeople</ a>
You must wrap the menu items in a div class like:
There was an error rendering this rich post.
Issue being you have your new menu within content block, and the menu is within header block.
Absolute positioning of a div for the sub menu ( new one ) can be done, but gets messy because we are cross nesting elements
There was an error rendering this rich post.
My mistake. I didn't hone in on the issue at hand.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.