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

Idea: named html chunks #59

Closed
devinrhode2 opened this issue Oct 18, 2012 · 6 comments
Closed

Idea: named html chunks #59

devinrhode2 opened this issue Oct 18, 2012 · 6 comments

Comments

@devinrhode2
Copy link

Taking a little inspiration from DerbyJS here.

In derby, and in the multiplex of other templating solutions, you can abstract a chunk of html and use it in various places. Same concept as functions for chunks of code. In derby, it looks like:

<ui:modal>
  <div class="...
  </div>

//Use the modal:
...
  <ui:modal />

Perhaps in mustache this could be like:

{{ *widgetName }}
  <div>widget code</div>
{{/}}

//Using it:
...
  {{ **widgetName }}

Haven't put any thought into the potential syntax of it yet, but what do you guys think? @groue

@groue
Copy link

groue commented Oct 18, 2012

Hi Devin !

Is it something like partials, but defined right in the template ?

@devinrhode2
Copy link
Author

wait... wow, this is the exact concept of partials. Closing.

@groue
Copy link

groue commented Oct 18, 2012

Glad to hear from you anyway :-)

@spudly
Copy link

spudly commented Jan 15, 2013

What's wrong with partials defined within the template? I would LOVE this feature. This should be reopened! Partials are great, but it'd sure be nice to be able to define partials right inside the template that uses them. In most cases, the partials I create are only used by one parent template so it's a lot of extra work to create the partial the way it works right now. Also, a lot of my partials are one-liners. As a result, I often times end up just copy/pasting instead.

@devinrhode2 devinrhode2 reopened this Jan 15, 2013
@devinrhode2
Copy link
Author

actually we should just re-open a clean thread specifically for defining partials inline, care to do the favors @spudly?

@spudly
Copy link

spudly commented Jan 15, 2013

See issue #63.

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

No branches or pull requests

3 participants