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

Custom Templates: "_row.twig could not be found" #1657

Open Larsundso opened 2 days ago

Larsundso commented 2 days ago

What happened?

In the middle of updating from 4.x to 5.x, I already did migration and am now in the process of transforming my templates.

I've followed the docs for creating custom templates by copying the bootstrap-5 index.twig into my custom template file. Trying to open/render the page now throws this error:

I tried changing the import on the first error, that didn't work. How can i fix this?

Errors and Stack Trace (if available)

The template “@freeform-formatting-templates/bootstrap-5/_row.twig” could not be found in “__string_template__3bf363610c5199ee9fa1577b3b758587” at line 9.

The template “freeform/_templates/formatting/bootstrap-5/_row.twig” could not be found in “__string_template__3bf363610c5199ee9fa1577b3b758587” at line 9.

How can we reproduce this?

  1. Copy bootstrap-5 index.twig into your templates folder
  2. Create a form with the template selected
  3. Cause craft to render the form

Freeform Edition

Pro

Freeform Version

5.6.8

Craft Version

4.12.9

When did this issue start?

After upgrading from older Freeform version

Previous Freeform Version

4.2.7

kjmartens commented 2 days ago

Hi @Larsundso,

Can you share what your overall template structure looks like for this custom formatting template? I'm curious about where each file (including _row.twig) is located in your setup.

To be clear, all of your associated files should be placed within your bootstrap-5 template directory, e.g.

It's also possible that there's a conflict with naming the custom formatting template as bootstrap-5 as well, so if the issue continues, please try naming it something different. 🙂

Larsundso commented 2 days ago

Hi back @kjmartens, I was following this documentation entry about creating modified templates from samples.

If you wish to create your own modified version, just copy the code below, or the template file (e.g. bootstrap-5.twig) and paste it into your Formatting Templates directory in the specified Craft Templates directory (e.g. /templates/_freeform/), and rename it to whatever you like.

So i only have a "My-Template.twig" with the contents of this template samples index.twig. I did not modify it at this point in time.