Plone collection with own fields - plone

I know it is possible in plone to create content types with their own fields.
So, is it possible to create a collection with those fields?

I'm not sure what you like to achieve, but to answer your question:
Yes it's possible to create a collection based type with your own fields.
If you are using the DX based collection type of plone.app.contenttypes you can easily extend it. You also have to register your own view template, which takes care of the new fields.
Of course it is also possible to create a completely new content type.
Check the Collection FTI of plone.app.contenttypes
You also need some basic knowledge about dexterity

If you ment to extend the possibly choosable criteria of collections by any field-names of your portal's contenttypes and you are using the old-style collections (type_name=Topic), you can do like this, to add any of these fields as a choosable criterion to (old-style-)collections:
Make sure, the field is registered in the portal_catalog, which you can check by accessing http://yourhost.com:8080/Plonesitename/portal_catalog/manage_catalogIndexes. If it's not already there, you need to add it via the dropdown-selection in the upper right corner, choose "Field Index".
Make sure, the field is registered in the configuration of collections, which you can check by accessing http://yourhost.com:8080/Plonesitename/portal_atct/atct_manageTopicIndex. If it's not there, click on "All fields" in the upper right corner, search for the field-name and check the radiobox to make it available, save.
In newer Plone-versions the old-style-collections are disabled by default, you'll probably need to enable them via http://yourhost.com:8080/Plonesitename/portal_types/Topic/manage_propertiesForm, check "Implicitly addable", save.

Related

Filter collection based on custom dexterity field

I would like to make a collection which returns my custom dexterity type if it's "featured" field is true. I have added this field to the catalog... is there anything else I need to do to be able to see it in the collection search terms?
When you say "I have added this field to the index" you mean to the portal_catalog?
If yes, you must also configure that index as a new collection criteria. If you are using new style collections you need a Generis Setup import step registry.xml. See plone.app.querystring package: https://github.com/plone/plone.app.querystring/blob/master/plone/app/querystring/profiles/default/registry.xml

Tridion 2011 SP1 CD API - retrieve content tagged with keyword

We're designing schemas for content that we want to retrieve via the CD API based upon a Keyword field. From an API point of view, I'm wondering if it makes a difference if this field is a Content field or a Metadata field:
Looking at the API docs, there's a TaxonomyKeywordCriteria available to query all content which are related to a specific Keyword which I can pass to Query object.
This only applies to Keyword fields in custom metadata, correct?
There's also the TaxonomyRelationManager class which has a GetTaxonomyContent method as well as the GetTaxonomyComponentPresentations method in the ComponentPresentationFactory class.
These would apply to Keyword fields in content or custom metadata?
Is there any performance difference between the API calls to be aware of?
The Keyword field is important from an editorial point of view so I'm leaning towards creating it as content field rather than it being "hidden" under the metadata tab.
Cheers
EDIT
Initial (quick & dirty!) tests show TaxonomyRelationManager is x10 quicker than ComponentPresentationFactory, which is x1.5 quicker that Query.
However ComponentPresentationFactory contains actual content rather than just TCM IDs which could be more useful in my scenario.
Normal content fields don't automatically get published to the broker. Keyword fields are the exception to this: a keyword field is automatically metadata even if it's on the content tab.
I see you've already answered the performance part of your question yourself.
As far as I'm aware only Metadata fields get published to the Broker, Content fields don't. So if you need to query against the keyword field it would need to be a Metadata field.

umbraco and custom system table

I have the following scenario:
My website db has a system table called "Companies", which includes an id field, companyName field, and companyImageUrl field.
How do I set up an umbraco document type for adding entries to this table ?
Maybe I shouldn't use a custom table at all ?
Thanks.
As far as I know, Umbraco doesn't support what you want to do out of the box (mapping a document type to a table that isn't part of the umbraco core).
One approach that might work is to create an action handler that syncs a Company doc type to your table when creating a node of that type.
It's a bit of a hack though. I've found that I've very rarely needed to create custom tables. What exactly are you trying to do with it? My guess is that you don't really need it and would be better off working with a doc type instead. Umbraco provides a variety of ways to get and act upon doc types from within custom C# code (check out the umbraco.NodeFactory namespace). You'll also get the added benefit of being able to easily interact with these nodes from XSLT/Razor.

A way to limit taxonomy exposed filter options in view with arguments in drupal

I'm building a product catalog where a particular section is displayed by views with an argument, a taxonomy id of a section.
But I also need to give user the ability to further narrow down the search by specifying the producer by choosing term in another vocabulary in the exposed filter.
I'm trying to limit the selection to terms for which nodes in a chosen section exist. Looks like the views_selective_filter and view_hacks are especially for that, but looks like out of the box neither of them takes into account the view argument. Is there a remedy or workaround?
Use Firebug or the devel_themer module to find the form ID of the form displaying those terms, then use a hook_form_alter in a custom module to intercept, and modify that form.
In the end I used views_taxonomy_selective_filter. I had to patch views module as I described in the comment in order to make it generate select options after processing arguments.

Refreshing existing nodes to pick up Automatic Nodetitles in Drupal

I have a set of existing nodes for a content type ('foo'). Since then I have installed the Automatic Nodetitles module, which has helped tremendously, since I no longer need to work hard to make standardized names for each node of that type. I have used Automatic Nodetitles in conjunction with Tokens to create an automatic title naming pattern based on Node and CCK fields. This works perfectly for any new node I create of this content types?
How do I refresh existing nodes to pick up their titles with the "Automatic Nodetitles" Drupal 6 module?
Thanks,
Had to do quite a bit of searching to find the solution, but I found it:
http://drupal.org/node/265773#comment-3055470
Specifically:
"Updating nodetitles from existing
nodes
If you set the nodetitle to be auto
generated for some content type,
existing nodes are not affected. You
can update existing nodes by going to
'admin/content/node', then filter for
your content type, mark some nodes and
choose the "Update option" "Update
automatic nodetitles"
Posted to SO for everyone's benefit. One of the "Update options" Is "update automatic nodetitles". I never would have guessed! No need for an additional module or function; it is already there (once Automatic Nodetitles is installed, of course).
You can also use Views Bulk Operations' built-in "List all content" replacement view (defaults to admin/content/node2), which will give you more flexibility in selecting/filtering nodes to update. VBO also allows you to select and perform an action on all nodes, rather than just a page at a time, like Drupal's default content listing.
Than only works well if you have a bunch of nodes, what if you have 5000?

Resources