-
AuthorPosts
-
seavashr Friend
seavashr
- Join date:
- September 2008
- Posts:
- 21
- Downloads:
- 42
- Uploads:
- 10
- Thanks:
- 3
- Thanked:
- 2 times in 2 posts
April 11, 2015 at 9:18 am #205446Hi
This is an idea and a request: Is there an easy way to add the small version of intro image (generated to be used in JA-ACM) next to the navigation tools (Next / Previous Articles)? See image.
I mean change to: templates/ja_teline_v/html/plg_content_pagenavigation/default.php
[php]<ul class=”pager pagenav”>
<?php if ($row->prev) : ?>
<li class=”previous”>
<a href=”<?php echo $row->prev; ?>” rel=”prev”>
<i class=”fa fa-caret-left”></i>
<span><?php echo JText::_(‘TPL_PREV_ARTICLE’); ?></span>
<strong><?php echo $prev_title; ?></strong>
</a>
</li>
<?php endif; ?><?php if ($row->next) : ?>
<li class=”next”>
<a href=”<?php echo $row->next; ?>” rel=”next”>
<i class=”fa fa-caret-right”></i>
<span><?php echo JText::_(‘TPL_NEXT_ARTICLE’); ?></span>
<strong><?php echo $next_title; ?></strong>
</a>
</li>
<?php endif; ?></ul>[/php]
Adam M ModeratorAdam M
- Join date:
- May 2014
- Posts:
- 5159
- Downloads:
- 33
- Uploads:
- 66
- Thanks:
- 95
- Thanked:
- 1271 times in 1235 posts
April 13, 2015 at 7:36 pm #566808Hi @seavashr,
Look for this block :
if ($row->prev) {
$prev = $rows[$location - 1];
$table->load ($prev->id);
$prev_title = $table->title;
}
if ($row->next) {
$next = $rows[$location + 1];
$table->load ($next->id);
$next_title = $table->title;
}then update as below :
if ($row->prev) {
$prev = $rows[$location - 1];
$table->load ($prev->id);
$prev_title = $table->title;
$article_images = $table->get("images"); // Get image parameters
$pictures = json_decode($article_images); // Split the parameters apart
}
if ($row->next) {
$next = $rows[$location + 1];
$table->load ($next->id);
$next_title = $table->title;
$article_images = $table->get("images"); // Get image parameters
$pictures = json_decode($article_images); // Split the parameters apart
}and add the next / prev image as below :
<?php echo "<img style='float: left; height: 52px; margin-right: 12px;' src='" . $pictures->{'image_intro'} . "' alt='" . $pictures->{'image_intro_alt'} . "'>"; ?>
<i class="fa fa-caret-left"></i><?php echo "<img style='float: right; height: 52px; margin-left: 12px;' src='" . $pictures->{'image_intro'} . "' alt='" . $pictures->{'image_intro_alt'} . "'>"; ?>
<i class="fa fa-caret-right"></i>seavashr Friendseavashr
- Join date:
- September 2008
- Posts:
- 21
- Downloads:
- 42
- Uploads:
- 10
- Thanks:
- 3
- Thanked:
- 2 times in 2 posts
April 14, 2015 at 8:57 am #566886<em>@Adam M 468407 wrote:</em><blockquote>Hi @seavashr,
then update as below :
if ($row->prev) {
$prev = $rows[$location - 1];
$table->load ($prev->id);
$prev_title = $table->title;
$article_images = $table->get("images"); // Get image parameters
$pictures = json_decode($article_images); // Split the parameters apart
}
if ($row->next) {
$next = $rows[$location + 1];
$table->load ($next->id);
$next_title = $table->title;
$article_images = $table->get("images"); // Get image parameters
$pictures = json_decode($article_images); // Split the parameters apart
}and add the next / prev image as below :
<?php echo "<img style='float: left; height: 52px; margin-right: 12px;' src='" . $pictures->{'image_intro'} . "' alt='" . $pictures->{'image_intro_alt'} . "'>"; ?>
<i class="fa fa-caret-left"></i><?php echo "<img style='float: right; height: 52px; margin-left: 12px;' src='" . $pictures->{'image_intro'} . "' alt='" . $pictures->{'image_intro_alt'} . "'>"; ?>
<i class="fa fa-caret-right"></i>
</blockquote>Thank you @adam M
Your solution just needed a little adjustment: at least one of the either the next or previous $pictures needs to be changed to something unique Ie: $pre_pictures. otherwise, it will be overwritten and both will show same image of next image.
Now if you or another person could help me to get the small size image for it, instead of the image article (which is too big) would be just fantastic:
You are using:
[PHP]<?php echo “<img style=’float: left; height: 52px; margin-right: 12px;’ src='” . $pictures->{‘image_intro’} . “‘ alt='” . $pictures->{‘image_intro_alt’} . “‘>”; ?>[/PHP]which gets the full size image
I tired to use:
[PHP]<?php echo JLayoutHelper::render(‘joomla.content.image.intro’, array(‘item’=>$item, ‘img-size’=>’small’)); ?>[/PHP]
which is used to extract small size version of image to be used in ACM, see full code at:
/templates/ja_teline_v/html/layouts/joomla/content/link/default.phpBut couldn’t get the other required codes to call the function properly or been doing something wrong!
Question: how could I upgrade the suggested code to load the generated small size image?
Adam M ModeratorAdam M
- Join date:
- May 2014
- Posts:
- 5159
- Downloads:
- 33
- Uploads:
- 66
- Thanks:
- 95
- Thanked:
- 1271 times in 1235 posts
April 15, 2015 at 9:31 am #567022Hi @seavashr,
Actually the image size will be calculated after we query image url from database so we need to dig further (look for the function used to resize it) but I’m afraid that I couldn’t assist you any further as such customization task is beyond our support scope and you will have to hire a developer to do it for you instead.
1 user says Thank You to Adam M for this useful post
AuthorPostsViewing 4 posts - 1 through 4 (of 4 total)This topic contains 4 replies, has 2 voices, and was last updated by Adam M 9 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Adding small Intro Image to the Navigation (next/previous)
Viewing 4 posts - 1 through 4 (of 4 total)