Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • seavashr Friend
    #205446

    Hi

    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]


    1. 1428742352109screensave
    Adam M Moderator
    #566808

    Hi @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 Friend
    #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.php

    But 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 Moderator
    #567022

    Hi @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.

Viewing 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