need help with menu URLs for listings editor role

Events happening in the community are now at Drupal community events on www.drupal.org.
katy5289's picture

I am building a realtor site with Drupal. The property listing module from netrift.com works great!
See http://www.netrift.com/content/ulisting

I have a question about setting up a specific menu for the realtor to edit listings.

I set up a user role for the realtor to add/modify/delete property listings and blog entries. I also set up a menu
for the realtor role. But I'm having problems with the paths. I would like the realtor menu to show up on his profile page when he logs in. But the path on that page is 3 levels eg. localhost/myrealtor/user/ . The realtor menu shows up on the content pages and the menu URLs work on the content pages but there are other pages that have deeper levels and then the menu URLs don't work. For example, the content pages have URLs like this:
localhost/myrealtor/about-us and the user profile page has this path: localhost/myrealtor/users/

I don't want to use absolute URLs because this site in in development on my laptop and I will be uploading it to a web host. So I would prefer to use relative paths.

What's the best way to fix this? Please explain or point me to a tutorial that deals with this problem.

Thanks in advance for your help.

Katy :-)

www.seascapewebdesign.com

Comments

Just start with a forward

rjdempsey's picture

Just start with a forward slash to ensure the link follows the path starting from the site route, no matter where you are linking form. For example, "/myrealtor/about-us instead of just "myrealtor/about-us".

Not sure what your base path is set at on you local setup but you may or may not have to include "/localhost".

need help with base path setup

katy5289's picture

Hi Ryan,

Thanks for your feedback. But "myrealtor" is the name of the folder I have the Drupal site installed in on my laptop. I don't want to use "myrealtor" in the menu URLs at all. Because when I upload the site to the domain name, I won't be using "myrealtor" folder.

So is this a server issue and not a Drupal issue? What is best practice for this? Where can I find info on base path setup?
I'm using Windows Vista and XAMP server on my laptop for development.

Katy :-)

base_path ?

baronmunchowsen's picture

Does this help:

http://api.drupal.org/api/function/base_path/6

<?php
print base_path() . 'about-us';
?>

Should I be using Primary

katy5289's picture

Should I be using Primary Links and Secondary Links for additional menus? Then maybe I won't have this problem. Right now I have set up a block and hand coded the navigation links in html.

Hi Katy. You can create

baronmunchowsen's picture

Hi Katy.

You can create additional menus at /admin/build/menu/add. So you could create on called 'Realtor Menu' or something, which would be seperate from the Primary/Secondary links.

Whenever you create a new menu Drupal will add a block to the blocks page which contains the menu automatically.

You can activate the block as per usual, and use the block visibility settings to show/hide the block on certain pages.

This relates to the base

rjdempsey's picture

This relates to the base path thing I was talking about. Say the site is katanamite.com and I'm linking to katanamite.com/about, what I would usually do in a relative link would be "/about". That should get you to the about page regardless of how deep into the site you are. So ya, if "myrealtor" is like your site name, then you wouldn't need that in the link. However, depending on how you got XAMPP set up, it may be looking at "localhost" as the base url, as opposed to "myrealtor". In that case you would have to use that in the link - "/myrealtor/about-us. But then when you to to the live server, it may be necessary to remove "myrealtor". I hope I'm making sense. I don't know if that's the best way to do it but it will work.

Vancouver

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week