- Posts: 3
COMMUNITY FORUM
Urgent Help - Hyperlink Item Image
- chengeh madondo
- Topic Author
- Offline
- New Member
Less
More
7 years 11 months ago #158512
by chengeh madondo
Urgent Help - Hyperlink Item Image was created by chengeh madondo
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 11 months ago #158519
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Urgent Help - Hyperlink Item Image
Only via a template override - getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates - and have an extrafield replace the modal's links.
You can find examples on how to work on extrafields here github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php
You can find examples on how to work on extrafields here github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- chengeh madondo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
7 years 11 months ago #158524
by chengeh madondo
Replied by chengeh madondo on topic Urgent Help - Hyperlink Item Image
thanks let me try that out and revert
Please Log in or Create an account to join the conversation.
- chengeh madondo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
7 years 11 months ago #158526
by chengeh madondo
Replied by chengeh madondo on topic Urgent Help - Hyperlink Item Image
I have only gone far as copying and duplicating the com_k2 folder... the rest is to technical for me. All i want is for these images which will then appear as imgur.com/brsUPhR on the homepage to have hyperlinks to menu items or external links. Also tried to add extra_field link in the k2 backend but its not working or maybe am not sure how it works
Saw a post that said
REPLACE FROM ITEM.PHP IN TEMPLATES/YOURTEMPLATE/HTML/COMK2/PORTFOLIO
which in my case is
<?php if(!empty($this->item->fulltext)): ?>
<?php if($this->item->params->get('itemIntroText')): ?>
<!-- Item introtext -->
<?php echo $this->item->introtext; ?>
<?php endif; ?>
<?php if($this->item->params->get('itemFullText')): ?>
<?php echo $this->item->fulltext; ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->item->introtext; ?>
<?php endif; ?>
WITH
<?php
$var = $this->item->extraFields->Image->value ;
$var = preg_replace('/<img src="/',"",$var);
$var = preg_replace('/" alt="Image" \>/'," ",$var);
echo '<a href="' . $var . "TextOfLink" . "</a>" ;
?>
AM STUCK
Saw a post that said
REPLACE FROM ITEM.PHP IN TEMPLATES/YOURTEMPLATE/HTML/COMK2/PORTFOLIO
which in my case is
<?php if(!empty($this->item->fulltext)): ?>
<?php if($this->item->params->get('itemIntroText')): ?>
<!-- Item introtext -->
<?php echo $this->item->introtext; ?>
<?php endif; ?>
<?php if($this->item->params->get('itemFullText')): ?>
<?php echo $this->item->fulltext; ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->item->introtext; ?>
<?php endif; ?>
WITH
<?php
$var = $this->item->extraFields->Image->value ;
$var = preg_replace('/<img src="/',"",$var);
$var = preg_replace('/" alt="Image" \>/'," ",$var);
echo '<a href="' . $var . "TextOfLink" . "</a>" ;
?>
AM STUCK
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 11 months ago #158557
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Urgent Help - Hyperlink Item Image
How are these images generated.
These are not the item's image. Is this a category view? Is this a gallery?
These are not the item's image. Is this a category view? Is this a gallery?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.