solspace / craft-freeform

Freeform for Craft: The most reliable form builder that's ready for wherever your project takes you.
https://docs.solspace.com/craft/freeform/v5/
Other
47 stars 61 forks source link

Tailwind Template Path Issue #1630

Closed CreateSean closed 1 week ago

CreateSean commented 1 week ago

What happened?

I copied the tailwind templates (from the docs) to my template folder in this heirarchy

_freeform
  fields
    _default.twig
    checkbox.twig
    checkboxes.twig
    dropdown.twig
    group.twig
    opinion-scale..twig
    radios.twig
    table.twig
  formatting
    main.css
    main.js
    row.twig
  site.twig

I then updated the settings for the form to use the correct freeform template

image

When I view the form on the front end i get this error:

Invalid Argument – [yii\base\InvalidArgumentException](https://www.yiiframework.com/doc-2.0/yii-base-invalidargumentexception.html)
The file or directory to be published does not exist: /_freeform/formatting/_main.css

I then updated the paths for _main.css and _main.js to match what I have and it still gives me this error:

{# CSS overrides #}
{% set cssPath = view.assetManager.publishedUrl('_freeform/formatting/_main.css', true) %}
{% do view.registerCssFile(cssPath) %}

{# JS overrides #}
{% set jsPath = view.assetManager.publishedUrl('_freeform/formatting/_main.js', true) %}
{% do view.registerJsFile(jsPath) %}

{% import "_freeform/formatting/_row.twig" as rowMacro %}

Errors and Stack Trace (if available)

No response

How can we reproduce this?

  1. update to freeform 5.7.1
  2. change formatting template from bootstrap 3 to copied tailwind templates
  3. load form

Freeform Edition

Lite

Freeform Version

5.7.1

Craft Version

4.12.8

When did this issue start?

After upgrading from older Freeform version

Previous Freeform Version

highest version 4