Overriding Templates
Developers can override the template paths to adapt the look and feel of the display.
The extension provides basically 2 views. Album List, which displays a list of albums, and Single Album Photos, which displays the photos of a specific album. You can override how these should look like.
Overriding the Album List
The album list supports as layout
- Plain
- Css Masonry
- Raw
You can change each one of them, or only a specific one. The best candidate would be the the Raw layout. The others add custom css to the page, which is probably undesired.
The album list uses the following files
- Templates/Album/List.html
- Partials/Album/List/ALBUM_LIST_LAYOUT_SET_IN_PLUGIN.html
The List.html just includes the Partials/Album/List/ALBUM_LIST_LAYOUT_SET_IN_PLUGIN.html file. So it should suffice to just add your own version.
Let’s say you want to change the Raw layout of the album list. Under fileadmin, create the following folders and files
- Folder
fileadmin/skfbalbumoverrides/Partials/Album/List
- File
fileadmin/skfbalbumoverrides/Partials/Album/List/Raw.html
Take the extension’s typo3conf/ext/skfbalbumoverrides/Partials/Album/Raw.html file content and add it to your own Raw.html file you just created.
In your Template setup, add the following
plugin.tx_skfbalbums_fbalbumsdisplay {
view {
partialRootPaths.30 = fileadmin/skfbalbumoverrides/Partials/
}
}
Now instead of using the extensions Raw.html file, it will use your own Raw.html file and any changes you have made to it. You will probably need some custom css file and/or JavaScript, which should be included into your template.
To get the URL for the album cover photo, you can use the following viewhelper
{fbalbum:fbImage(photo: album.coverPhoto, size: 'medium')}
The size property takes as value small, medium and large. From the available image versions that Facebook returns, it tries to find a suitable size and return it’s url.
Single Album Photos
The album list supports as layout
- Plain
- Css Masonry
- Unite Gallery
- Raw So compared to the album list, it has the additional Unite Gallery layout. The rest is the same.
The process is similar to changing the layout of the album list. For overriding the Raw layout, you will need a folder and file
- Folder
fileadmin/skfbalbumoverrides/Partials/Album/Show
- In there the file
fileadmin/skfbalbumoverrides/Partials/Album/Show/ALBUM_SHOW_LAYOUT_SET_IN_PLUGIN.html
Similar to the album list, the viewhelper to return an image source is
{fbalbum:fbImage(photo: photo, size: 'medium')}`