Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichael Lorenzana
12,029 PointsAdding media object and collapsible panels
I am not seeing the thumbnails in order to try out the media object. Also, if anyone can show how to implement the media object inside the list groups and the collapsible panels. That would be great.
Thanks
3 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsYou probably just need to add the src attribute to the image element when adding them from Bootstrap.
You could then include the image in a collapsible Bootstrap accordian snippet like this
<div id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
<div class="media">
<a class="media-left" href="#">
<img class="media-object" data-src="..." alt="Generic placeholder image">
</a>
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</div>
</a>
</h4>
</div>
Quinn Hugo
6,392 PointsYes, but how to make the images smaller? Is there a bootstrap html or custom css for that like there is for img-circle?
Harish Yerra
10,031 PointsHaving the same issue here too. I have the image showing but it is huge, and it isn't rounded or anything.
Michael Lorenzana
12,029 PointsThey have the img-fluid class you can use to make images responsive with bootstrap 4, but it doesn't seem to work in the accordion box. I would probably just re-size the images yourself or set a specific width and height in css for the images. Best of luck
Michael Lorenzana
12,029 PointsMichael Lorenzana
12,029 PointsThe accordion snippet worked for the schedule but the files for the images that are suppose to go on the left are not in the img folder provided in work spaces. I hope they update the workspaces so I can test out those thumbnail images.
Thank you for the help.
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsAre they available in the project downloads? Failing that you could source your own image to test it. It may be better than copying everything Guil is doing, more using the skills he teaches to build your own version of the project, :-)
Harish Yerra
10,031 PointsHarish Yerra
10,031 PointsYa I found them in the project downloads. They should be in there.