-
AuthorPosts
-
mikel2004 Friend
mikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 3, 2014 at 1:16 pm #195393Hi!
Can I convert the intro images to a link in category blog pages? How?Thanks a lot
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
March 4, 2014 at 2:49 am #525150Hi Mikel,
Ninja Lead did suggest you to add link for images in category blog pages here: http://www.joomlart.com/forums/topic/image-intro-article-with-link-url/#post-524250. Please have a look.
mikel2004 Friendmikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 4, 2014 at 8:09 am #525208Hi Saguaros,
He found a solution for articles pages, not for category blog pages.The Ninja code works in this file:
templates/ja_teline_iv_t3/html/com_content/article/default.phpbut not in this file:
/templates/ja_teline_iv_t3/html/com_content/category/blog_item.php fileThanks
<em>@Saguaros 414421 wrote:</em><blockquote>Hi Mikel,
Ninja Lead did suggest you to add link for images in category blog pages here: http://www.joomlart.com/forums/topic/image-intro-article-with-link-url/#post-524250. Please have a look.</blockquote>
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
March 6, 2014 at 4:30 am #525582His last code (14th reply) is for article and you should try the code in 12th reply for category bog
mikel2004 Friendmikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 6, 2014 at 11:33 am #525638And, (in 13th reply) I reply that I try with the code in category blog file but does not work.
<em>@mikel2004 413592 wrote:</em><blockquote>I put your code in the /templates/ja_teline_iv_t3/html/com_content/category/blog_item.php file
But not works 🙁
</blockquote><em>@Saguaros 414953 wrote:</em><blockquote>His last code (14th reply) is for article and you should try the code in 12th reply for category bog</blockquote>
So, can you help me?
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
March 10, 2014 at 7:47 am #526020It’s weird as I just tried to apply that solution at my end and it worked. Here is what I follow:
– Open the file: templatesja_teline_iv_t3htmlcom_contentcategoryblog_item.php
– Replace this snippet of code:
<?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?>"> <img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </div>
<?php endif; ?>
with:
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
<?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?>"> <img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </div>
<?php else:
$regex = "/<img[^>]*>/";
$image = '';
if (preg_match_all($regex,$this->item->introtext, $matches)) {
$this->item->introtext = preg_replace ($regex, '', $this->item->introtext);
$image = implode ("n", $matches[0]);
}
?>
<?php if ($image): ?>
<div class="pull-"><?php echo $image ?></div>
<?php endif; ?><?php endif; ?>
</a>
Please give it a try again.
mikel2004 Friendmikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 10, 2014 at 2:21 pm #526103Hi Saguaros!
Your code not working with intro images of the articles, but it works if the image are in the article code like this:
<p><img class=”caption” src=”fotos/fichas/tribalistas-passe-em-casa.jpg” /></p>Can you see the differences here:
http://veintiuno.czoom.co/videoclipSo, what can I do to have the link in Intro images?
Thanks!!
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
March 11, 2014 at 7:29 am #526238Hi Mike,
Please open the blog_item.php file above and change:
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
<?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?>"> <img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </div>
To:
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
<?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?>"> <a href="<?php echo $this->item->readmore_link; ?>"><img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </a></div>
Let me know if it helps.
mikel2004 Friendmikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 11, 2014 at 11:50 am #526292Regrettably, nothing change.
My blog_item.php code, now is:
<!– Article –>
<?php
$aclass = ”;
if($params->get(‘show_create_date’)){
$aclass = ‘ class=”has-date”‘;
}
?>
<article <?php echo $aclass ?>><a href=”<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>”>
<?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_intro)) ? $params->get(‘float_intro’) : $images->float_intro; ?>
<div class=”pull-<?php echo htmlspecialchars($imgfloat); ?>”> <a href=”<?php echo $this->item->readmore_link; ?>”><img
<?php if ($images->image_intro_caption):
echo ‘class=”caption”‘.’ title=”‘ .htmlspecialchars($images->image_intro_caption) .'”‘;
endif; ?>
src=”<?php echo htmlspecialchars($images->image_intro); ?>” alt=”<?php echo htmlspecialchars($images->image_intro_alt); ?>”/> </a></div>
<?php else:
$regex = “/<img[^>]*>/”;
$image = ”;
if (preg_match_all($regex,$this->item->introtext, $matches)) {
$this->item->introtext = preg_replace ($regex, ”, $this->item->introtext);
$image = implode (“n”, $matches[0]);
}
?>
<?php if ($image): ?><div class=”pull-“><?php echo $image ?></div>
<?php endif; ?><?php endif; ?>
</a><?php if ($params->get(‘show_title’)) : ?>
<header class=”article-header clearfix”>
<h2 class=”article-title”>
<?php if ($params->get(‘link_titles’) && $params->get(‘access-view’)) : ?>
<a href=”<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>”> <?php echo $this->escape($this->item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h2>
</header>
<?php endif; ?><!– Aside –>
<?php if ($hasInfo || $hasCtrl) : ?>
<aside class=”article-tools article-aside row-fluid”>
<div class=”span9″>
<?php // to do not that elegant would be nice to group the params ?>
<?php if ($hasInfo) : ?>
<dl class=”article-info”>
<dt class=”article-info-term”></dt>
<?php if ($params->get(‘show_parent_category’) && $this->item->parent_id != 1) : ?>
<dd class=”parent-category-name”>
<?php $title = $this->escape($this->item->parent_title);
$url = ‘<a href=”‘ . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_id)) . ‘”>’ . $title . ‘</a>’; ?>
<?php if ($params->get(‘link_parent_category’)) : ?>
<?php echo JText::sprintf(‘COM_CONTENT_PARENT’, ‘<span>’.$url.'</span>’); ?>
<?php else : ?>
<?php echo JText::sprintf(‘COM_CONTENT_PARENT’, ‘<span>’.$title.'</span>’); ?>
<?php endif; ?>
</dd>
<?php endif; ?><?php if ($params->get(‘show_category’)) : ?>
<dd class=”category-name”>
<?php $title = $this->escape($this->item->category_title);
$url = ‘<a href=”‘ . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catid)) . ‘”>’ . $title . ‘</a>’; ?>
<?php if ($params->get(‘link_category’)) : ?>
<?php echo JText::sprintf(‘COM_CONTENT_CATEGORY’, ‘<span>’.$url.'</span>’); ?>
<?php else : ?>
<?php echo JText::sprintf(‘COM_CONTENT_CATEGORY’, ‘<span>’.$title.'</span>’); ?>
<?php endif; ?>
</dd>
<?php endif; ?><?php if ($params->get(‘show_create_date’)) : ?>
<dd class=”create ja-blog-date”>
<div class=”inner clearfix”>
<?php
$createDay = date(‘d’, strtotime( $this->item->created));
$createMonth = JText::_(strtoupper(date(‘F’, strtotime($this->item->created))).”_SHORT”);
$createYear = date(‘Y’, strtotime( $this->item->created));
?>
<span class=”date”><?php echo $createDay; ?></span>
<span class=”month-year”>
<strong><?php echo $createMonth; ?></strong>
<strong><?php echo $createYear; ?></strong>
</span><?php echo $this->item->event->afterDisplayTitle; ?>
</div>
</dd>
<?php endif; ?><?php if ($params->get(‘show_modify_date’)) : ?>
<dd class=”modified”><?php echo JText::sprintf(‘COM_CONTENT_LAST_UPDATED’, ‘<span>’.JHtml::_(‘date’, $this->item->modified, JText::_(‘DATE_FORMAT_LC3′)).'</span>’); ?> </dd>
<?php endif; ?><?php if ($params->get(‘show_publish_date’)) : ?>
<dd class=”published”>
<?php echo JText::sprintf(‘COM_CONTENT_PUBLISHED_DATE_ON’, ‘<span>’.JHtml::_(‘date’, $this->item->publish_up, JText::_(‘DATE_FORMAT_LC2′)).'</span>’); ?>
</dd>
<?php endif; ?><?php if ($params->get(‘show_author’) && !empty($this->item->author )) : ?>
<dd class=”createdby”>
<?php $author = $this->item->author; ?>
<?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>
<?php if (!empty($this->item->contactid ) && $params->get(‘link_author’) == true):?>
<?php echo JText::sprintf(‘COM_CONTENT_WRITTEN_BY’ ,
‘<span>’.JHtml::_(‘link’, JRoute::_(‘index.php?option=com_contact&view=contact&id=’.$this->item->contactid), $author).'</span>’); ?>
<?php else :?>
<?php echo JText::sprintf(‘COM_CONTENT_WRITTEN_BY’, ‘<span>’.$author.'</span>’); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get(‘show_hits’)) : ?>
<dd class=”hits”>
<?php echo JText::sprintf(‘COM_CONTENT_ARTICLE_HITS’, $this->item->hits); ?>
</dd>
<?php endif; ?>
</dl>
<?php endif; ?>
</div>
<div class=”span3 pull-right”>
<?php if ($hasCtrl) : ?><ul class=”actions”>
<?php if ($params->get(‘show_print_icon’)) : ?>
<li class=”print-icon”> <?php echo JHtml::_(‘icon.print_popup’, $this->item, $params); ?> </li>
<?php endif; ?><?php if ($params->get(‘show_email_icon’)) : ?>
<li class=”email-icon”> <?php echo JHtml::_(‘icon.email’, $this->item, $params); ?> </li>
<?php endif; ?><?php if ($canEdit) : ?>
<li class=”edit-icon”> <?php echo JHtml::_(‘icon.edit’, $this->item, $params); ?> </li>
<?php endif; ?></ul>
<?php endif; ?>
</div></aside>
<?php endif; ?>
<!– //Aside –><section class=”article-intro clearfix”>
<?php if (!$params->get(‘show_intro’)) : ?>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?><?php echo $this->item->introtext; ?>
</section><?php if ($params->get(‘show_readmore’) && $this->item->readmore) :
if ($params->get(‘access-view’)) :
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
else :
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link1 = JRoute::_(‘index.php?option=com_users&view=login&Itemid=’ . $itemId);
$returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
$link = new JURI($link1);
$link->setVar(‘return’, base64_encode($returnURL));
endif;?>
<div class=”readmore”>
<a class=”btn” href=”<?php echo $link; ?>”>
<span>
<?php if (!$params->get(‘access-view’)) :
echo JText::_(‘COM_CONTENT_REGISTER_TO_READ_MORE’);
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get(‘show_readmore_title’, 0) != 0) :
echo JHtml::_(‘string.truncate’, ($this->item->title), $params->get(‘readmore_limit’));
endif;
elseif ($params->get(‘show_readmore_title’, 0) == 0) :
echo JText::sprintf(‘COM_CONTENT_READ_MORE_TITLE’);
else :
echo JText::_(‘COM_CONTENT_READ_MORE’);
echo JHtml::_(‘string.truncate’, ($this->item->title), $params->get(‘readmore_limit’));
endif; ?>
</span>
</a>
</div>
</section><?php endif; ?>
</article>I have something wrong?
Thanks!
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
March 14, 2014 at 8:33 am #526706It’s weird as code works fine at my end, give me more time, I will check directly in your site.
mikel2004 Friendmikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 14, 2014 at 10:11 am #526722Ok!!
Thanks!!
<em>@Saguaros 416332 wrote:</em><blockquote>It’s weird as code works fine at my end, give me more time, I will check directly in your site.</blockquote>
mikel2004 Friendmikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 17, 2014 at 6:12 pm #527018Any news to help me?
Thanks
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
March 19, 2014 at 3:45 pm #527359I realize that the above code is not effective when you add image of article via ‘Images and Links’ Option in backend settings of article. In videoclip page of your site, I just try to change the way of adding image by adding it directly in content of article named: Crazy Clown Time (David Lynch, 2012) and it works, please have a look: http://veintiuno.czoom.co/videoclip
mikel2004 Friendmikel2004
- Join date:
- January 2012
- Posts:
- 201
- Downloads:
- 0
- Uploads:
- 51
- Thanks:
- 24
- Thanked:
- 3 times in 1 posts
March 19, 2014 at 5:52 pm #527369Yes, I know that. I tell you this in my post number 7:
<em>@mikel2004 415599 wrote:</em><blockquote>Hi Saguaros!Your code not working with intro images of the articles, but it works if the image are in the article code like this:
<p><img class=”caption” src=”fotos/fichas/tribalistas-passe-em-casa.jpg” /></p>Can you see the differences here:
http://veintiuno.czoom.co/videoclipSo, what can I do to have the link in Intro images?
Thanks!!</blockquote>
Well… I have all my articles with the image of article via ‘Images and Links’ Option.
So, I really need that your code work for images via ‘Images and Links’.If you can… I really appreciate it a lot.
Thanks again!
<em>@Saguaros 417158 wrote:</em><blockquote>I realize that the above code is not effective when you add image of article via ‘Images and Links’ Option in backend settings of article. In videoclip page of your site, I just try to change the way of adding image by adding it directly in content of article named: Crazy Clown Time (David Lynch, 2012) and it works, please have a look: http://veintiuno.czoom.co/videoclip</blockquote>
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
AuthorPostsThis topic contains 18 replies, has 2 voices, and was last updated by mikel2004 10 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum