1

I would like to create an alternate node/add page, which can be accessed by a url path, so that I can have an alternate add node page for users while admins can see a different add node page.

This are my current selection rules:

This panel will be selected if Current path is "test", and NOT (Logged in user has role "anonymous user").

I get a 404 error when I access "test". I've tried adding the Node being edited is type "Test". selection rule but it doesn't work either.

  • Nikit is on to something below, but there's some important part of the puzzle missing. "Selection rules" doesn't seem to relevant to your problem, you shouldn't need to be using them, or at least not the way you are trying to do it. I think you need to take a step back and look at some page manager tutorials. – Letharion Mar 30 '14 at 11:27
  • Thanks, I will watch the tutorials by Johan Falk. In the meantime, would you please give me some hints on what you think I'm missing? – ashash Mar 30 '14 at 12:03
  • It sounds to me like you've confused the roles of pages and selection rules with each other. It appears like you expect selection rules to create new URLs. – Letharion Mar 30 '14 at 14:07
  • Yes , I really didn't know about it, but I learnt from Nikit that I must create a page with page manager first. However I'm still facing problems as you can see from my reply to him. – ashash Mar 30 '14 at 15:35
0

You could be more specific about what you meant by add node page. Did you mean node/add page? If thats the case, then I would suggest you use Menu Item Visibility to hide the default add node link and make it visible to only your admin role(s), then create a block containing the add node-type links (eg node/add/article etc) and descriptions the way you want other users to see it, place this block inside your panel page (/test), and create a menu item that links to /test, making this only visible to non-admin users.

Drawback for this is that each time you add a new content type for non-admin users, you have to manually add a link for it to this block

Edit: Alternatively, since you want to achieve this using rules, you can install the Rules Bonus Pack module (You need Rules module for this), the sub-module you want to enable is the "Miscellaneous", then Create Event "Page variant is rendered" Condition "Logged in user has role (your role), Action "Page Redirect" here you add the page "test" without the quotes (dont add a leading slash as in /test). Then you can do whatever you want on that page. Hope this helps.

  • Thank you. I've got that part generally covered by only including certain forms in that panel page and using Field Permissions. My problem is making the panel page (/test) work, and I haven't finished watching the tutorials yet. – ashash Mar 30 '14 at 16:23
  • i have edited the answer to suit your panel rules requirement – IT Pro Manager Mar 30 '14 at 16:28
  • Hmm actually my problem is that I cannot get that "test" page to work. I can actually solve the redirection problem more easily with a url alias and selection rules now that I think about it. – ashash Mar 31 '14 at 17:05
0

Finally solved it! Though with a very simple and dirty solution.

  1. I created a variant for my node add/edit page with the following selection rules:

    This panel will be selected if Node being edited is type "Test", and NOT (Logged in user has role "admin").

  2. Then I made a URL alias for node/add/test for "test"

Thank you all for your time spent helping me. I thought of it while following your instructions.

0

Due to talking from comments, there answer that help:

You cann't alternate node/add/nodetype via Test.
You can create alias Test for node/add/nodetype or you can write custom function, that call node/add/nodetype form via drupal_get_form with some node preparements function.
After this you can apply Panels and so on

First answer was incorrect:
Enable Page manager module (part of CTools), then goto admin/structure/pages and add 'Add custom page', set path to test, save it. Now you can use your Panels that fire for Test page.

  • Thanks! I've managed to create a page at /test, with no content but Panels still didn't fire and /test comes out blank. Are my selection rules wrong? I didn't add any other settings for the Test page. – ashash Mar 30 '14 at 8:43
  • Investigate your logs on site... – Nikit Mar 30 '14 at 10:55
  • Nothing related to my problem in my logs... I'm going to watch some video tutorials for the moment since I'm guessing that I'm missing something simple that I'm not telling you about. (I did enable my panels for that matter) – – ashash Mar 30 '14 at 15:43
  • @ashash You're saying the page comes back as blank, have you added any content to the page? – Letharion Mar 30 '14 at 16:41
  • ok, disable Panels for Test then, and try open it again. – Nikit Mar 30 '14 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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