By Zeosing on Thursday, 07 August 2014
Posted in Technical Issues
Replies 5
Likes 0
Views 806
Votes 0
We created a source in the back-end of easy blog, now we only need to call the source in the blog.archive.list.php file.

Since the code :
<?php echo $row->getImage()->getSource('archive');?>


Doesn´t works, maybe we need to call a helper.

The code in the file thats produce the output list is:

<?php if( $data ){ ?>
<?php foreach ( $data as $row ) { ?>
<li id="entry-<?php echo $row->id; ?>" class="post-wrapper<?php echo !empty( $row->source ) ? ' micro-' . $row->source : ' micro-post';?>">
<time datetime="<?php echo $this->formatDate( '%Y-%m-%d' , $row->created ); ?>">
<?php echo $this->formatDate( $system->config->get('layout_dateformat') , $row->created ); ?>
</time>
<img class="m-archive-image" data-src="<?php echo $row->getImage()->getSource('archive');?>" alt="<?php echo $row->title;?>" />
<a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id); ?>"><?php echo $row->title; ?></a>
</li>
<?php } ?>
<?php } else { ?>
<li>
<div class="eblog-message info mtm"><?php echo $emptyPostMsg;?></div>
</li>
<?php } ?>
</ul>


Note: the data-img is for asyc load images, nothing more.

As always thanks for all.
Hello Zeosing,

I am very sorry but I seem can't understand you well.
Can you explain more what do you mean by "We created a source in the back-end of easy blog"? May I know how do you created this source and where does actually this source located?
Perhaps you can provide us with backend access and ftp access as well so that we're able to understand this better and able to assist you on this issue. Looking forward to hear from you again.

Please be advise.
Thanks.
·
Thursday, 07 August 2014 19:30
·
0 Likes
·
0 Votes
·
0 Comments
·
In theme admin of easy blog you can a source (like "frontpage" "module" etc) as many as you need, them we have to "call" it in order to show it, it´s onlye a matter of routing in easyblog.

For example in front page to call the image in blog.item.php we use :

<img class="m-front-image" data-src="<?php echo $row->getImage()->getSource( 'frontpage' );?>" alt="<?php echo $this->escape( $row->title );?>" />


We need the correct routing type for do the same in blog.archive.list.php

Thaks for the help.
·
Thursday, 07 August 2014 20:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello ZeoSing,

The archive listing doesn't actually use the blog object (Yes, it ***** and it will be updated / fixed in EasyBlog 5). At the mean time, you need to get the blog object using the codes below,


$blog = EasyBlogHelper::getTable('Blog');
$blog->load($row->id);

echo $blog->getImage()->getSource('frontpage');
·
Friday, 08 August 2014 11:23
·
0 Likes
·
0 Votes
·
0 Comments
·
We are close, but the following code only output the last imagen of the list, and we need to fech all of them.

	<ul class="archive-list reset-ul mtl">
<?php if( $data ){ ?>
<?php foreach ( $data as $row ) { ?>
<li id="entry-<?php echo $row->id; ?>" class="post-wrapper<?php echo !empty( $row->source ) ? ' micro-' . $row->source : ' micro-post';?>">
<time datetime="<?php echo $this->formatDate( '%Y-%m-%d' , $row->created ); ?>">
<?php echo $this->formatDate( $system->config->get('layout_dateformat') , $row->created ); ?>
</time>
<?php } ?>
<img class="m-archive-image" data-src="<?php $blog = EasyBlogHelper::getTable( 'Blog' );
$blog->load( $row->id ); echo $blog->getImage()->getSource('archive');?>" alt="<?php echo $row->title;?>">
<a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id); ?>"><?php echo $row->title; ?></a>
</li>
<?php } else { ?>
<li>
<div class="eblog-message info mtm"><?php echo $emptyPostMsg;?></div>
</li>
<?php } ?>
</ul>

Any idea?

Thanks as always Mark.
·
Friday, 08 August 2014 13:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry but we are unable to assist you further on this because customizations are actually beyond the scope of our support policy.

Thanks for understanding.
·
Saturday, 09 August 2014 01:37
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post