If you would like to have different NewsPublisher pages with different fields and settings, create a separate page for each one with a different snippet tag on each page. The NpEditThisButton, by default launches the page specified in its &np_id property. If you use the following snippet tag for the button, you can have it launch the appropriate NewsPublisher page by creating a TV for each page called NpId and setting the correct NewsPublisher page ID in it:`
[[!NpEditThisButton? &np_id=`[[*NpId]]
Science(78) ----child1 -----child2 ----child3 Religion(89) ----child1 ----child2 ----child3 Phiosophy(74) ----child1 ----child2 ----child3 NewsPublisher(12)
This question has been answered by BobRay. See the first response.
[[!NewsPublisher? &parents=`78,89,74` &parent=`78` //default destination for new NP-created resources &show=`parent` //show the drop down list &required=`pagetitle` //not making a parent choice necessary -goes to default 78 ]]
&parent=`[[*parent]]`
$ph = $this->resource->toArray();
if ($ph['parent'] == 0) {
$ph['parent'] = $ph['context_key'];
}
$ph = $this->resource->toArray();
if ($ph['parent'] == 0) {
$ph['parent'] = $ph['context_key'];
} else {
$this->parentId = $this->resource->get('parent');
}[[!NewsPublisher? &parents=`78,89,74` &parent=`78` //default for brand new resources. Dropdown list is highlighted &show=`parent` //show the drop down list &required=`pagetitle,parent` //since there is always a selection on the dropdown list, no qualm will arise ]]
