NVP field allows you to create a field type of name/value pairs, with custom titles and easily editable rendering.

This allows you to easily create content blocks of with pairs within divs, list items, definition lists, data description lists, or in your own custom plain text.

The module allows you to customise the labels for the name & value columns eg. "foo" & "bar".

Project page: http://drupal.org/sandbox/john_a/1984082
git clone --branch 7.x-1.x john_a@git.drupal.org:sandbox/john_a/1984082.git nvp_field

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxjohn_a1984082git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

KOsipenko’s picture

Hi john_a.
1.

/**
 * Implements hook_field_settings_form().
 */
function nvp_field_field_settings_form($field, $instance, $has_data) {
  if ($field['type'] == 'nvp_field') {
    $settings = $field['settings'];
    $form = array();
    return $form;
  }
} 

If you not use variable $settings, that you must remove it.

2.
Function nvp_field_field_instance_settings_form()
You use:

 $form = array(
    'name_title' => array(
      '#description' => t('The Name title field gives a recognisable name for the firstv alue to the user'),
      '#type' => 'textfield',
      '#title' => t('Name title'),
      '#default_value' => $settings['name_title'],
      '#size' => 60,
      '#maxlength' => 128,
      '#required' => FALSE,
    ), 

No need to write '#required' => FALSE, since this is the default setting FALSE

john_a’s picture

Thanks KOsipenko, you are quite right.

I've removed nvp_field_field_settings_form() and the default '#required' => FALSE settings, and committed to the repo.

I was also pondering on whether it would be better to allow a theming function/template to add the prefix, delimiter and suffix, instead of adding them in instance configuration fields. Perhaps this would be a more "Drupal" way of doing things. However, if we did that, the module would be less available to non-technical users.

I'm open to suggestions.

Cheers.

john_a’s picture

Status: Needs work » Needs review
abhitesh.das’s picture

Hi,

Please fix the errors reported by:
http://ventral.org/pareview/httpgitdrupalorgsandboxjohna1984082git

Please note that you need to switch from the master branch to a new branch.
FYI: https://drupal.org/node/1127732

Then update the issue summary to reflect the correct branch in git clone.

Overall, the code seems neat and working.
Nice concept. However, I could not imagine any practical application of this module (No offense) . Please help me with an example.

john_a’s picture

Thanks for the feedback abhitesh.das.

After a major fight and several commits, bad EOL's are finally resolved.

Master branch has been deleted, and the new branch of 7.x-1.x has been created. There is currently no dev branch, and the default branch is set to 7.x-1.x. The summary has been updated to reflect this.

I actually created this module for a live site (example page: http://picturedrift.com.au/project/abc2-ident-bubblegum [credits section]). We wanted to create a clean way for the client to be able to add name/value pairs for the credits in all projects, i.e. "Director" -> "John Gielgud". This module allows him to only enter the values, and not have to worry about the surrounding html, or special formatting requirements from us in the text editor, and we could ensure consistent formatting of the pairs. in addition, the fields were nicely tied together as pairs.

I made a decision to make this as open as possible, because there would probably be some other uses for it that I hadn't thought of.

jiong_ye’s picture

Works just as described.
Templating(field--field_nvp.tpl.php) also works like it should.

jiong_ye’s picture

Issue summary: View changes

update git clone command to reflect move from master

kscheirer’s picture

Title: [D7.x] NVP Field » [D7] NVP Field
Status: Needs review » Reviewed & tested by the community

Looks pretty good to me too, no issues found. The ventral report comes back clean. The use case seems reasonable.

----
Top Shelf Modules - Enterprise modules from the community for the community.

john_a’s picture

Thanks all, for taking the time out to review this, and your suggestions.

I'm waiting for permission to release this as a full project, and then we're good go. Is there anything else I need to do to apply for permission?

kscheirer’s picture

No further action is required, but the best thing you can do is get a Review Bonus by reviewing other applications. That will get you to the top of the list of projects to get reviewed (and hopefully approved). Only manual reviews count, just using http://ventral.org is not enough.

----
Top Shelf Modules - Enterprise modules from the community for the community.

kscheirer’s picture

Your project page needs a lot more detail - add some of the text from the README at least. In the .info file don't use abbreviations in the project description. Your schema defines the name/value columns as varchar 255, but the form has a #maxlength of 128. Why is the prefix/suffix set to 1000 chars - is that some kinds of Fields default? Looks pretty good though.

Thanks for your contribution, john_a!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

----
Top Shelf Modules - Crafted, Curated, Contributed.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

updated description to be a little less wordy and easier to read