Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function: multi-level navigation. / Plugin for version 2!
#51
Pixelounge Wrote:more details on why this might be happening.
Yeah, that’s pretty much what’s happening, as I said, menu_data() is returning invalid slugs. So the only way this is going to work is when I write around menu_data() … which I now did.

To get multi-level navigation working on GS2 you can just download this plugin and menu_master() will be available once more in your themes. It will work both with and without fancy URLs. It also has a new sorting function which sorts the menu items alphabetically if they have the same priority.

Please note that it’s my first plugin and more or less just ports the old function. I’m working on a plugin that pretty much reworks the whole navigation way, but that one might take a while.

Download Zegnåt’s multi-level navigation.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#52
Thanks.

Just a goofy question:

How do I actually use the new plugin?
It's not a function addition anymore.
Where does it go?

Thanks.

homershines
Reply
#53
homershines Wrote:Thanks.

Just a goofy question:

How do I actually use the new plugin?
It's not a function addition anymore.
Where does it go?

Thanks.

homershines

I think you just have to place Zegnåt's php inside admin/plugin/ and you're good to go. Never used plugins (I've started using GetSimple yesterday) but the Codex indicates this method.

Hope this was helpful,
Pixelounge
Reply
#54
Pixelounge Wrote:I think you just have to place Zegnåt's php inside admin/plugin/ and you're good to go. Never used plugins (I've started using GetSimple yesterday) but the Codex indicates this method.
Yeah, that’s pretty much all you have to do. Once it’s in that folder you’ll find the function to work again in your templates. To be sure of there not being any conflicts you might want to remove it from your functions.php though.

Let me know how it works out!
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#55
Hello everyone,

first, excuse my bad english;
I'm from Germany and
I went to school 25 Years ago.


Back to Topic:

I try out to install the multi-level navigation
and put the Zegnåt's php inside the admin/plugin/ folder.

But it seems I'm to stupid to run the plugin.

Is there anything else to change in my Theme to use
this plugin? In wich order I have to define the Pages?

I hope, someone may help me.
By the way, GetSimple is the greatest CMS I ever saw.
Great Job!!!

loxxi
Reply
#56
Everything from my first post still holds true, you’ll have to change your theme so it will call the menu like this:
Code:
<?php menu_master(); ?>
Then you should be good to go.

Let me know whether you get it to run.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#57
Updated the plugin, I forgot sorting on the sub menus so those are now there. Also forgot to close the PHP, so that needed to be fixed.

Let me know whether there are any more problems!
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#58
What would be the implications of hooking menu_master() to the get_navigation() function? I think this would make it even easier for users.

PS: I hope I didn't misunderstood the purpose of add_action() Smile
Reply
#59
The problem would be that I don’t know of a hook that would let me redefine an existing function. If you have any ideas on that I would love to just overwrite the original one.

So that’s not going to happen (yet).
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#60
I think add_action('page_navigation','menu_master') could do the trick.

Edit: In fact I am wrong. It seems I misunderstood the whole add_action concept.
Reply
#61
@Zegnåt

Quote:Then you should be good to go.

Yes, it rocks! Thank's for this Tipp.

Ähm, another Question:

I try to install your component_master()

Quote:If you want to use it for your template just put it in the functions.php that you have (or must create) in your theme folder.

In the latest Version there is no functions.php in the template.
I create the file but it still do not work.

Any Tipps for me (german newbie)?

Thanks a lot... loxxi
Reply
#62
loxxi Wrote:In the latest Version there is no functions.php in the template.
I create the file but it still do not work.
If you’re using GetSimple 2.0 (as you should) all you need is the plugin. You don’t need any functions.php file anymore.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#63
Quote:You don’t need any functions.php file anymore

I create this file (for the component_master() not for the menu_master())
and now it works fine. First, I forgot to rename my component name.

However, Thanks for all and sorry for my bad english.


loxxi
Reply
#64
Hi everybody,

Getsimple looks terrific and I can't wait to get start designing.

I don't know much about configuring dev environments and I've hit a glitch with multilevel menu. I'm guessing (for what it's worth) that the error messages below mean a permissions issue, and that I haven't correctly applied the Win 7 equivalent of CHMOD 557.

I hope it's obvious to the experts here.

Any help would be fantastic.

Jeff

I'm running ...

Wampserver 2.0.i on Win 7
Apache 2.2.11 (with mod_rewrite loaded)
PHP 5.3.0
GetSimple 2.0


Code:
Warning: Missing argument 7 for register_plugin(), called in F:\wamp\www\getsimple\admin\plugins\zegnat-multilevelmenu.php on line 11 and defined in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 112

Warning: Missing argument 8 for register_plugin(), called in F:\wamp\www\getsimple\admin\plugins\zegnat-multilevelmenu.php on line 11 and defined in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 112

Notice: Undefined variable: type in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 121

Notice: Undefined variable: loaddata in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 123
Reply
#65
Martijn, I fixed the first two errors there in the SVN. register_plugin should have had default values of "null" because really only the first two are required for the plugin to work.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#66
Jeff, the current setup you have for localhost is nearly identical to mine. I'm running 5.2.x instead of 5.3. Anyway, when on localhost, with that setup, you NEVER have to worry about file permissions. All files on your setup already have full read, write, and execute access so just ignore any permissions modifications you run into.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#67
My plugin is leaving out certain register calls to the core that aren’t needed. PHP warnings are often hidden and then they don’t show up. As Chris just said, the next version of GetSimple will not even display the warnings any more because the plugin function in the core has been updated.

I don’t think I’ll be updating the plugin right now as it will add code that will be unnecessary in the next version of GS.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#68
I'm afraid I assumed that those red herring error messages were the cause of my actual problem, which is that the HTML stops parsing once it hits the ul#nav element:

Code:
<body id="index">
    <div id="wrapper">
        <div id="header">
            <ul id="nav">
            </ul>
        </div>
    </div>
</body>

What do you suppose I've missed?

Cardinal is set as the active theme. The multilevel plugin is in admin/plugins and the function call is in Cardinal's template.php, here:

Code:
<ul id="nav">
            <?php menu_master(); ?>
</ul>

Very unlikely, but perhaps it's how I've set up the pages in the admin interface. If not, it would still be nice to know how to set this up correctly (the conversation above is a little confusing since the code was still being ironed out). So here's an example.

I created an "About" page / menu item and two subpages / submenu items, About 1 and About 2. The current settings are below. I've tried changing the parent page of About to index, and I've tried assigning a priority levels to each.

Welcome to GetSimple!
  • slug/URL: index
  • parent page: --None--
  • template: -- Default Template --
  • add to menu: yes
  • menu text: Home
  • priority: 20

About
  • slug/URL: about
  • parent page: --None--
  • template: -- Default Template --
  • add to menu: yes
  • menu text: About
  • priority: 19

About 1
  • slug/URL: about1
  • parent page: about
  • template: -- Default Template --
  • add to menu: yes
  • menu text: About 1
  • priority: -

About 2
  • slug/URL: about2
  • parent page: about
  • template: -- Default Template --
  • add to menu: yes
  • menu text: About 2
  • priority: -

I'm sorry if I missed this in another post.

Any help would be greatly appreciated.

Jeff
Reply
#69
You are using the plugin and the latest stable built of GetSimple? There shouldn’t be any problems than…
You’re not getting any other error messages? :/
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#70
Thanks so much for the help.

I'm using the stable release.

Javascript and Flash 10 are enabled in Firefox 3.5.8.

Wampserver's index.php view shows that SimpleXML is a loaded extension, but I don't see SMTP Server on that list. Incidentally, neither SimpleXML nor SMTP Server is listed as loaded or unloaded on Wampserver's little control panel (accessed via the tray icon). I don't know where either is enabled or disabled.

I searched for the string 'SMTP' in php.ini and found this:

Code:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

Is this a clue? When I attempt to view php_error_log.txt, the system tells me it can't find the file and asks if I'd like to create it. Odd, considering I'm generating PHP errors every time I refresh the page. [edit: turns out the errors are being written to getsimple\data\other\logs]

These are all the error messages that display on the page that's not parsing (http://localhost/getsimple/):

Code:
Warning: Missing argument 7 for register_plugin(), called in F:\wamp\www\getsimple\admin\plugins\zegnat-multilevelmenu.php on line 11 and defined in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 112

Warning: Missing argument 8 for register_plugin(), called in F:\wamp\www\getsimple\admin\plugins\zegnat-multilevelmenu.php on line 11 and defined in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 112

Notice: Undefined variable: type in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 121

Notice: Undefined variable: loaddata in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 123

Warning: call_user_func_array() expects parameter 2 to be array, null given in F:\wamp\www\getsimple\admin\inc\plugin_functions.php on line 76

Fatal error: Call to undefined function menu_master() in F:\wamp\www\getsimple\theme\Cardinal\template.php on line 35

Thanks for your patience. Please let me know if there's any diagnostics I could run that might help.

Jeff
Toronto

ps - I'm impressed with GetSimple and I'll slog out troubleshooting for as long as it takes. GetSimple has a very lean bandwidth profile, which is critical to the First Nations audience of my client's current project. A typical First Nations community in Northern Ontario is apportioned only 1.544 Mbps -- total! -- and pays over CAN $2,000 in monthly carrier/access charges for it.
Reply
#71
Solved. The problem was PHP 5.3.

I downgraded Apache (to 2.0.63) and PHP (to 5.1.6) and, voila, multi-level navigation.

For anybody else in my shoes, it's fairly straightforward to downgrade with Wampserver:

http://www.wampserver.com/phorum/read.php?2,60567

Thanks for the plugin, Zegnåt!

Big Grin
Reply
#72
that stinks - You shouldn't have had to do that. I think once 2.01 comes out php 5.3 would have worked. Did you get a chance to try it? http://get-simple.info/forum/viewtopic.php?id=432
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#73
ccagle8 Wrote:that stinks - You shouldn't have had to do that. I think once 2.01 comes out php 5.3 would have worked. Did you get a chance to try it? http://get-simple.info/forum/viewtopic.php?id=432

Environment pain is par for the course. At least downgrading was a breeze and it's not like my PHP skillz are so advanced that I'll even notice the difference. I just wish I'd tried it earlier.

I'll give 2.01 a quick spin next time I'm working, but I'm still mostly focused on the stable release for some pressing client work. Is there any particular functionality you'd like tested in Win 7?

Hockey game now! Everything else secondary ...

Jeff
Toronto
Reply
#74
Jeff Wrote:Hockey game now! Everything else secondary ...
It was a great game. Even though the US lost, at least it was at the hand of my home-town guy!
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#75
ccagle8 Wrote:It was a great game. Even though the US lost, at least it was at the hand of my home-town guy!

Fantastic hockey. Yeah, the yanks lost but that extra man goal must have spilled hundreds of pounds of nachos, fries, wings, pretzels, etc., south of the border. Toronto's gone nuts. It's really loud out there.

Ex-pat Haligonian? Beautiful city.
Reply




Users browsing this thread: 1 Guest(s)