Rules advanced use

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

Hey Fago,
I was at your presentation in Cologne earlier this year and found it very interesting, especially as I'd not come across your module before.

Anyway I'm finally developing a site where I'm using it quite heavily but I have a query which you or the members of the rules group may have an answer to.

On first creation of a node content type 'x' I want to create a node content type 'y' at a specific tokenised url.

So far rule is triggered by creation of node content type 'x', then condition 'does url [og-name]/yyy exist' is checked and negated.

Then if url doesn't exist I would like to create a node of content type 'y' with a specific title to give a predetermined url. This is what I'm not sure about or even whether Rules has this functionality.

The reason for this is specific workflow is that I have created a view block showing a list of content type 'x' and I have made the block visibilty to show on a specific path (the path I'd like to create for my new node content type 'y').

I don't want the node content type 'y' to be created in advance of content type 'x' as there would be nothing to show in the view block on 'y'. Even if it was created in advance the path would still have to be of a predetermined structure.

This is all mixed with organic groups, the view block is og filtered and the content types 'x' and 'y' will be group posts.

The thing that has made this so complicated is that I need to add a cck default tokenised link in node content type 'x' back to the predetermined url [token]/[token]/yyy so that you can get back to the node content type 'y' created. For this reason I want rules to create the node with a specific title so I know in advance the path.

If I let the user create the node than they will add the title which will determine the path.

This has been a bit rambling, sorry about that, but I hope you get the idea.

Any suggestions would be great.

Every other rules I've needed to create for this site has been no problem. Thanks for the module ;-)
Simon

Comments

As usual, just writting out

mrsimonelliott's picture

As usual, just writting out my problem points me in the direction of the answer ;-)
I am going to use the prepopulate module.
My action in rules is page redirect.
I redirect to node/add/name-of-content-type?edit[title]=This is the title
Prepopulate give my node the title "this is the title' then when the node is saved pathauto gives it a path [og-name]/[title]
I can hide the Node title box on the add node page so the user can't alter the pre defined title.

That's it. On creation of node type 'x' rules checks to see if 'y' exists for that group by looking for the url. If it exists it does nothing, if it doesn't it redirects to the node creation for type 'y' with a hidden pre defined title.

Great module
Hope to see you all in Paris on September 1st http://paris2009.drupalcon.org/

Simon

Rules

Group organizers

Group categories

Categories

Group notifications

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