Skip to content
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

Pass page variable to processed forms #141

Merged
merged 1 commit into from
Apr 19, 2021
Merged

Conversation

NicoHood
Copy link
Contributor

@NicoHood NicoHood commented Dec 9, 2020

@NicoHood
Copy link
Contributor Author

NicoHood commented Feb 14, 2021

I also noticed that site.title and base_url_absolute are also not available in those email templates. I am still not sure why this happens, can you help?

The reason is: I want to list the form attachments in the email sent via data.html.twig:

{% elseif field.type == 'file' %}
    {% set files = form.value(scope ~ field.name) %}
    <ul>
        {% for file in files %}
            <li><a href="{{ base_url_absolute }}/{{ file.path }}">{{ file.name }} ({{ file.size}} Bytes)</a></li>
        {% endfor %}
    </ul>

@mahagr
Copy link
Member

mahagr commented Mar 1, 2021

Try grav.config.site.title and grav.base_url_absolute.

@NicoHood
Copy link
Contributor Author

NicoHood commented Apr 2, 2021

Thanks a lot for the tip! It solved one of my issues!

Can you please have a look at the PR again? It is still relevant though as mentioned here: getgrav/grav-plugin-form#127

@mahagr mahagr merged commit e1b678d into getgrav:develop Apr 19, 2021
mahagr added a commit that referenced this pull request Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants