Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Larsundso opened this issue Nov 21, 2024 · 3 comments
Closed

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

Larsundso opened this issue Nov 21, 2024 · 3 comments
Assignees
Labels
issue Something isn't working correctly

Comments

@Larsundso
Copy link

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

@Larsundso Larsundso added the issue Something isn't working correctly label Nov 21, 2024
@kjmartens
Copy link
Contributor

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.

  • /my-custom-template/
    • index.twig
    • _row.twig
    • fields/
      • default.twig
      • checkbox.twig

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. 🙂

@kjmartens kjmartens self-assigned this Nov 21, 2024
@Larsundso
Copy link
Author

Larsundso commented Nov 21, 2024

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.

@kjmartens
Copy link
Contributor

The problem is that the Bootstrap 5 template code example in the docs includes more than just 1 file. It includes a folder and several files within it. That's why it won't work if you attempt to just copy the main index.twig file code into a single template -- it's missing the other template files that need to be created. 🙂

@solspace solspace locked and limited conversation to collaborators Nov 25, 2024
@kjmartens kjmartens converted this issue into discussion #1658 Nov 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
issue Something isn't working correctly
Development

No branches or pull requests

2 participants