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

Future topic and feature wishlist #242

Open
flosch opened this issue Sep 13, 2020 · 7 comments
Open

Future topic and feature wishlist #242

flosch opened this issue Sep 13, 2020 · 7 comments

Comments

@flosch
Copy link
Owner

flosch commented Sep 13, 2020

Based on user input I put up a list of topics I'm considering for future pongo2 versions:

Feel free to add any ideas and wishes as comments below.

@flosch flosch pinned this issue Sep 14, 2020
@egeozcan
Copy link

egeozcan commented Oct 14, 2021

I'd love to see inline extends (like include but with slots)

base.tpl (not relevant but just to make it clear)

<html><body>
    {% block body %}{% endblock %}
</body></html>

modal.tpl (a reusable component with three slots)

<section class="modal">
    <header>{% block header %}{% endblock %}</header>
    <article>{% block body %}{% endblock %}</article>
    <footer>{% block footer %}{% endblock %}</footer>
</section>

page_with_modal.tpl:

{% extends "base.tpl" %}

{% block body %}
    Hello world!!
    <!--  so include also providing a slot mechanism like extends, enabling reusable components -->
    {% include "modal.tpl" %}
        {% block header %}Modal title{% endblock %}
        {% block body %}Lorem ipsum{% endblock %}
        {% block footer %}Modal footer{% endblock %}
    {% endinclude %}
{% endblock %}

@egeozcan
Copy link

egeozcan commented Oct 9, 2022

@flosch hi there! after a year, I just wanted to check if you think what I suggested above would be good idea. if so, and you don't have time, maybe I can give it a go?

@flosch
Copy link
Owner Author

flosch commented Oct 13, 2022

@egeozcan Is there any existing implementation of this feature in other well-known template engines?

@egeozcan
Copy link

egeozcan commented Oct 14, 2022

@flosch

In Vue.js and Web Components, this is possible with named slots. In angular, projections are used, and in React, you can pass components as parameters and render them anywhere.

On the server side: Symfony has something similar with named slots. Laravel/Blade also has slots. Django has Slippers, and I was told that Django Components can do something similar but I've never used it.

My use case is, I want to create Alpine.js components on the server side, with injection points.

@egeozcan
Copy link

egeozcan commented Oct 3, 2024

Just checking in after 2 years... Perhaps what I asked for didn't peak your interest, or you just don't have the time (I mean who does these days right?). Would it be welcome if I tried to add something like this myself and made a PR or would it be the best to maintain a fork (although it's still a question if I'll be able to implement it at all)?

@Hugoreal2
Copy link

Really think this project can reach alot of people, I wouldn't mind to fork this

@flosch
Copy link
Owner Author

flosch commented Oct 18, 2024

This project is currently rather in maintenance mode, but I'm planning to resume feature development at some point and overhaul a few thinks I've on my bucket list. However, it takes some time though. Having your topic @egeozcan still on my list as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants