Crop and square thumbnails on image folder gallery in TYPO3 LTS9 and still have Original Image on...
There used to be an extension for older TYPO3 versions. How is this to achieve this on a per page basis in TYPO3 LTS9?
Added:
<f:for each="{variants}" key="name" as="variant">
<f:variable name="breakpoint">{variant.breakpoint as integer}</f:variable>
<f:variable name="width">{variant.width as integer}</f:variable>
<f:if condition="{width}">
<source data-variant="{name}" data-maxwidth="{width}" {f:if(condition: breakpoint, then: ' media="(min-width: {breakpoint}px)" ' )}srcset="{f:uri.image(image: file, cropVariant: name, maxWidth: width)}">
</f:if>
</f:for>
<img src="{f:uri.image(image: file,
cropVariant: 'default',
maxWidth: variants.default.width
)}"
title="{file.title}"
alt="{file.alternative}"
>
thumbnails typo3-9.x
add a comment |
There used to be an extension for older TYPO3 versions. How is this to achieve this on a per page basis in TYPO3 LTS9?
Added:
<f:for each="{variants}" key="name" as="variant">
<f:variable name="breakpoint">{variant.breakpoint as integer}</f:variable>
<f:variable name="width">{variant.width as integer}</f:variable>
<f:if condition="{width}">
<source data-variant="{name}" data-maxwidth="{width}" {f:if(condition: breakpoint, then: ' media="(min-width: {breakpoint}px)" ' )}srcset="{f:uri.image(image: file, cropVariant: name, maxWidth: width)}">
</f:if>
</f:for>
<img src="{f:uri.image(image: file,
cropVariant: 'default',
maxWidth: variants.default.width
)}"
title="{file.title}"
alt="{file.alternative}"
>
thumbnails typo3-9.x
add a comment |
There used to be an extension for older TYPO3 versions. How is this to achieve this on a per page basis in TYPO3 LTS9?
Added:
<f:for each="{variants}" key="name" as="variant">
<f:variable name="breakpoint">{variant.breakpoint as integer}</f:variable>
<f:variable name="width">{variant.width as integer}</f:variable>
<f:if condition="{width}">
<source data-variant="{name}" data-maxwidth="{width}" {f:if(condition: breakpoint, then: ' media="(min-width: {breakpoint}px)" ' )}srcset="{f:uri.image(image: file, cropVariant: name, maxWidth: width)}">
</f:if>
</f:for>
<img src="{f:uri.image(image: file,
cropVariant: 'default',
maxWidth: variants.default.width
)}"
title="{file.title}"
alt="{file.alternative}"
>
thumbnails typo3-9.x
There used to be an extension for older TYPO3 versions. How is this to achieve this on a per page basis in TYPO3 LTS9?
Added:
<f:for each="{variants}" key="name" as="variant">
<f:variable name="breakpoint">{variant.breakpoint as integer}</f:variable>
<f:variable name="width">{variant.width as integer}</f:variable>
<f:if condition="{width}">
<source data-variant="{name}" data-maxwidth="{width}" {f:if(condition: breakpoint, then: ' media="(min-width: {breakpoint}px)" ' )}srcset="{f:uri.image(image: file, cropVariant: name, maxWidth: width)}">
</f:if>
</f:for>
<img src="{f:uri.image(image: file,
cropVariant: 'default',
maxWidth: variants.default.width
)}"
title="{file.title}"
alt="{file.alternative}"
>
thumbnails typo3-9.x
thumbnails typo3-9.x
edited Nov 20 '18 at 21:52
Bernd Wilke πφ
5,0821824
5,0821824
asked Nov 20 '18 at 12:01
lunacafulunacafu
177619
177619
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
That can be done with the appropriate templating.
While earlier the rendering was done with typoscript, nowadays the rendering is done with fluid.
You probably use Fluid Styled Content (FSC), this is an system extension and has its original templates at typo3_src/typo3/sysext/fluid_styled_content/Resources/Private/...
Beyond Templates
you will find Image.html
, Textmedia.html
and Textpic.html
,
Those will call the Partial Media/Type/Image.html
Copy those file(s) into your place (site-extension or fileadmin) and change the markup to show a small square thumbnail which is linked to the full image. Use any library for it as you like.
Don't forget to add your template-path /partial-path to the FSC settings.
If you look into this partial you will find a condition which checks for {data.image_zoom}
. If set the small inline image rendered in partial Media/Rendering/Image.html
is linked to a bigger version.
You will find dimensions
and settings
which decide the thumbnail. So you only need the correct configuration to get square thumbnails.
actually I am using the Bootstrap Pkg without, I guess the files I need to look at are in this extension and not in fluid_styled_content?
– lunacafu
Nov 20 '18 at 19:40
I added your file to your question. as we can not format comments, code should be stored in question or answers. for your square image you need to provide the apropriate parameters to thef:uri.image viewhelper.
– Bernd Wilke πφ
Nov 20 '18 at 22:03
add a comment |
After a lot of tweaking in my templates that would not work to my expectations, I came up with the perfect solution for my needs. I was astonished how simple it was in the end, without even changing anything in the original bootstrap_package templates:
I set a condition for pages I want to have square thumbs
[globalVar = TSFE:id=10, TSFE:id=20, TSFE:page|pid=30]
page.includeCSS {
custom_css = fileadmin/site/Resources/Public/Css/custom.css
}
page.includeJSFooter{
scripts = fileadmin/site/Resources/Public/JavaScript/Dist/square_thumbs.js
}
[end]
css:
picture img{
object-fit: cover;
}
js:
var cw = $('picture img').width();
$('picture img').css({'height':cw+'px'});
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392583%2fcrop-and-square-thumbnails-on-image-folder-gallery-in-typo3-lts9-and-still-have%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
That can be done with the appropriate templating.
While earlier the rendering was done with typoscript, nowadays the rendering is done with fluid.
You probably use Fluid Styled Content (FSC), this is an system extension and has its original templates at typo3_src/typo3/sysext/fluid_styled_content/Resources/Private/...
Beyond Templates
you will find Image.html
, Textmedia.html
and Textpic.html
,
Those will call the Partial Media/Type/Image.html
Copy those file(s) into your place (site-extension or fileadmin) and change the markup to show a small square thumbnail which is linked to the full image. Use any library for it as you like.
Don't forget to add your template-path /partial-path to the FSC settings.
If you look into this partial you will find a condition which checks for {data.image_zoom}
. If set the small inline image rendered in partial Media/Rendering/Image.html
is linked to a bigger version.
You will find dimensions
and settings
which decide the thumbnail. So you only need the correct configuration to get square thumbnails.
actually I am using the Bootstrap Pkg without, I guess the files I need to look at are in this extension and not in fluid_styled_content?
– lunacafu
Nov 20 '18 at 19:40
I added your file to your question. as we can not format comments, code should be stored in question or answers. for your square image you need to provide the apropriate parameters to thef:uri.image viewhelper.
– Bernd Wilke πφ
Nov 20 '18 at 22:03
add a comment |
That can be done with the appropriate templating.
While earlier the rendering was done with typoscript, nowadays the rendering is done with fluid.
You probably use Fluid Styled Content (FSC), this is an system extension and has its original templates at typo3_src/typo3/sysext/fluid_styled_content/Resources/Private/...
Beyond Templates
you will find Image.html
, Textmedia.html
and Textpic.html
,
Those will call the Partial Media/Type/Image.html
Copy those file(s) into your place (site-extension or fileadmin) and change the markup to show a small square thumbnail which is linked to the full image. Use any library for it as you like.
Don't forget to add your template-path /partial-path to the FSC settings.
If you look into this partial you will find a condition which checks for {data.image_zoom}
. If set the small inline image rendered in partial Media/Rendering/Image.html
is linked to a bigger version.
You will find dimensions
and settings
which decide the thumbnail. So you only need the correct configuration to get square thumbnails.
actually I am using the Bootstrap Pkg without, I guess the files I need to look at are in this extension and not in fluid_styled_content?
– lunacafu
Nov 20 '18 at 19:40
I added your file to your question. as we can not format comments, code should be stored in question or answers. for your square image you need to provide the apropriate parameters to thef:uri.image viewhelper.
– Bernd Wilke πφ
Nov 20 '18 at 22:03
add a comment |
That can be done with the appropriate templating.
While earlier the rendering was done with typoscript, nowadays the rendering is done with fluid.
You probably use Fluid Styled Content (FSC), this is an system extension and has its original templates at typo3_src/typo3/sysext/fluid_styled_content/Resources/Private/...
Beyond Templates
you will find Image.html
, Textmedia.html
and Textpic.html
,
Those will call the Partial Media/Type/Image.html
Copy those file(s) into your place (site-extension or fileadmin) and change the markup to show a small square thumbnail which is linked to the full image. Use any library for it as you like.
Don't forget to add your template-path /partial-path to the FSC settings.
If you look into this partial you will find a condition which checks for {data.image_zoom}
. If set the small inline image rendered in partial Media/Rendering/Image.html
is linked to a bigger version.
You will find dimensions
and settings
which decide the thumbnail. So you only need the correct configuration to get square thumbnails.
That can be done with the appropriate templating.
While earlier the rendering was done with typoscript, nowadays the rendering is done with fluid.
You probably use Fluid Styled Content (FSC), this is an system extension and has its original templates at typo3_src/typo3/sysext/fluid_styled_content/Resources/Private/...
Beyond Templates
you will find Image.html
, Textmedia.html
and Textpic.html
,
Those will call the Partial Media/Type/Image.html
Copy those file(s) into your place (site-extension or fileadmin) and change the markup to show a small square thumbnail which is linked to the full image. Use any library for it as you like.
Don't forget to add your template-path /partial-path to the FSC settings.
If you look into this partial you will find a condition which checks for {data.image_zoom}
. If set the small inline image rendered in partial Media/Rendering/Image.html
is linked to a bigger version.
You will find dimensions
and settings
which decide the thumbnail. So you only need the correct configuration to get square thumbnails.
answered Nov 20 '18 at 14:39
Bernd Wilke πφBernd Wilke πφ
5,0821824
5,0821824
actually I am using the Bootstrap Pkg without, I guess the files I need to look at are in this extension and not in fluid_styled_content?
– lunacafu
Nov 20 '18 at 19:40
I added your file to your question. as we can not format comments, code should be stored in question or answers. for your square image you need to provide the apropriate parameters to thef:uri.image viewhelper.
– Bernd Wilke πφ
Nov 20 '18 at 22:03
add a comment |
actually I am using the Bootstrap Pkg without, I guess the files I need to look at are in this extension and not in fluid_styled_content?
– lunacafu
Nov 20 '18 at 19:40
I added your file to your question. as we can not format comments, code should be stored in question or answers. for your square image you need to provide the apropriate parameters to thef:uri.image viewhelper.
– Bernd Wilke πφ
Nov 20 '18 at 22:03
actually I am using the Bootstrap Pkg without, I guess the files I need to look at are in this extension and not in fluid_styled_content?
– lunacafu
Nov 20 '18 at 19:40
actually I am using the Bootstrap Pkg without, I guess the files I need to look at are in this extension and not in fluid_styled_content?
– lunacafu
Nov 20 '18 at 19:40
I added your file to your question. as we can not format comments, code should be stored in question or answers. for your square image you need to provide the apropriate parameters to the
f:uri.image viewhelper.
– Bernd Wilke πφ
Nov 20 '18 at 22:03
I added your file to your question. as we can not format comments, code should be stored in question or answers. for your square image you need to provide the apropriate parameters to the
f:uri.image viewhelper.
– Bernd Wilke πφ
Nov 20 '18 at 22:03
add a comment |
After a lot of tweaking in my templates that would not work to my expectations, I came up with the perfect solution for my needs. I was astonished how simple it was in the end, without even changing anything in the original bootstrap_package templates:
I set a condition for pages I want to have square thumbs
[globalVar = TSFE:id=10, TSFE:id=20, TSFE:page|pid=30]
page.includeCSS {
custom_css = fileadmin/site/Resources/Public/Css/custom.css
}
page.includeJSFooter{
scripts = fileadmin/site/Resources/Public/JavaScript/Dist/square_thumbs.js
}
[end]
css:
picture img{
object-fit: cover;
}
js:
var cw = $('picture img').width();
$('picture img').css({'height':cw+'px'});
add a comment |
After a lot of tweaking in my templates that would not work to my expectations, I came up with the perfect solution for my needs. I was astonished how simple it was in the end, without even changing anything in the original bootstrap_package templates:
I set a condition for pages I want to have square thumbs
[globalVar = TSFE:id=10, TSFE:id=20, TSFE:page|pid=30]
page.includeCSS {
custom_css = fileadmin/site/Resources/Public/Css/custom.css
}
page.includeJSFooter{
scripts = fileadmin/site/Resources/Public/JavaScript/Dist/square_thumbs.js
}
[end]
css:
picture img{
object-fit: cover;
}
js:
var cw = $('picture img').width();
$('picture img').css({'height':cw+'px'});
add a comment |
After a lot of tweaking in my templates that would not work to my expectations, I came up with the perfect solution for my needs. I was astonished how simple it was in the end, without even changing anything in the original bootstrap_package templates:
I set a condition for pages I want to have square thumbs
[globalVar = TSFE:id=10, TSFE:id=20, TSFE:page|pid=30]
page.includeCSS {
custom_css = fileadmin/site/Resources/Public/Css/custom.css
}
page.includeJSFooter{
scripts = fileadmin/site/Resources/Public/JavaScript/Dist/square_thumbs.js
}
[end]
css:
picture img{
object-fit: cover;
}
js:
var cw = $('picture img').width();
$('picture img').css({'height':cw+'px'});
After a lot of tweaking in my templates that would not work to my expectations, I came up with the perfect solution for my needs. I was astonished how simple it was in the end, without even changing anything in the original bootstrap_package templates:
I set a condition for pages I want to have square thumbs
[globalVar = TSFE:id=10, TSFE:id=20, TSFE:page|pid=30]
page.includeCSS {
custom_css = fileadmin/site/Resources/Public/Css/custom.css
}
page.includeJSFooter{
scripts = fileadmin/site/Resources/Public/JavaScript/Dist/square_thumbs.js
}
[end]
css:
picture img{
object-fit: cover;
}
js:
var cw = $('picture img').width();
$('picture img').css({'height':cw+'px'});
answered Nov 25 '18 at 8:02
lunacafulunacafu
177619
177619
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392583%2fcrop-and-square-thumbnails-on-image-folder-gallery-in-typo3-lts9-and-still-have%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown