What is the best way to make various types from Terms in the Taxonomy Module of Orchard CMS, so that the first level can contain only type1, the second level can contain only type2 and so on? So it would look like real taxonomy of Species.
Example:
Order1
Family1
Genera1
Species1
Family2
Genera2
Species2
Genera3
SPecies3
Order2
(and more)
Where Order1, Order2 are of type Order with unique set of attributes; Family1, Family2 are of type Family with unique set of attributes and so on.
I thought about creating separate ContentPart that would represent the set of attributes and type and add it to ContentType that is created by Taxonomy Module for the vocabulary of a taxonomy. So there would be TaxonomyTypeRecord, TaxonomyTermAttributeTypeRecord (linked with the type) and TaxonomyTermAttributeRecord (linked with the attribute type). After that the set of attributes would be unique for pathes of terms.
That is the continuation of my previous question.
UPDATE:
Here is a diagram:
Taxonomy term 0..1 — 0..* Taxonomy term attribute
Taxonomy term attribute 0..* — 1..1 Taxonomy term attribute type (here are possible types of Attributes, e.g. habitant, # of forms etc.)
Taxonomy term attribute type 0..* — 1..1 Taxonomy term type (or rank, e.g. Species, Order, Family, Genera)
Those entities would be ContentPartRecords for a new ContentPart (say TaxonomyTermTypeContentPart) that would be added to the taxonomy ContentType created by Taxonomy module in TaxonomyService.CreateTermContentType().
You can't: there is only one type of term per taxonomy. But I'm not sure I see the scenario.
Related
Is it possible to have a OneToManyAssociationField as entity extension on for example ProductManufacturer without the ReferenceVersionField in my related custom entity?
If this is not possible, is it possible for the reference version field to have a custom name (so not product_manufacturer_version_id) On first sight, this also does not seem possible.
About the error
I am currently getting the following error when trying to search for manufacturers using $criteria->addAssociation('myCustomEntity'):
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'product_manufacturer.myCustomEntity.product_manufacturer_version_id' in 'field list'
About the big picture
The use case is similar to the SeoUrl entity where there is a ‘foreign_key’ field which can have a relation to multiple entity types. My entity has not associations, but the other entities are extended to have an association to my entity. Just like the SeoUrl.
However, the DAL creates a query which uses the ‘product_manufacturer_version_id’ field, which does not exist on my custom entity…
Is it possible to have a OneToManyAssociationField as entity extension on for example ProductManufacturer without the ReferenceVersionField in my related custom entity?
No, you must set a ReferenceVersionField when adding associations to the definition of a versionized entity. This is too deeply rooted in the basic principles of the data abstraction layer to work around.
If this is not possible, is it possible for the reference version field to have a custom name (so not product_manufacturer_version_id) On first sight, this also does not seem possible.
You can change the storage name of the field. That is the name of the corresponding column within your database table. When you instantiate ReferenceVersionField you can use the second, optional argument to provide the storage name:
public function __construct(string $definition, ?string $storageName = null)
The storage name should be provided in snake case. The name of the object property for the field will then be derived from the storage name and converted to camel case. So given you provide my_version_custom_id for the storage name, the object property of the entity will be myVersionCustomId.
Your entity may have multiple associations to different entities, but if those entities are versionized your foreign key constraint has to be a combination of columns for both the foreign primary key as well as the foreign version id.
In my KeystoneJS (v4) setup I have the following lists:
Stores
Product Categories
Tags
The stores can have categories associated with them.
If I open up a category I can see it's Relationships (stores that use a certain category).
But, is it possible to see these relationships in the list layout as well? Not seeing it in the docs...
Adding the relationship to the column is not possible.
Say we have two Core Data entities:
entity Bar
attribute bar1;
attribute bar2;
entity Foo
attribute foo1;
attribute foo2;
to-many relationship <Bar*> bars
I want to use NSPredicateEditor to search for "any Foos that have bars with (bar1='term1' and bar2='term2')". That is, multiple matches in the same Bar.
With some kind of custom compound predicate that has a UI like this
Image 1
Image 2
I know how to create top-level NSPredicateEditorRowTemplates to search for Foos based on Bar attributes (Foo.bars.bar1).
But those are compounded along with the Foo attribute subpredicates, so I can't limit the search to multiple attributes in the same Bar.
When selecting Bar attributes to search, the list should limit itself to the Bar attributes.
Is it even possible to have multiple types of compound predicates in the same NSPredicateEditor?
Surprisingly little code for customizing NSPredicateEditor out there...
I'm trying to create a dependency between fields in orchard.
I need to create cascading dropdownList in Orchard.
e.g : Country and State (for each Country a couple of states must be displayed not all the content).
How can I do that with Orchard.
I think, that you need make a choice from two options:
Create content type for Country and other content type for State (or may be one content type for Country and State). Then use Container and Containable part to create hierarchy (May be you should also use List module). Then override your field editor (you can use any field type, but i suggest you to use content picker field).
Use Taxonomy Module to create country-state hierarchy. Then use Taxonomy Field and override editor for it.
I’ll keep it short and sweet. Does anyone really know what the "ListTemplateOwner" tag of the elements.xml's "Receivers" node really means?
From Microsoft’s site: http://msdn.microsoft.com/en-us/library/ms431081(loband).aspx
ListTemplateOwner: Optional Text. Specifies the GUID of the list template owner if the list template is registered via Features, or the name of the site definition if the list template is registered by a site definition.
If the list is defined by a ListTemplate in a Feature then ListTemplateOwner is the ID of the feature that defined the list.
When you're refering to any of the standard lists (with ListTemplateId < 10000) then you don't need to specify a ListTemplateOwner (due to backwards compability)
When you're refering to a list that's defined by you or a third party, then you need the combination of ListTemplateId (> 10000 and matching the Type attribute from the defining ListTemplate) and ListTemplateOwner matching the FeatureId of the feature that defined the ListTemplate.
This is due to the fact that when you define a ListTemplate the rule is that Type should be > 10000 and unique inside the feature, but any number of feature may have their own ListTemplate with type 10001 (and feature which define lists usually just start from 10001)
If the list is defined by a ListTemplate in a Site definition then ListTemplateOwner is the name of that Site Definition, but don't define lists in Site definitions do it in features.
This is not correct, the feature ID when set to the current feature, which contains the list definition for the list type, does not target the reciever correctly...
<ListTemplate
Name="SomeList"
Type="99002"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="Some List"
Description="Custom List used for whatnot"
Image="/_layouts/images/itgen.gif"/>
<Receivers ListTemplateId="99002" ListTemplateOwner="B1E4631D-52A1-48d0-A319-2DDC2893AA57">
What you need to do is give each List Template a unique ID, regardless of the owning feature.
I am guessing that it refers to the ID (GUID) of the SharePoint object that owns the list template. Think of it like the ID column of a database and this would be it's foreign key.