The ability to set machine names for the displays is one of the absolute _best_ features of views 3. Would it be prohibitively difficult to allow users to set machine names for fields as well? Right now when I make a views-view-field.tpl.php I have to include the auto-generated machine name in the file name, which could change if I make even minor changes to the fields in the view. It also makes it hard to quickly see which files are for which fields when I have a bunch of 'nid' fields that I am turning into different links in the template files. It would be great if you could set the machine name for a field in the views interface.
Thanks again for making the change to allow users to set the machine name for displays...awesome.
Comments
Comment #1
dawehnerIn general this would be a cool feature but it can produce problems.
What if you change the name of a field, should the settings in a table style be changed as well.
What about the names of template files etc. So the user should be informed that he really have to know what he does at the moment.
Comment #2
dawehnerPushed the current progress to http://drupal.org/sandbox/dereine/1073764
Comment #3
kevinob11 CreditAttribution: kevinob11 commentedThanks for the update! I agree that the feature would be pretty dicey to use if you were not absolutely sure of what you were doing. I had thought of tpl files, but not all of the interface based settings, I can see how that would be problematic. I would still love to see it, but can understand any hesitance to merge it to the main views repo.
Comment #4
kevinob11 CreditAttribution: kevinob11 commentedI was thinking about this again today, and I think maybe a special field handler would work for this. The main thing I would use this for is so I can name .tpl.php files with something that actually matches their function. Then I usually do a ton of work in that template file and its corresponding preprocess function. So in reality I very seldom actually need the content of the field to be defined in the ui. With that in mind it could just be the an option in the "Custom Text" global field handler, or its own unique field handler as opposed to being an available option in all field handlers.
This being said, I don't fully understand the ramifications of a change like this, so if the above is less practical or just plain crazy feel free to disregard it.
Comment #5
dawehnerIf you really do a bunch of stuff in your template/preproces you might apply logic there. Please don't do this and use real handlers.
That's just a general suggestion.
Comment #6
kevinob11 CreditAttribution: kevinob11 commentedAny updates on this?
Thanks,
Kevin
Comment #7
kharbat CreditAttribution: kharbat commentedsubscribing to this feature..
setting a machine name for fields in views is a really helpful feature.. since most of auto generated field names are long and not really convenient..
Comment #8
dawehnerTo be able to do this several things has to be done:
Comment #9
MustangGB CreditAttribution: MustangGB commented