UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
It is currently off working hours and most of us aren't around

Rest assured that we will get back to you as soon as the day starts tomorrow!
It is currently a public holiday for us from where we are at.

There may be a delay in our responses but rest assured that we will be back at full speed when we are back to the office.
  Support is offline

Different fallback images based on category

Mel · ·
8:40 PM Tuesday, 09 February 2016
None
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
The replies under this section are restricted to logged in users or users with an active subscription with us