Provides guidance on using CrestApps Content Fields in Orchard Core: PhoneField (E.164 validation), AddressField (country-aware editing), and Conditional Fields (show/hide rules). Includes migration, recipe, and query patterns.
Ships in crestapps-orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an Orchard Core expert. Generate focused code, migrations and recipes for the CrestApps content fields: PhoneField (international phone numbers stored in E.164 with their country), AddressField (a postal address laid out and validated for its country) and Conditional Fields (show any content field only when other answers say so).
CrestApps.OrchardCore.ContentFields in the web or startup project, never only in a class library.CrestApps.OrchardCore.ContentFields for PhoneField. It depends on CrestApps.OrchardCore.Resources, CrestApps.OrchardCore.PhoneNumbers, OrchardCore.ContentFields and OrchardCore.ContentTypes.CrestApps.OrchardCore.ContentFields.Address for AddressField. It depends on CrestApps.OrchardCore.Addresses, OrchardCore.ContentFields and OrchardCore.ContentTypes, and is separate so the phone field does not pull in Addresses.PhoneField and AddressField. Fields live in CrestApps.OrchardCore.ContentFields.Fields; settings and InitialCountryMode in CrestApps.OrchardCore.ContentFields.Settings.CrestApps.OrchardCore.ContentFields.Abstractions package (namespaces unchanged). A class library that only reads or writes PhoneField/AddressField values references the abstractions package instead of the module.PhoneNumber in E.164 form (for example +14155552671) and CountryCode as ISO 3166-1 alpha-2, because countries can share a calling code.IPhoneNumberService.IsValidNumber() and normalizes with TryFormatToE164(); see the orchardcore-phone-numbers skill.AddressFieldIndex rather than loading every item.intl-tel-input; the field's own international-telephone-editor resource depends on the shared one.CrestApps.OrchardCore.ContentFields.ConditionalFields for Show this field when rules on any field. It depends only on OrchardCore.Contents and OrchardCore.ContentTypes. Feature IDs are in ContentFieldsConstants.Features (ContentFields.Abstractions).CrestApps.OrchardCore.Recipes for recipe JSON Schema support of both fields and of ConditionalFieldSettings.| Feature ID | Purpose |
|---|---|
CrestApps.OrchardCore.ContentFields | PhoneField, its display and settings drivers, the international-telephone-editor script and style |
CrestApps.OrchardCore.ContentFields.Address | AddressField, its drivers, AddressFieldIndex and Liquid member access |
CrestApps.OrchardCore.ContentFields.ConditionalFields | ConditionalFieldSettings on every field, server-side hiding, the crestapps-conditional-fields and crestapps-cascading-picker scripts, value readers |
CrestApps.OrchardCore.Recipes | Adds PhoneFieldSchemaDefinition and AddressFieldSchemaDefinition when enabled with the field features |
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.ContentFields",
"CrestApps.OrchardCore.ContentFields.Address",
"CrestApps.OrchardCore.Recipes"
],
"disable": []
}
]
}
| Property | Meaning |
|---|---|
PhoneNumber | Normalized E.164 phone number |
CountryCode | ISO 3166-1 alpha-2 region used by the editor |
NationalNumber | Local number without the calling code |
PhoneFieldSettings | Default | Meaning |
|---|---|---|
Hint | null | Editor help text |
Required | false | Rejects an empty number |
InitialCountryMode | Globe | Globe (no preselection), CurrentCulture (region of the request culture, none for neutral cultures such as en), or Specific |
SpecificCountryCode | null | ISO code preselected in Specific mode; the settings driver clears it for other modes |
using CrestApps.OrchardCore.ContentFields.Settings;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
namespace MyModule.Migrations;
public sealed class ContactMigrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public ContactMigrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterPartDefinitionAsync("ContactPart", part => part
.WithField("Phone", field => field
.OfType("PhoneField")
.WithDisplayName("Phone number")
.WithPosition("1")
.WithSettings(new PhoneFieldSettings
{
Hint = "Enter an international phone number.",
Required = true,
InitialCountryMode = InitialCountryMode.Specific,
SpecificCountryCode = "US",
})));
return 1;
}
}
Register it with services.AddDataMigration<ContactMigrations>(); in the owning module's startup.
PhoneFieldDisplayDriver uses the stored CountryCode on edit; for older records without one, it resolves the region from PhoneNumber and derives a national number only when none is stored. A required field rejects an empty number, and an invalid number adds a model-state error. The editor uses the intl-tel-input library from CrestApps.OrchardCore.Resources (see orchardcore-crestapps-resources).
AddressField.Address holds the shared Address model of the Addresses module (CrestApps.OrchardCore.Addresses.Models), or null when nothing was entered: Name, Company, AddressLine1, AddressLine2, DependentLocality, City, Region (ISO 3166-2 subdivision code without the country prefix, when the country lists regions), County, District, PostalCode, SortingCode, Country (ISO 3166-1 alpha-2) and Phone. A type can have several, such as Home and Work.
AddressFieldSettings | Default | Meaning |
|---|---|---|
Hint | null | Help text above the address |
Required | false | An address must be entered; an optional blank one is stored as null |
ShowName, ShowCompany, ShowPhone | true, true, false | Which extra lines the editor asks for |
Countries | null | ISO codes offered; empty offers every country ICountryService lists |
DefaultCountry | null | Country a new address starts in |
The editor is the Addresses module's AddressEditor shape bound under the field prefix and validated by IAddressEditorService, so required parts, postal code patterns, region lists and postal-code-in-region checks follow the chosen country. The AddressField display shape prints through IAddressFormatter. AddressField and Address are registered for Liquid member access. See the orchardcore-addresses skill for the address services.
using CrestApps.OrchardCore.ContentFields.Settings;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
namespace MyModule.Migrations;
public sealed class VenueMigrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public VenueMigrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterPartDefinitionAsync("Venue", part => part
.WithField("Location", field => field
.OfType("AddressField")
.WithDisplayName("Location")
.WithSettings(new AddressFieldSettings
{
Required = true,
ShowCompany = false,
Countries = ["US", "CA"],
DefaultCountry = "CA",
})));
return 1;
}
}
AddressFieldIndex (namespace CrestApps.OrchardCore.ContentFields.Indexes, a ContentFieldIndex) has one row per address field with Country, Region, City and PostalCode. Its provider (AddressFieldIndexProvider : ContentFieldIndexProvider) maps published and latest versions, so it is never single-record per document.
using CrestApps.OrchardCore.ContentFields.Indexes;
using OrchardCore.ContentManagement;
using YesSql;
namespace MyModule.Services;
public sealed class VenueQueries
{
private readonly ISession _session;
public VenueQueries(ISession session)
{
_session = session;
}
public Task<IEnumerable<ContentItem>> GetOntarioVenuesAsync()
=> _session
.Query<ContentItem, AddressFieldIndex>(index =>
index.ContentType == "Venue" &&
index.Country == "CA" &&
index.Region == "ON" &&
index.Published)
.ListAsync();
}
Every field's settings gain Show this field when, stored as ConditionalFieldSettings.ShowWhen (a ConditionRule from CrestApps.OrchardCore.Conditions: Match All or Any, Conditions of Source, Operator, Values, and nested Groups). A source is another field as {TypePartName}.{FieldName} or a module-provided value name (such as the Tickets TicketCategory). Operators: Is, IsNot, IsOneOf, IsNoneOf, IsEmpty, IsNotEmpty, Contains, NotContains, StartsWith, EndsWith, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, Between, CountAtLeast, CountAtMost, IsOrUnder (see references/conditional-fields.md).
using CrestApps.OrchardCore.Conditions;
using CrestApps.OrchardCore.ContentFields.Settings;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
namespace MyModule.Migrations;
public sealed class DeviceRequestMigrations : DataMigration
{
private readonly IContentDefinitionManager _contentDefinitionManager;
public DeviceRequestMigrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterPartDefinitionAsync("DeviceRequest", part => part
.WithField("IsLaptop", field => field
.OfType("BooleanField")
.WithDisplayName("Is it a laptop?"))
.WithField("LaptopModel", field => field
.OfType("TextField")
.WithDisplayName("Laptop model")
.WithSettings(new ConditionalFieldSettings
{
ShowWhen = new ConditionRule
{
Match = ConditionMatch.All,
Conditions =
[
new Condition { Source = "DeviceRequest.IsLaptop", Operator = ConditionOperator.Is, Values = ["true"] },
],
},
})));
return 1;
}
}
IContentConditionSource (non-field values), IContentFieldValueReader (your field type), IContentFieldVisibilityProvider (hide fields for your own reason) and read the outcome with IContentFieldStateService, all in CrestApps.OrchardCore.ContentFields.Conditions.TaxonomyCascadingPicker shape picks a taxonomy term level by level; TaxonomyTermTree.From(taxonomy) walks terms without the Taxonomies module.Read conditional fields for the server pipeline, the built-in readers, a custom reader, the recipe shape and the cascading picker.
With CrestApps Recipes enabled, both fields have a content-definition settings schema and a content payload schema.
{
"steps": [
{
"name": "ContentDefinition",
"ContentParts": [
{
"Name": "ContactPart",
"ContentPartFieldDefinitionRecords": [
{
"Name": "Phone",
"DisplayName": "Phone number",
"ContentFieldDefinition": {
"Name": "PhoneField"
},
"Settings": {
"PhoneFieldSettings": {
"Required": true,
"InitialCountryMode": "Specific",
"SpecificCountryCode": "US"
}
}
},
{
"Name": "Mailing",
"DisplayName": "Mailing address",
"ContentFieldDefinition": {
"Name": "AddressField"
},
"Settings": {
"AddressFieldSettings": {
"Required": false,
"ShowPhone": false,
"DefaultCountry": "US"
}
}
}
]
}
]
},
{
"name": "content",
"data": [
{
"ContentType": "Contact",
"DisplayText": "Example contact",
"ContactPart": {
"Phone": {
"PhoneNumber": "+14155552671",
"CountryCode": "US",
"NationalNumber": "4155552671"
},
"Mailing": {
"Address": {
"Name": "Jane Doe",
"AddressLine1": "1 Market St",
"City": "San Francisco",
"Region": "CA",
"PostalCode": "94105",
"Country": "US"
}
}
}
}
]
}
]
}
The schemas validate shape only. Imported phone numbers should already be valid E.164 with a matching uppercase country code, and imported addresses are not run through the country rules until an editor saves them.
IPhoneNumberService validates it for the selected country.CurrentCulture does not guess a country from a neutral culture; use Specific for deterministic behavior.CrestApps.OrchardCore.ContentFields.Address (and with it Addresses).CrestApps.OrchardCore.Recipes.PhoneNumber, CountryCode, NationalNumber, Address). Do not substitute Value or Region at the phone level.{TypePartName}.{FieldName} (the part name on the type, often the type name), that the feature is enabled, and that the source field type has a value reader.AddressField source never matches: the built-in reader reads Address.CountryCode, while Address stores the country in Country, so it currently reads an empty value.Hint_Admin fallback for non-admin themes, or add your own.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, content-fields, phone-field, address-field, conditional-fields, cms
/crestapps-orchardcore:orchardcore-crestapps-content-fieldsfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job