Posted by leofishman on January 26, 2014 at 6:28pm
I want to make the spaces and subspaces with the same sections structures, its there a way to inheren sections and subspaces when creating a space?
thanks
I want to make the spaces and subspaces with the same sections structures, its there a way to inheren sections and subspaces when creating a space?
thanks
Comments
hello leo on my atrium site i
hello leo
on my atrium site i automatically create subspaces and sections for teams with the rules module. maybe you should give it a try if nobody knows better.
greetings,
leo
sounds good if there is no a
sounds good if there is no a built in featured, do you have an example to look?
i dont have acess to the
i dont have acess to the final version at the moment but here is a draft which creates a subspace in the actual space if a team is created. this code shouldn´t work on a standard oa install cause on my site the parent(space) is a "one to one" relationship and normally it´s "one to many"! it shouldn´t be "set data value" in your case, i think you have to use "add value to a list" instead. (when "entity-created:oa-parent-space" is set!)
{ "rules_teamspace_create_subspace_for_created_team" : {"LABEL" : "teamspace - create subspace for created team",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "OA Grassroots" ],
"REQUIRES" : [ "rules" ],
"ON" : { "node_presave--oa_team" : { "bundle" : "oa_team" } },
"IF" : [ { "entity_is_new" : { "entity" : [ "node" ] } } ],
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "node",
"param_type" : "oa_space",
"param_title" : [ "node:title" ],
"param_author" : [ "node:author" ]
},
"PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
}
},
{ "data_set" : {
"data" : [ "entity-created:oa-parent-space" ],
"value" : [ "node:og-group-ref" ]
}
},
{ "entity_save" : { "data" : [ "entity-created" ], "immediate" : 1 } },
{ "data_set" : {
"data" : [ "node:field-oa-teamspace-ref" ],
"value" : [ "entity-created" ]
}
},
{ "drupal_message" : { "message" : "Space [entity-created:title] has been created." } }
]
}
}