Revolution 2.0.0-pl r7210.
I need to set default values to some template properties, mainly [tt]hidemenu[/tt] and [tt]alias[/tt], so all new documents based on a template are hidden from menus and use specified alias scheme. I thought property sets could be used, but they seem not to work with templates this way.
What can you advice?
This is the web: the only thing you know about who will come is that you don't know who will come.
Use Form Customization, with a Template constraint.
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com
Thanks, it works. However: 1) it affects all templates, not only the one I specified 2) it’s not effective when using Quick Create menu command.
Here’s the rule:
Action: core - resource/create
Name: hidemenu
Containing Panel: modx-panel-resource
Rule: Field Default Value
Value: 1
Constraint Class: modTemplate
Constraint Field: id
Constraint: 2
The template in question has id 2. Is the above constraint correct?
When creating a new resource the default template is used (id 1) and the [tt]hidemenu[/tt] is checked. I expect it to get checked when selecting the template with id 2? Is that, how it’s supposed to work?
This is the web: the only thing you know about who will come is that you don't know who will come.
I was studying
FC-Resource Available Fields and noticed that the following are not taken into account:
- Resource Alias ([tt]alias[/tt])
- Parent Resource ([tt]parent[/tt])
- Deleted ([tt]deleted[/tt])
All those can’t be affected by Form Customization. Is this intentional?
Also, is there any documentation on Constraints usage?
This is the web: the only thing you know about who will come is that you don't know who will come.
This is the web: the only thing you know about who will come is that you don't know who will come.
Quote from: gadamiak at Jul 28, 2010, 05:11 AM
I was studying FC-Resource Available Fields and noticed that the following are not taken into account:
- Resource Alias ([tt]alias[/tt])
- Parent Resource ([tt]parent[/tt])
- Deleted ([tt]deleted[/tt])
All those can’t be affected by Form Customization. Is this intentional?
Also, is there any documentation on Constraints usage?
I think they were just left off the list. They would probably work if you used them.
Constraints (scroll down):
http://rtfm.modx.com/display/revolution20/Form+Customization+Rules
Quote from: BobRay at Aug 18, 2010, 03:47 AM
I think they were just left off the list. They would probably work if you used them.
I did and they didn’t work.
Constraints (scroll down): http://rtfm.modx.com/display/revolution20/Form+Customization+Rules
Thanks! I must have overlooked it. That’s exactly what I needed.
This is the web: the only thing you know about who will come is that you don't know who will come.