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?
Related
i have the following case: I am building a website that has information on filmmakers and their films. I have a node type for the filmmaker, with biographical content, etc and another one for the films, with a field 'author' that references one or more of the filmmakers (since one film may have been made by several of them).
I also have a views block called 'filmography' that lists all the films whose author is the filmmaker (node) the user is seeing. Setting this up with a contextual filter was quite easy.
But now I want to present in this block along with the film name, all the filmmakers that may have made the film ('author' field in the film node) and that are different from the filmmaker being viewed. Displaying all the filmmaker nodes referenced by the author field is immediate, but I want to remove the filmmaker that I am using in the contextual filter. The goal is to get something like this:
Filmmaker 1
Movie 1
Movie 2 (with Filmmaker 2)
Movie 3
I have the notion that this might be done using views php and filtering the node references returned, but I wonder if there is an easier solution for that...
Thanks
Update: I have managed to get a result using the Views Field View module, passing the list of referenced nodes (filmmakers) as a contextual filter (node ID) and then adding another contextual filter (node ID as well) as an exclusion, and getting the default value of the letter from 'node id from URL option' (that is, from filmmaker's page the filmography view is embedded in). Keeping the question open for a while to get other, possibly more efficient, alternatives.
As I read your question, the Views Field View module popped into my mind as the obvious solution (then I saw your edit). I think this will still be your best bet. Definitely avoid using php fields as that is not a good practice in general from a security standpoint. If you are concerned about efficiency/performance, then you should just use views caching setting under the advanced options. Seems like this option is always looked over.
If you are looking for alternative options, one might be to use rendered nodes as your View style instead of fields, then use Display Suite to generate additional display modes beyond "Default" and "Teaser," create a view with the filters, then use the Entity Views Attachment (EVA) module to insert a view as a display mode field. While this is certainly a robust approach, it adds a lot of processing overhead with the rendered entities, so you definitely want to cache the results of that as well.
p.s. You might get faster/more responses over at https://drupal.stackexchange.com/
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.
I have two fields: Supervisor and agent in a new content type. The list of agents depends on the supervisor selected. How can I create such a dependency i.e. each time a different supervisor is selected from a list a new list of agents is set?
Do I need to set up the supervisor and the agents each as nodes and then use entity reference?
How can I set up the dependency in the content type?
Cannot ask for clarification since I'm new here but here goes
Taxonomy terms can be a solution to the problem depending on the amount of information Supervisor and agent holds. If they hold information like phonenumbers, adresses, names etc. then they need a content type. If these are in fact references to users in the system then you need to use those users. If it's just for categorization, taxonomy terms will work just fine.
Set up the Supervisor as the parent term and the agents as children. Then use a widget like this one to handle the input: https://drupal.org/project/term_reference_tree
Afterwards you can retrieve and show data based on which term/agent is relevant.
My Drupal 7 site has a bit redundant taxonomy structure with taxonomy terms "Article" and "Document" being used synonymously. Hence a large number (several hundreds) of nodes has both "Article" and "Document" terms applied to them. What I want to do is to "separate" these terms shuffling nodes randomly between them so about half of the nodes currently marked "Article" and "Document" will only have "Article" term and the other half will only be marked "Document".
What's the best way to go about this? Is there a module for bulk updating nodes adding/removing taxonomy terms? Am I better off with updating the database directly?
Thank you.
I found a solution for this:
I have "Administrative Views" module installed (Requires: Views, Chaos tools, Views Bulk Operations, Entity API - links are on the module page under dependencies).
From there you select the nodes you want to change and select "change value" in the "operations" dropdown and hit execute. Under "Fields for type {your nodetype}" you can click "tags" for example and enter the new value to overwrite all - or you click "Add new value(s) to Tags, instead of overwriting the existing values." and the value will be added.
It turns out adding a tag this way, there are new tags added for every updated node - so if you edit 20 nodes and add the tag "stackoverflow" there will be 20 tags called "stackoverflow" in the terms list. You may then merge the duplicates with "Term Merge" into one final term.
Since you need to update the taxonomy structure in bulk you can use - Taxonomy Manager
http://drupal.org/project/taxonomy_manager/
Which apart from other features has -
dynamic treeview
mass deleting
mass adding of new terms
moving of terms in hierarchies
You can also take a look at a similar question -
https://drupal.stackexchange.com/questions/11494/adding-taxonomy-terms-to-multiple-nodes-at-once
If nothing helps updating the database sure seems a simpler option, but use it only if you are very sure of your query, and don't forget to take a backup before.. :)
Taxonomy Manager is the a very good module for these purposes I used it myself to tag and add vocabularies to my website that has more than 100 posts. Its interface is also very intuitive and user-friendly.
Is it allowed to ask questions about Drupal here?
I assume the answer is "yes" and ask my question.
I used Generate items (a part of the Devel module) to generate some dummy content, but I can not find any option to delete them.
How can I delete them from my database?
Go to /admin/content/node, select them, and select "Delete selected"
Have you tried using Views Bulk Operations module: http://drupal.org/project/views_bulk_operations ?
When you create content you have an option "Delete all content in these node types before generating new content." If you check it and set the nodes to be generated to 0, it will only delete the nodes of the selected type without generating new ones. However, this will also delete nodes not created by devel.
According to Devel authors, Devel module is not going to keep track of its generated content, so you have to use something else, like views bulk operations or delete_all modules.