Module: Custom Menus

rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2011-07-04 21:43

Custom menus is a module for Gallery 3 that allows admin's to add additional menu items to the menu bar at the top of the page, after the "Home" link. These menu items can link to internal or external pages and can have sub items of their own.

To create new menu's, select Admin -> content -> Custom Menus Manager, and then click the add new menu link. Enter in a title and a URL for the menu item to link to, then press Create menu (if this menu item is to contain sub-items, leave the URL field blank). To add sub menu's, press the "+" link next to an existing menu. Use the "^" and "v" links to move a menu item up or down one position.

Screenshot:
[img]http://gallery.menalto.com/files/Custom_menus.jpg[/img]
---
Report Problems/Suggestions Here | Get latest version | Documentation | Coffee Fund | My Library | My GitHub

AttachmentSize
Custom_menus.jpg57.59 KB
 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Fri, 2011-07-08 14:32

Absolutely excellent rWatcher, many thanks for your work.
I'm using your Pages module to create static pages but not ticking the display option box.
Then creating menus with the Custom Menus module incorporating URLs to the static pages created in Pages module.
This combination is just what I'm looking for. :-)

 
fotoron

Joined: 2010-04-25
Posts: 32
Posted: Sat, 2011-07-09 05:19
zjohn13 wrote:
I'm using your Pages module to create static pages but not ticking the display option box.
Then creating menus with the Custom Menus module incorporating URLs to the static pages created in Pages module.

Hint: In this setup you can use .htaccess rewrite rules to have url's without "/pages/show/".
Use friendly url's in the Custom Menus entries, then use .htaccess to point them to the right url.

Example:

RewriteRule ^about$ /pages/show/about [nocase]
RewriteRule ^gear$ /pages/show/gear [nocase]
RewriteRule ^contact$ /contactowner/emailowner [nocase]

www.yourdomain.com/about is redirected to www.yourdomain.com/pages/show/about
There is no [R] (rewrite) in the the rewrite lines, so the browsers location-bar doesn't change.

You must have a working .htaccess of course. Put the lines above the ones that remove "index.php".


www.ronvanrossum.com | Gallery 3.0.2 (Coollanta) | Grey Dragon Theme 3.0.8 (carbon custom)

 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Mon, 2011-07-11 14:49

I can see where you are coming from with this approach fotoron but I'll stick with the Pages module for now because it makes page editing convenient.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2011-07-21 17:45

I've updated this module to allow menu items to be translated. The latest version can be downloaded from here.

 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Mon, 2011-09-19 08:57

Is it possible to open a html file page via a menu link and have it displayed within the gallery theme in the same way that a Pages module page displays?
Currently it opens the page full screen.
Thanks.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2011-09-19 16:23

You'd have to theme the html page to match the Gallery theme. Either that, or create a custom module like Pages that loads html from a file instead of from the database.

 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Tue, 2011-09-20 08:19

Thanks again rWatcher. I've taken the easiest option that you suggested and have hijacked the required bits of css into the html page style so that the page looks the same as my "Pages module" pages albeit displayed full page and that's a good compromise.
(I took this approach because the page content is too big to fit into a Pages module page. This is the page http://www.chilternphoto.org.uk/g3extras/ex11_comments.htm ).

 
chris3design
chris3design's picture

Joined: 2010-12-16
Posts: 6
Posted: Thu, 2011-10-06 11:33

great tool! thx!
Chris

www.worldofinfinity.com

 
jack96
jack96's picture

Joined: 2011-11-19
Posts: 2
Posted: Sat, 2011-11-19 18:36

Thanks for the module !!

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2011-12-19 05:24

Very nice module you created there rWatcher !

I am thinking of creating my own albums navigation with it instead of using the albumtree...

It works well for me.

I would have two suggestions :

1) ability to input an URL even if the menu has a submenu
2) in the admin page, you could add a dynamic navigation system as the dtree in album tree, allowing the user to close or open each menu, which will give a much clearer navigation.... for the ones like me with so many albums and sub albums... :-)

Great work ! thank you

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Fri, 2011-12-30 06:37

I am trying to customize the color of the menu but can't find the way to change the background of a sub-menu without a link.

When a sub-menu gets a link, it automatically gets a class called g-menu-link, which I can customize in the css.
But when the sub menu does not have a link, it only gets a style display...

I tried to add a g-menu class but it does not change the background color...

What am I doing wrong ?

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Fri, 2011-12-30 06:42
petri wrote:
I am trying to customize the color of the menu but can't find the way to change the background of a sub-menu without a link.

When a sub-menu gets a link, it automatically gets a class called g-menu-link, which I can customize in the css.
But when the sub menu does not have a link, it only gets a style display...

I tried to add a g-menu class but it does not change the background color...

What am I doing wrong ?

sorr, sorry just found the solution..... I had forgotten on line in the css

 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Sat, 2012-03-24 12:53

Nice feature. I'll try it.

http:\\photo.marktim.ru

 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Thu, 2012-04-05 08:09

Excellent working module.
It replaces many modulens by one.
Great implementation but need MultiLanguidge functionality.
The Gallery itself have it.

For content translation there is another excellent module "Multilingual G3" http://gallery.menalto.com/node/98170?page=3.
You can contact developer of ML module
http://gallery.menalto.com/privatemsg/msgto/228499

What do you think about Language versions of this excellent menu, RWatcher?

http://photo.marktim.ru

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-04-17 05:21
krikman wrote:
Great implementation but need MultiLanguidge functionality.
The Gallery itself have it.

The menu titles can be translated via Gallery's built-in translation system. Does Multilanguage use something different?

 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Thu, 2012-05-03 13:41

Sorry, I don't ever know how to make it and where is built-in translation?

Multilanguage adds different codepage properties to custom fields: Item title, Item path, Item description. For albooms too.

Do you give me any directions for Gallery's built-in translation system?

http://photo.marktim.ru

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-05-03 16:29
 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Thu, 2012-05-03 18:55

Thank you very much. It is really easy and very useful!
Also I can edit some dumb or formal translations already in G3.

Community rules!

http://photo.marktim.ru

 
jadanhi

Joined: 2012-05-10
Posts: 1
Posted: Thu, 2012-05-10 13:44

Como removo o link HOME criado automaticamente?

How do I remove the HOME link created automatically?

Thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-05-10 15:12
 
teodorsavic

Joined: 2012-07-19
Posts: 10
Posted: Sun, 2012-08-12 18:19

is there any way to input an URL even if the menu has a submenu?

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Mon, 2012-08-13 01:35

same as teodorsavic, I would love to be able to input an URL to a parent album

------
Gallery 3 URL = http://www.coquille.org/gallery
Version: 3.0.2 (Coollanta)
Operating system: Linux 2.6.18-194.32.1.el5
Apache: Apache/2.2.3 (Red Hat)
PHP: 5.2.6
MySQL: 5.0.77
Server load: 1.31 1.58 1.53
Graphics toolkit: gd
-------

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-08-14 00:46
teodorsavic wrote:
is there any way to input an URL even if the menu has a submenu?

No, Gallery's menu system doesn't allow it.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-08-14 02:30

with javascript anything is possible.

prepend a link to your site's home page:

$("#g-site-menu>ul").prepend('<li><a href="/">Main Site</a></li>');

change the text on the default home link:

$("a.g-menu-link:contains('Home')").text('Gallery Home');

easy peasy

-s
All New jQuery Minislideshow for G2/G3

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Tue, 2012-08-14 03:17

Hi Supersidr,

thank you for your answer, but....being a big fan of Java......I don't understand a word you're writing :-)))

You mean that if I add this code

Quote:

$("#g-site-menu>ul").prepend('<li><a href="/">Main Site</a></li>');

$("a.g-menu-link:contains('Home')").text('Gallery Home');

......but where ?..... in the module, I could then add a link to a parent album through the custom menu module and it would work ?

------
Gallery 3 URL = http://www.coquille.org/gallery
Version: 3.0.2 (Coollanta)
Operating system: Linux 2.6.18-194.32.1.el5
Apache: Apache/2.2.3 (Red Hat)
PHP: 5.2.6
MySQL: 5.0.77
Server load: 1.31 1.58 1.53
Graphics toolkit: gd
-------

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-08-14 11:43

Gallery uses jQuery and superfish javascript for creating the flyout menus.
With a little knowledge you can select specific parts of the DOM and manipulate them very easily.
Including adding/removing/altering elements of your menu.

-s
All New jQuery Minislideshow for G2/G3

 
soundlover

Joined: 2012-09-08
Posts: 10
Posted: Sun, 2012-09-09 18:34
zjohn13 wrote:
Absolutely excellent rWatcher, many thanks for your work.
I'm using your Pages module to create static pages but not ticking the display option box.
Then creating menus with the Custom Menus module incorporating URLs to the static pages created in Pages module.
This combination is just what I'm looking for. :-)

Same thing here. :)

Thanks for this module.

 
bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 421
Posted: Fri, 2012-11-16 01:14

Thanks, it works fine now for me.

 
tseyigai

Joined: 2012-11-06
Posts: 47
Posted: Fri, 2012-11-16 02:41

This is great! I'm having an issue though. I was able to get them to show up and I added four menu items and they worked well. I saved them, logged off, and then wen to my site, and then they don't show up. I decided to download the menu items again, and did the same procedure yet again, and the same result happened.

What am I doing wrong here?

Here's my site: http://www.stephenhansonartist.com

 
bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 421
Posted: Fri, 2012-11-16 02:51
tseyigai wrote:
This is great! I'm having an issue though. I was able to get them to show up and I added four menu items and they worked well. I saved them, logged off, and then wen to my site, and then they don't show up. I decided to download the menu items again, and did the same procedure yet again, and the same result happened.

What am I doing wrong here?

Here's my site: http://www.stephenhansonartist.com

Same as my problem last several hours.

Here is solution:

You need go to theme options and tick on: Show Main Menu for Guest Users -> Save change.

 
bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 421
Posted: Fri, 2012-11-16 05:26

Hi,

I have this question: How to add an icon before each parent menu?

Thanks.

 
tseyigai

Joined: 2012-11-06
Posts: 47
Posted: Fri, 2012-11-16 13:27
bigu_c wrote:
tseyigai wrote:
This is great! I'm having an issue though. I was able to get them to show up and I added four menu items and they worked well. I saved them, logged off, and then wen to my site, and then they don't show up. I decided to download the menu items again, and did the same procedure yet again, and the same result happened.

What am I doing wrong here?

Here's my site: http://www.stephenhansonartist.com

Same as my problem last several hours.

Here is solution:

You need go to theme options and tick on: Show Main Menu for Guest Users -> Save change.

[b]OK, will try that. thanks