Guest
14 Feb 2014 10:27

I use gallery field also when only one image is needed for several reasons:

I can better control max uploaded file size

the uploaded image can be resized based on my settings and teh original one deleted (to save server space)

unfortunately only today I realized that gallery field has no option for a default image (if no image has been uploaded by the user), which instead is an existing option for the normal image field

I was wondering if adding this option to gallery field too would be too complicated, what do you say?

Last Modified: 02 Mar 2014


Guest
15 Feb 2014 07:03

just discovered... this topic is already covered here:

http://support.mintjoomla.com/en/cobalt-8/ideas/Default +image+for+gallery-3943.html


pepperstreet VIP
Total posts: 3,837
16 Feb 2014 15:09

**FYI - Remote placeholder tools ** ;-)

My personal favorites:

placehold.it

placedog.com

placekitten.com

lorempixel.com

flickholdr.com

Some blog articles with misc links & tools

http://code.tutsplus.com/articles/the-top-8-placeholder-services-for-web-designers--net-19485

http://www.hanselman.com/blog/TheInternetsBestPlaceholderImageSitesForWebDevelopment.aspx

Heads-Up: Some celeb/actor related tools do not randomize the images. Same size means same image.


Guest
17 Feb 2014 07:19

interesting! you never stop to learn new tools :-)


Guest
17 Feb 2014 09:04

thanks pepperstreet, for now I'll give a try to lorempixel.com

here is how I solved the issue (in case other non-programmers like me stumble upon this topic)

I created a customized list template and called image field with a code like this

<a href="/<?php echo JRoute::_($item->url);?>" title="<?php echo $item->title?>">

<div class="pull-left img-placeholder">

<?php if(isset($item->fields_by_id[75])): ?> <?php echo $item->fields_by_id[75]->result; ?> <?php endif; ?> </div></a>

img-placeholder class is something like this

.img-placeholder {height:100px;

    width:100px;

    background-image: url( http://lorempixel.com/100/100/abstract/ );

    margin: 0px 20px 10px 0px;

}

oh and I used a slightly modified output template for the gallery in list view

basically the same as list-simple-one template, but deleting the link to the full record view (as I ahve already inserted it in the customized list template, to have the placeholders linked too)


Guest
17 Feb 2014 09:51

yes, I thought about that, but for now I couldn't find a better solution ... not enough php/css knowledge ._.

maybe knowing how I could generate the placeholder **only if **the gallery field has not been submitted by the user...

but anyway the images will come from lorempixel.com, so this should not affect the page load speed I guess... or am i wrong?

Powered by Cobalt