related Items in k2 with Images

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Fri Mar 08, 2013 12:57 pm
Reply with quote
Report this post
Dear Team,

Thanks for your help as always :)

We want to show on each article related k2 Items, recommendation with images, in horizontal mode,
I already set parameter in option to show images but images still now showing.
Can we set next prev button for more recommendations exactly like slider ?

thanks
User avatar
Expert Boarder

Konrad M
Fri Mar 08, 2013 2:02 pm
Reply with quote
Report this post
Hi,
please go to /html and change com_k2 folder name for a moment. Then please check if you are able to see images and let me know.
User avatar

GK User
Fri Mar 08, 2013 3:30 pm
Reply with quote
Report this post
Dear Konard

Thanks for your reply, i tried to change foleder name, related articles was showing with images, but layout was messed up by changing name can you tell me in code where i have to add some lines to keep layout.
With next prev buttons solution.

Thanks
User avatar
Expert Boarder

Konrad M
Mon Mar 11, 2013 12:16 pm
Reply with quote
Report this post
Please name this folder com_k2 again and then please edit html/com_k2/templates/default.item.php and find:
Code: Select all
<ul>
                           <?php foreach($this->relatedItems as $key=>$item): ?>
                           <li class="<?php echo ($key%2) ? "odd" : "even"; ?>"> <a class="itemRelTitle" href="<?php echo $item->link ?>"><?php echo $item->title; ?></a> </li>
                           <?php endforeach; ?>
                  </ul>

change it to this:
Code: Select all
<ul>
                           <?php foreach($this->relatedItems as $key=>$item): ?>
                           <li class="<?php echo ($key%2) ? "odd" : "even"; ?>">
<?php if($this->item->params->get('itemRelatedImageSize')): ?>
            <img style="width:<?php echo $item->imageWidth; ?>px;height:auto;" class="itemRelImg" src="<?php echo $item->image; ?>" alt="<?php K2HelperUtilities::cleanHtml($item->title); ?>" />
            <?php endif; ?>
<a class="itemRelTitle" href="<?php echo $item->link ?>"><?php echo $item->title; ?></a> </li>
                           <?php endforeach; ?>
                  </ul>
User avatar

GK User
Mon Mar 11, 2013 1:40 pm
Reply with quote
Report this post
Dear Konrad

Thanks for your help, Its works fine but i have to show linear display with limited words in title box not full title, similar like below images

I added code into override CSS but its not working.
Code: Select all
#k2Container .itemRelated {width: 100%}
#k2Container .itemRelated li {display: table-cell; background-image:none!important;}
User avatar
Expert Boarder

Konrad M
Mon Mar 11, 2013 2:07 pm
Reply with quote
Report this post
Please give me url to page with this issue.
User avatar

GK User
Mon Mar 11, 2013 2:15 pm
Reply with quote
Report this post
Thanks for quick Reply, Just sent you PM. Thanks

Konrad M wrote:Please give me url to page with this issue.
User avatar
Expert Boarder

GK User
Tue Mar 12, 2013 10:03 pm
Reply with quote
Report this post
Hi

Thanks for you help, Have you got my PM.

Thanks
User avatar
Expert Boarder

Konrad M
Wed Mar 13, 2013 11:41 am
Reply with quote
Report this post
Please try this add this code to the override.css
Code: Select all
.itemAuthorContent ul li {
    display: inline;
    float: left;
    padding: 5px 10px 5px 0;
    width: auto;
}
.itemAuthorContent li .itemRelImg {
    display:block;
}
.itemAuthorContent li .itemRelTitle {
    display: block;
    width: 200px;
}
User avatar

GK User
Wed Mar 13, 2013 12:41 pm
Reply with quote
Report this post
Thanks Konard,

Thanks Alot, Have a great day
User avatar
Expert Boarder

GK User
Sun Mar 29, 2015 8:34 pm
Reply with quote
Report this post
Dear Team,

your tips to achieve this goal were awesome.
Do we have any chance to make the related article image linkable?

Should be nice, so the user can reach the article just tapping the image,

I'd really appreciate some tips of code for that,

Thanks in advance
User avatar
Expert Boarder


cron