-
Notifications
You must be signed in to change notification settings - Fork 20
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
01 - Add a header image to the homepage #6
Open
luca-rath
wants to merge
1
commit into
master
Choose a base branch
from
assignment/01
base: master
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.
Conversation
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
c8d2b1b
to
54dc2eb
Compare
27ab3c6
to
b0a9741
Compare
5b17716
to
3a7ed77
Compare
3a7ed77
to
a48c3cd
Compare
a07c1b8
to
2f93f7f
Compare
4db185c
to
b5bf216
Compare
b5bf216
to
34b1d1b
Compare
34b1d1b
to
a7cf2ce
Compare
Note: I think the docs in this description have moved.
|
a7cf2ce
to
4fcfa45
Compare
4fcfa45
to
74ec36a
Compare
7a92790
to
607f272
Compare
74ec36a
to
a2908ef
Compare
a2908ef
to
8c9c7ec
Compare
8c9c7ec
to
0de9bf1
Compare
0de9bf1
to
97dd61d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a header image to the homepage
Goal
Our homepage looks quite naked right now. To stir our users emotions, we would like to add a nice header image on
the homepage.
Steps
headerImage
with the typesingle_media_selection
to theconfig/templates/pages/homepage.xml
filex400
to theconfig/image-formats.xml
filetemplates/pages/homepage.html.twig
in the right dimensionHints
{{ dump(content) }}
in the Twig template to find out how to output the header image URL.More Information
To solve this assignment we need to understand a few different concepts in Sulu:
Each page in Sulu has a template. The template consists of two parts:
A template is made up of properties. Each property has a name (for example "title") and a (content) type (for
example
text_line
). The supported content types can be found in the documentation:http://docs.sulu.io/en/latest/reference/content-types/index.html
Furthermore, Sulu uses image formats to transparently create thumbnails in the respective sizes for uploaded images.
A thumbnail is generated when it is accessed for the first time. That means that only thumbnails that are really used
are stored on your disk.
When defining image formats, you can apply different actions to your source images. The most used action is scale,
which resizes an image into the desired dimensions while keeping its original aspect ratio
(http://docs.sulu.io/en/latest/book/image-formats.html).
Links