Comparison

  1. Themable Forms (started in September 2016 by lauriii) is older than formdazzle (started September 2019 by JohnAlbin).
  2. Themable forms has very few commits and amounts to two template suggestion hooks inside the *.module file providing the following suggestions:

    form-element.html.twig

    form-element--[form-id]--[element-type].html.twig
    form-element--form-id--[form-id].html.twig
    form-element--type--[element-type].html.twig
    form-element.html.twig
    

    form-element-label.html.twig

    form-element-label--[form_id]--[element_type].html.twig
    form-element-label--form-id--[form_id].html.twig
    form-element-label--type--[element_type].html.twig
    form-element-label.html.twig
    

    The rest of the functions in the *.module file deal with exposing variables (like #form_id) to be available to these two template suggestion hooks.

    There are no template suggestions for form.html.twig.

    There are no template suggestions for input.html.twig.

  3. Formdazzle! on the other, hand has many many commits and takes a different approach. It uses the *.module file to register a preprocess_form_element() function, but all the module's business logic is housed in a PHP Class called Dazzler.php. The class has unit tests whereas Themable Forms has no tests (due to its simplistic nature).

    Template suggestions are provided for:

    form.html.twig - special case logic for webforms and views exposed forms

    form--views--[view-id]--[display-id].html.twig
    form--webform-[webform-id].html.twig
    form--[form-id].html.twig
    form.html.twig
    

    form-element.html.twig
    TBD (see project page for examples)

    [element-type]--[form-id]--[form-element-name].html.twig
    

    form-element-label.html.twig
    TBD (see project page for examples)

    [element-type]--[form-id]--[form-element-name].html.twig
    

    input.html.twig

    input--textfield--webform-contact.html.twig
    input--textfield--webform-contact--first-name.html.twig
    input--textfield.html.twig
    input.html.twig
    

Original Summary by @hawkeye.twolf

Honest question, is Formdazzle! significantly different from Themable forms? I see that the theme suggestions themselves have a slightly different syntax, but are there deeper functionality differences? If so, it would be great to have those documented on the project page. Thank you John!

Comments

hawkeye.twolf created an issue. See original summary.

hawkeye.twolf’s picture

Priority: Normal » Minor
hawkeye.twolf’s picture

Related issue on Themeable forms.

jwilson3’s picture

jwilson3’s picture

whoops. I linked the issue to itself. this should fix it

jwilson3’s picture

Issue summary: View changes

Here is a first stab at a comparison of formdazzle and Themable Forms.

This comes from a quick high-level review of examples on formdazzle!'s project page as well as reading the codebase of each module.

So far, it is looking like formdazzle does have more features than themable forms.

jwilson3’s picture

Issue summary: View changes
jwilson3’s picture

Issue summary: View changes
smustgrave’s picture

The one suggestion that I needed came from themeable_forms.

form-element--type--[element-type].html.twig

Wonder if formdazzle would consider adding that as I do like that formdazzle has a few more commits and marked stable.

smustgrave’s picture

Status: Active » Postponed (maintainer needs more info)

Wonder if this can be closed now? Or maybe this is worth putting some entry in the README?

  • smustgrave committed 3b46958b on 4.0.x
    Issue #3278319 by jwilson3, hawkeye.twolf: Feature comparison to...
smustgrave’s picture

Version: 2.x-dev » 4.0.x-dev
Status: Postponed (maintainer needs more info) » Fixed

Actually decided to do that so everyone here can get credit for answering the question.

Status: Fixed » Closed (fixed)

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