By Mel on Tuesday, 09 February 2016
Posted in General Issues
Likes 0
Views 356
Votes 0
Hi,

1. I have 2 categories that use imported rss feeds from a 3rd party that never has images. I know it is possible to have a default image show in these situations, but was wondering if it was possible to have different default images display depending on the category? For example, for category 1 I would like my posts to display a globe (when there is no image) and for category 2 I would like to show a head.The only reason is for the front pages to look better.

2. Ideally, it would be good to have a folder where we could upload a number of images for the situations where there are no images and one of these is randomly selected each time a blog is imported (so that the same image isn't displayed over and over, but guessing thats impossible

Is there any way of achieving the first question?

Kind regards

Mel

Update
I think |I may have found a solution for my option 2 above.

I found the file (I think) that needs editing:
/modules/mod_easybloglatestblogs/tmpl/default_item.php

And adding the following code here:
if (!$postCover && $params->get('show_photo_placeholder', false)) {
$postCover = $post->getImage($photoSize, true);
}
?>
$path='/components/com_easyblog/themes/wireframe/images/placeholder-image.png';
if(stristr($postCover,$path) !==false){
$dir = "images/blogplaceholder/";
$images = scandir($dir);
$i = rand(2, sizeof($images)-1);
$postCover="images/".$images[$i];
}
<?php if ($postCover) { ?>


However, I just get the code showing on the front end above the blank existing placeholder (see image attached)

Have I got the correct path to thew Latest Blogs placeholder image? Are you able to advise as to what is missing in my code?

Mel
Hey Mel,

I am sorry but unfortunately this is not possible at this point of time The only way is for your to customize the theme files to:

1. Detect the post's category

2. Display the default cover based on #1
·
Wednesday, 10 February 2016 12:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

no worries.

Thanks for responding.

Kind regards

Mel
Mel
·
Wednesday, 10 February 2016 20:53
·
0 Likes
·
0 Votes
·
0 Comments
·
No problem Mel, thanks for understanding
·
Thursday, 11 February 2016 02:09
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post