-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
[Turbo] Include minimal layout for Turbo Frames #2318
Open
seb-jean
wants to merge
10
commits into
symfony:2.x
Choose a base branch
from
seb-jean:layout-frame
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f444d48
Create frame.html.twig
seb-jean de15540
Update CHANGELOG.md
seb-jean c160f73
Update index.rst
seb-jean 4263b61
Update index.rst
seb-jean 9ebd54f
Update index.rst
seb-jean 440060c
Update index.rst
seb-jean 8e8da16
Update index.rst
seb-jean dd67909
Delete src/Turbo/templates/frame.html.twig
seb-jean f7fcea7
Update index.rst
seb-jean e9f405e
Update index.rst
seb-jean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,6 +288,42 @@ With content: | |
A placeholder. | ||
</turbo-frame> | ||
|
||
Minimal layout for Turbo Frames | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. versionadded:: 2.22 | ||
|
||
The minimal layout for Turbo Frames was added in Turbo 2.22. | ||
|
||
Since Turbo does not need the content outside of the frame, reducing the amount that is rendered can be a useful optimisation. However, this optimisation prevents responses from specifying ``head`` content as well. There are cases where it would be useful for Turbo to have access to items specified in ``head``. To specify the heads, you must then use a minimal layout for frame, rather than no layout. With this, applications can render content into the ``head`` if they want. | ||
|
||
.. code-block:: html+twig | ||
|
||
{% extends '@Turbo/frame.html.twig' %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not sure about this gain :) |
||
|
||
{% block head %} | ||
<meta name="alternative" content="present" /> | ||
{% endblock %} | ||
|
||
{% block body %} | ||
<turbo-frame id="frame_id"> | ||
Content of the Turbo Frame | ||
</turbo-frame> | ||
{% endblock %} | ||
|
||
{# renders as: #} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta name="alternative" content="present" /> | ||
</head> | ||
<body> | ||
<turbo-frame id="frame_id"> | ||
Content of the Turbo Frame | ||
</turbo-frame> | ||
</body> | ||
</html> | ||
|
||
Writing Tests | ||
^^^^^^^^^^^^^ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{% block head %} | ||
{% endblock %} | ||
</head> | ||
<body> | ||
{% block body %}{% endblock %} | ||
</body> | ||
</html> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd present first an example of this (with controller code and renderblock for instance)
This part can be removed i think, as the same idea is on the next sentence. And i feel it's a bit fearfull and would not want to alarm users if they dot need any meta tags (which is, as i see it, the most standard case, no ?)
Maybe something like "it allows you to set meta tags while still having a minimal ...." ?