Hi,
Gallery Menu Module URL's look like:

http://example.com/gallery/4669

although I activated url rewriting/clean url and I can reach to my albums like:

http://example.com/v/izmir_ephesus_efes/

Is there any way to make menu urls like clean urls above.

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

profix898’s picture

Component: Miscellaneous » gallery_menu.module
Category: support » feature

In principle that should be possible, but its not yet supported. Marking this a feature request for gallery_menu.module. I'm currently busy with porting modules (including gallery*.module) to Drupal 6. But I will revisit this idea once the basic D6 port stands.

profix898’s picture

Priority: Normal » Critical

Raising priority. I'll try to improve url rewrite handling in general (see http://drupal.org/node/179803) and the gallery_menu paths in particular before the next beta (or RC) of the new module will be available. Here is a short todo list:

  1. check for 'gallery/' being part of rewrite rules (and display warning if not on the install tab)
  2. use G2 url rewrite schema/rules to generate paths in gallery_menu.module
profix898’s picture

A problem for #2 is that D5 menu does not support plus signs in paths. It automatically transforms e.g. 'Album+A' into 'Album%2BA', which is not recognized by G2 as a valid path. Is '+' a valid character in urls? Either Drupal or G2 seems to behave incorrectly here. G2 uses '+' to replace spaces in paths, i.e. for an album named 'Album A' G2 generates the url as 'gallery/v/Album+A/'.

profix898’s picture

Status: Active » Needs work
FileSize
2.38 KB

Attached is a patch which makes the Drupal menu paths identical to the G2 album paths. However I cant get this to work correctly. Now that the Drupal paths look as expected the rewrite rules of G2 are interfering with the Drupal rules. I will need to investigate why and how we can prevent that. Also the Drupal menu system doesnt created nested menu items as one would expect for the paths.

profix898’s picture

One of the URL Rewrite rules for G2 look like ...

RewriteCond %{THE_REQUEST} /gallery/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteRule .   /index.php?q=gallery&g2_path=%1   [QSA,L]

As this is at the beginning of the Drupal .htaccess file, every paths with 'gallery/*' is rewritten to '/index.php?q=gallery&g2_path='. Thats good for G2, but Drupal never receives the full path and therefore menu system doesnt work correctly (e.g. it doesnt recognize the path to highlight the active menu item). I'm inclined to say won't fix unless anyone has a good idea here :(

profix898’s picture

Status: Needs work » Needs review
FileSize
3.93 KB

Here is a patch which solves the problems mentioned above. This one is ready for testing. Anyone?

profix898’s picture

Title: Gallery Menu Module URL » use clean urls in gallery_menu
Status: Needs review » Fixed

I've just committed the patch to cvs. Please try and report any issues. I'm not convinced this is the best solution, but there is no clean way to do this (at least none I can think of).

Anonymous’s picture

Status: Fixed » Closed (fixed)