How to display thumbnail in BREAD browse mode with Voyager Laravel Admin












1
















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!










share|improve this question






















  • 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
















1
















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!










share|improve this question






















  • 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














1












1








1









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!










share|improve this question















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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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












1 Answer
1






active

oldest

votes


















1














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 ..






share|improve this answer























  • 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











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
});


}
});














draft saved

draft discarded


















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









1














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 ..






share|improve this answer























  • 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
















1














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 ..






share|improve this answer























  • 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














1












1








1






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 ..






share|improve this answer














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 ..







share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python