Makes the newbies sad... ;)

Comments

jhodgdon’s picture

aspilicious tells me in IRC that this applies to D6/7/8 versions of the FAPI reference, probably (not sure about D6).

dave reid’s picture

FAPI PAGE OF DOOOOM

jn2’s picture

Title: FAPI container element and link element are not documented » FAPI container element is not documented

As far as I can tell, neither of these elements existed in D6. They are both created in D7's system.module in system_element_info(). Neither one is in D6's system.module in system_elements(). (I'm deducing here the best I can. If there is evidence to the contrary, I'd love to have access to it.)

I'm in the process of researching the container element, and I'll probably limit this issue to that.

I've seen several references to the link element being part of the Render API and not the Form API. So it doesn't belong in the FAPI reference, unless we want to list it with the caveat that it really isn't part of FAPI. In ajax_example_misc.inc (http://api.drupal.org/api/examples/ajax_example--ajax_example_misc.inc/7...), it is used outside a form context. If I can't find more documentation about it, I'll open a separate issue for documenting 'link'. (If I do find documentation or open another issue, I'll post it here.)

jhodgdon’s picture

As far as render API vs. form API, there really isn't any difference as of d7/8. They're not treated any differently really. But as I've said before, I think that instead of pouring a lot more energy into documenting new elements in the horrendously awful FAPI reference doc, we'd be better off fixing
#100680: [meta] Make API module generate Form API documentation

Maybe once I get the "API changes as nodes" issue taken care of (which will hopefully be within a week), I can start on that, and some other docs infrastructure issues...

jn2’s picture

Here's the issue for where to document the 'link element' and other future render elements: #1190658: Where to document the link element (and future Render elements)?.

jn2’s picture

Status: Active » Needs review

Here's what I have:

container

Description:
Returns HTML to wrap child elements in a container. Surrounds child elements with a <div> and adds attributes such as classes or an HTML id.

Properties:
#access, #after_build, #attributes, #children, #id, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #weight

Usage example:

  if ($elements) {
    // Also aid in theming of field widgets by rendering a classified
    // container.
    $addition[$field_name] = array(
      '#type' => 'container',
      '#attributes' => array(
        'class' => array(
          'field-type-' . drupal_html_class($field['type']),
          'field-name-' . drupal_html_class($field_name),
          'field-widget-' . drupal_html_class($instance['widget']['type']),
        ),
      ),
      '#weight' => $instance['widget']['weight'],
    );
  }

_______________________

The #children property is not documented, and it's listed in API docs for theme_container (http://api.drupal.org/api/drupal/includes--form.inc/function/theme_conta...). I'll add a placeholder for now and have opened an issue for it #1201454: #children property is not documented in FAPI reference.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to go for me.

jn2’s picture

Status: Reviewed & tested by the community » Fixed

@sun
Thanks for the review.

Container element now added to the FAPI reference, for D7 and D8.

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