How to display thumbnail in BREAD browse mode with Voyager Laravel Admin
I have a model with name : Category, which has a field is "image_url" (suppose that it's a big photo). How do I only show thumbnail image in BREAD browse mode of Category?
Thank you!
laravel-5 eloquent voyager
add a comment |
I have a model with name : Category, which has a field is "image_url" (suppose that it's a big photo). How do I only show thumbnail image in BREAD browse mode of Category?
Thank you!
laravel-5 eloquent voyager
I'm after something similar: the field references PART of a URL, and I'd like the Browse page to display the image by prefixing the domain/path etc.
– Sp4cecat
Nov 20 '18 at 5:13
add a comment |
I have a model with name : Category, which has a field is "image_url" (suppose that it's a big photo). How do I only show thumbnail image in BREAD browse mode of Category?
Thank you!
laravel-5 eloquent voyager
I have a model with name : Category, which has a field is "image_url" (suppose that it's a big photo). How do I only show thumbnail image in BREAD browse mode of Category?
Thank you!
laravel-5 eloquent voyager
laravel-5 eloquent voyager
asked Nov 13 '18 at 9:38
Tho Bui NgocTho Bui Ngoc
4710
4710
I'm after something similar: the field references PART of a URL, and I'd like the Browse page to display the image by prefixing the domain/path etc.
– Sp4cecat
Nov 20 '18 at 5:13
add a comment |
I'm after something similar: the field references PART of a URL, and I'd like the Browse page to display the image by prefixing the domain/path etc.
– Sp4cecat
Nov 20 '18 at 5:13
I'm after something similar: the field references PART of a URL, and I'd like the Browse page to display the image by prefixing the domain/path etc.
– Sp4cecat
Nov 20 '18 at 5:13
I'm after something similar: the field references PART of a URL, and I'd like the Browse page to display the image by prefixing the domain/path etc.
– Sp4cecat
Nov 20 '18 at 5:13
add a comment |
1 Answer
1
active
oldest
votes
I ended up overriding the default Voyager bread view for the one table, as per https://docs.laravelvoyager.com/customization/overriding-files#overriding-bread-views
.. which says for version 1.1:
You can override any of the BREAD views for a single BREAD by creating
a new folder in resources/views/vendor/voyager/slug-name where
slug-name is the slug that you have assigned for that table. There are
4 files that you can override:
browse.blade.php
edit-add.blade.php
read.blade.php
order.blade.php
Alternatively you can override the views for all BREADs by creating
any of the above files under resources/views/vendor/voyager/bread
.. I just needed to override the 'browse' view. I also created a custom formfield as per https://docs.laravelvoyager.com/customization/adding-custom-formfields - the code for which just returned an <img>
element with the src url correctly formatted.
Finally, in the custom 'browse' view, I added logic to check for the new formfield and returned code to display the image.
Would be SO good if there was another 'Optional Details' field in the BREAD editor for formatting the display in the browse page.
Anyway, hope that helps and I hope someone can point me in the direction of a more straightforward way of doing this ..
Thank you for your answer, It's really good answer. Currently, I think make a custom form field is the best solution. I'm hope in the future, voyager will support more configuration for BREAD display too.
– Tho Bui Ngoc
Dec 7 '18 at 10:40
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%2f53277946%2fhow-to-display-thumbnail-in-bread-browse-mode-with-voyager-laravel-admin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I ended up overriding the default Voyager bread view for the one table, as per https://docs.laravelvoyager.com/customization/overriding-files#overriding-bread-views
.. which says for version 1.1:
You can override any of the BREAD views for a single BREAD by creating
a new folder in resources/views/vendor/voyager/slug-name where
slug-name is the slug that you have assigned for that table. There are
4 files that you can override:
browse.blade.php
edit-add.blade.php
read.blade.php
order.blade.php
Alternatively you can override the views for all BREADs by creating
any of the above files under resources/views/vendor/voyager/bread
.. I just needed to override the 'browse' view. I also created a custom formfield as per https://docs.laravelvoyager.com/customization/adding-custom-formfields - the code for which just returned an <img>
element with the src url correctly formatted.
Finally, in the custom 'browse' view, I added logic to check for the new formfield and returned code to display the image.
Would be SO good if there was another 'Optional Details' field in the BREAD editor for formatting the display in the browse page.
Anyway, hope that helps and I hope someone can point me in the direction of a more straightforward way of doing this ..
Thank you for your answer, It's really good answer. Currently, I think make a custom form field is the best solution. I'm hope in the future, voyager will support more configuration for BREAD display too.
– Tho Bui Ngoc
Dec 7 '18 at 10:40
add a comment |
I ended up overriding the default Voyager bread view for the one table, as per https://docs.laravelvoyager.com/customization/overriding-files#overriding-bread-views
.. which says for version 1.1:
You can override any of the BREAD views for a single BREAD by creating
a new folder in resources/views/vendor/voyager/slug-name where
slug-name is the slug that you have assigned for that table. There are
4 files that you can override:
browse.blade.php
edit-add.blade.php
read.blade.php
order.blade.php
Alternatively you can override the views for all BREADs by creating
any of the above files under resources/views/vendor/voyager/bread
.. I just needed to override the 'browse' view. I also created a custom formfield as per https://docs.laravelvoyager.com/customization/adding-custom-formfields - the code for which just returned an <img>
element with the src url correctly formatted.
Finally, in the custom 'browse' view, I added logic to check for the new formfield and returned code to display the image.
Would be SO good if there was another 'Optional Details' field in the BREAD editor for formatting the display in the browse page.
Anyway, hope that helps and I hope someone can point me in the direction of a more straightforward way of doing this ..
Thank you for your answer, It's really good answer. Currently, I think make a custom form field is the best solution. I'm hope in the future, voyager will support more configuration for BREAD display too.
– Tho Bui Ngoc
Dec 7 '18 at 10:40
add a comment |
I ended up overriding the default Voyager bread view for the one table, as per https://docs.laravelvoyager.com/customization/overriding-files#overriding-bread-views
.. which says for version 1.1:
You can override any of the BREAD views for a single BREAD by creating
a new folder in resources/views/vendor/voyager/slug-name where
slug-name is the slug that you have assigned for that table. There are
4 files that you can override:
browse.blade.php
edit-add.blade.php
read.blade.php
order.blade.php
Alternatively you can override the views for all BREADs by creating
any of the above files under resources/views/vendor/voyager/bread
.. I just needed to override the 'browse' view. I also created a custom formfield as per https://docs.laravelvoyager.com/customization/adding-custom-formfields - the code for which just returned an <img>
element with the src url correctly formatted.
Finally, in the custom 'browse' view, I added logic to check for the new formfield and returned code to display the image.
Would be SO good if there was another 'Optional Details' field in the BREAD editor for formatting the display in the browse page.
Anyway, hope that helps and I hope someone can point me in the direction of a more straightforward way of doing this ..
I ended up overriding the default Voyager bread view for the one table, as per https://docs.laravelvoyager.com/customization/overriding-files#overriding-bread-views
.. which says for version 1.1:
You can override any of the BREAD views for a single BREAD by creating
a new folder in resources/views/vendor/voyager/slug-name where
slug-name is the slug that you have assigned for that table. There are
4 files that you can override:
browse.blade.php
edit-add.blade.php
read.blade.php
order.blade.php
Alternatively you can override the views for all BREADs by creating
any of the above files under resources/views/vendor/voyager/bread
.. I just needed to override the 'browse' view. I also created a custom formfield as per https://docs.laravelvoyager.com/customization/adding-custom-formfields - the code for which just returned an <img>
element with the src url correctly formatted.
Finally, in the custom 'browse' view, I added logic to check for the new formfield and returned code to display the image.
Would be SO good if there was another 'Optional Details' field in the BREAD editor for formatting the display in the browse page.
Anyway, hope that helps and I hope someone can point me in the direction of a more straightforward way of doing this ..
edited Jan 3 at 8:18
answered Dec 5 '18 at 16:04
Sp4cecatSp4cecat
6601715
6601715
Thank you for your answer, It's really good answer. Currently, I think make a custom form field is the best solution. I'm hope in the future, voyager will support more configuration for BREAD display too.
– Tho Bui Ngoc
Dec 7 '18 at 10:40
add a comment |
Thank you for your answer, It's really good answer. Currently, I think make a custom form field is the best solution. I'm hope in the future, voyager will support more configuration for BREAD display too.
– Tho Bui Ngoc
Dec 7 '18 at 10:40
Thank you for your answer, It's really good answer. Currently, I think make a custom form field is the best solution. I'm hope in the future, voyager will support more configuration for BREAD display too.
– Tho Bui Ngoc
Dec 7 '18 at 10:40
Thank you for your answer, It's really good answer. Currently, I think make a custom form field is the best solution. I'm hope in the future, voyager will support more configuration for BREAD display too.
– Tho Bui Ngoc
Dec 7 '18 at 10:40
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53277946%2fhow-to-display-thumbnail-in-bread-browse-mode-with-voyager-laravel-admin%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
I'm after something similar: the field references PART of a URL, and I'd like the Browse page to display the image by prefixing the domain/path etc.
– Sp4cecat
Nov 20 '18 at 5:13