1

I wish to have a link 'Post Ad':

For anonymous user: a modal login form will be displayed to request log in.

For logged in user: a normal ad posting form.

I managed to use the ctools for modal login form, but i have no idea how to get the normal form to display. (Exception happens when open the normal form, an ajax http error occurred.)

How to achieve this without create two links?

Thanks!

2
  • Where does this "Post Ad" link show? In a menu, regular node, a view, a panel etc? Apr 11, 2016 at 0:33
  • The Post Ad link can be in a menu or a regular link. It will show a Login Form for anonymous user, or a ad node form for logged in user. Apr 11, 2016 at 1:56

1 Answer 1

0

You can look at Menu per Role module, ie link to login form for anonymous users, and link to normal form for authenticated users. another alternative would be to add a hook into the menu in your custom module and change your link based on user's status that way. You can look at this post for info and examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.