if listing has no image(s), then do not display placeholder image – possible ?
This topic contains 8 replies, has 3 voices, and was last updated by step8601 8 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: placeholder
-
AuthorPosts
-
January 15, 2016 at 2:42 pm #68552
i think for my dir that if a listing does not have any main image or images that i do not want to display a placeholder image
rather, just display the listing title and the tabs and the sidebar contact stuff, etc, and just collapse the display as if there is/are no main image(s) there
is this possible? i didn’t see example of this in the demo
many thanks
January 15, 2016 at 8:08 pm #68832It is not, I’m sorry.
January 16, 2016 at 2:20 pm #68938i understand
hmmmm, what if i made the default image for the listing page a small thin image, like 400×10 (or whatever)
is this default image used anywhere else, like hompage sliders? (i don’t think so)
perhaps this could work to collapse the listing detail page, but hmmmmm, wonder if google would look at this as spam, like a 1×1 image(?)
thanks
January 16, 2016 at 5:13 pm #68977It will not work… Using a smaller image will not collapse anything.
Thanks
January 17, 2016 at 3:27 pm #69109what about some css to hide things if no image(s)?
for example, i used ff firebug a bit and found that if i removed the geo flex container div, the detail page still looked okay:
might there be a way to put in a conditional like “if no image(s), then hide flex container div”
<div class="geodir_flex-container"> <div class="geodir_flex-loader" style="display: none;"><i class="fa fa-refresh fa-spin"></i></div> <div class="geodir_flexslider flexslider-ltr" id="geodir_slider" style="visibility: visible;"> <div class="geodir-viewport" style="overflow: hidden; position: relative;"><ul class="geodir-slides clearfix" style="width: 2600%; transition-duration: 0.6s; transform: translate3d(-2700px, 0px, 0px);"><li class="clone" aria-hidden="true" style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels2" alt="hotels2" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels2" alt="hotels2" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels27.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;" class=""><img style="max-height:7px;margin:0 auto;" title="hotels11" alt="hotels11" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels11" alt="hotels11" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels118.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;" class=""><img style="max-height:7px;margin:0 auto;" title="hotels10" alt="hotels10" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels10" alt="hotels10" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels105.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;" class=""><img style="max-height:7px;margin:0 auto;" title="hotels12" alt="hotels12" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels12" alt="hotels12" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels126.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;" class="geodir-active-slide"><img style="max-height:7px;margin:0 auto;" title="hotels4" alt="hotels4" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels4" alt="hotels4" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels47.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels1" alt="hotels1" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels1" alt="hotels1" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels119.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels6" alt="hotels6" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels6" alt="hotels6" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels67.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels7" alt="hotels7" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels7" alt="hotels7" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels77.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels8" alt="hotels8" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels8" alt="hotels8" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels87.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels9" alt="hotels9" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels9" alt="hotels9" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels97.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels1" alt="hotels1" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels1" alt="hotels1" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels120.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;"><img style="max-height:7px;margin:0 auto;" title="hotels2" alt="hotels2" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels2" alt="hotels2" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels27.jpg" draggable="false"></li><li style="width: 675px; float: left; display: block;" class="clone" aria-hidden="true"><img style="max-height:7px;margin:0 auto;" title="hotels11" alt="hotels11" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/plugins/geodirectory/geodirectory-assets/images/spacer.gif" draggable="false"><img style="max-height:400px;margin:0 auto;" title="hotels11" alt="hotels11" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels118.jpg" draggable="false"></li></ul></div><ol class="geodir-control-nav geodir-control-paging"><li><a class="">1</a></li><li><a class="">2</a></li><li><a class="">3</a></li><li><a class="geodir-active">4</a></li><li><a>5</a></li><li><a>6</a></li><li><a>7</a></li><li><a>8</a></li><li><a>9</a></li><li><a>10</a></li><li><a>11</a></li></ol><ul class="geodir-direction-nav"><li><a href="#" class="geodir-prev">Previous</a></li><li><a href="#" class="geodir-next">Next</a></li></ul></div> <div class="geodir_flexslider flexslider-ltr" id="geodir_carousel" style="visibility: visible;"> <div class="geodir-viewport" style="overflow: hidden; position: relative;"><ul class="geodir-slides clearfix" style="width: 2200%; transition-duration: 0s; transform: translate3d(0px, 0px, 0px);"><li style="width: 73px; float: left; display: block;" class=""><img style="max-height:48px;margin:0 auto;" title="hotels11" alt="hotels11" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels118.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;" class=""><img style="max-height:48px;margin:0 auto;" title="hotels10" alt="hotels10" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels105.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;" class=""><img style="max-height:48px;margin:0 auto;" title="hotels12" alt="hotels12" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels126.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;" class="geodir-active-slide"><img style="max-height:48px;margin:0 auto;" title="hotels4" alt="hotels4" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels47.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;"><img style="max-height:48px;margin:0 auto;" title="hotels1" alt="hotels1" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels119.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;"><img style="max-height:48px;margin:0 auto;" title="hotels6" alt="hotels6" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels67.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;"><img style="max-height:48px;margin:0 auto;" title="hotels7" alt="hotels7" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels77.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;"><img style="max-height:48px;margin:0 auto;" title="hotels8" alt="hotels8" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels87.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;"><img style="max-height:48px;margin:0 auto;" title="hotels9" alt="hotels9" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels97.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;"><img style="max-height:48px;margin:0 auto;" title="hotels1" alt="hotels1" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels120.jpg" draggable="false"></li><li style="width: 73px; float: left; display: block;"><img style="max-height:48px;margin:0 auto;" title="hotels2" alt="hotels2" src="http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/wp-content/uploads/sites/16/2015/05/hotels27.jpg" draggable="false"></li></ul></div></div> </div>
January 17, 2016 at 3:57 pm #69112With css you can only hide that space in both cases, with or without image.
With PHP you could do what you want with a customization, but it not that simple…Thanks
January 17, 2016 at 4:07 pm #69113thanks paolo
i won’t beat a dead horse but i found the following javascript just now too, a jquery solution is provided too:
https://www.sitepoint.com/community/t/if-empty-hide-divs/4190/3
Paul_WilkinsAdvisor
Sep ’08The traditional javascript way is as follows:
var els = document.getElementsByTagName('div'), el, i; for (i = 0; i < els.length; i += 1) { if (el.className === 'more') { if (!el.firstChild) { el.style.display = 'none'; } } }
In jquery that would be something like
$('#div.more:empty').hide();
January 31, 2016 at 6:59 am #114456
AnonymousHi
Did the JS route work for you?
I have the same wish and wonder if your solution will work for us?
Many thanks
MartinJanuary 31, 2016 at 3:13 pm #114631i haven’t had a chance to try, switching hosts, but would love to know if anyone can get something like this to work
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket