Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I want to create auto nodetitles like "[node title]-[CCK select list value]"
The CCK select list allows only one value and it has got a default value.
Now, when the default value is not changed, the auto nodetitle shall only be "[node title]". But when a different than the default value is selected, it should consist of "[node title]-[CCK select list value]".
Is this possible?
Comments
Comment #1
Mark LaCroix CreditAttribution: Mark LaCroix commentedI would love this as a default feature as well. It seems that this would be a major "selling point" for this module that fits perfectly with the rest of its featureset.
However, there is a tricky way to do this by selecting "Automatically generate the title and hide the title field" and then creating a new CCK text field and calling it "Title" (aka: "field-node-retitle"). Then your autotitle pattern would be:
"[field-node-retitle][field-CCK-value]"
If your CCK value is set at the default, unselected value, then the field will be empty and not appear, and your title will just be the same as your "retitle" field. Of course, you don't want a "-" or any other divider to appear either, so you'd have to include it in your drop-down list values, like so:
-a
-b
-c
-etc.
It's a little wonky, but it should get the job done. I do hope that this feature (un-wonked) will be included in a future release of this fantastic module.
Comment #2
no2e CreditAttribution: no2e commentedIn my case the default value is not empty, but a string.
Example:
Select list: Which languages do you speak?
- en (default)
- de
- jp
Title for a node, where the default value (en) were selected:
<title>
Title for a node, where "de" was selected:
<title>-<de>
Comment #3
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs for DrupalFit commented