- Posts: 71
COMMUNITY FORUM
[SOLVED] Redirect Multiple K2 item to one K2 item
- Moustakakis
-
Topic Author
- Offline
- Senior Member
Less
More
11 years 4 months ago #121467
by Moustakakis
[SOLVED] Redirect Multiple K2 item to one K2 item was created by Moustakakis
Hello everybody,
I have a difficulty several weeks now and I need your help.
I have created to categories in K2, the categories "articles" and "home". In the "articles" I have 8 items which is the main articles (unique). In the category "home" I have 18 items which I would like to use them as alias to the main articles. To explain you better I will use an example.
I have 18 boxes that I have used 4 boxes with the item "About" and id's 355, 356, 357 and 358. I would like the 355, 356, 357 and 358 k2 items to be connected/redirected/linked to the main k2 item which is the item with the id 323. I would like to do this customization in order to change one item for an article instead 5 that it is in the example. Is it possible and if yes how can I do it?
Thank you.
I have a difficulty several weeks now and I need your help.
I have created to categories in K2, the categories "articles" and "home". In the "articles" I have 8 items which is the main articles (unique). In the category "home" I have 18 items which I would like to use them as alias to the main articles. To explain you better I will use an example.
I have 18 boxes that I have used 4 boxes with the item "About" and id's 355, 356, 357 and 358. I would like the 355, 356, 357 and 358 k2 items to be connected/redirected/linked to the main k2 item which is the item with the id 323. I would like to do this customization in order to change one item for an article instead 5 that it is in the example. Is it possible and if yes how can I do it?
Thank you.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
11 years 4 months ago #121468
by Yiota
Replied by Yiota on topic Re: Redirect Multiple K2 item to one K2 item
You will have to modify category_item.php and add the new link to the title, image, and read more elements.
This modification needs to be done in the K2 template overrides. Read here getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates on how the overrides work if you do not use already.
This modification needs to be done in the K2 template overrides. Read here getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates on how the overrides work if you do not use already.
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 71
11 years 4 months ago #121469
by Moustakakis
Replied by Moustakakis on topic Re: Redirect Multiple K2 item to one K2 item
Hello,
I have done successfully the following.
But I have difficulties to the next step
Could you give me an example what I have to add?
Thank you.
I have done successfully the following.
This modification needs to be done in the K2 template overrides. Read here getk2.org/documentation/tutorials/174-te...pts-of-sub-templates on how the overrides work if you do not use already.
But I have difficulties to the next step
You will have to modify category_item.php and add the new link to the title, image, and read more elements.
Could you give me an example what I have to add?
Thank you.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
11 years 4 months ago #121470
by Yiota
Replied by Yiota on topic Re: Redirect Multiple K2 item to one K2 item
You need to locate these blocks of code
for title
for image
for readmoreand in the href="...." of each one just put your own link of the item you want.
for title
<?php if($this->item->params->get('catItemTitle')): ?>
<!-- Item title -->
<h3 class="catItemTitle">
<?php if(isset($this->item->editLink)): ?>
<!-- Item edit link -->
<span class="catItemEditLink">
<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $this->item->editLink; ?>">
<?php echo JText::_('K2_EDIT_ITEM'); ?>
</a>
</span>
<?php endif; ?>
<?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>">
<?php echo $this->item->title; ?>
</a>
<?php else: ?>
<?php echo $this->item->title; ?>
<?php endif; ?>
<?php if($this->item->params->get('catItemFeaturedNotice') && $this->item->featured): ?>
<!-- Featured flag -->
<span>
<sup>
<?php echo JText::_('K2_FEATURED'); ?>
</sup>
</span>
<?php endif; ?>
</h3>
<?php endif; ?>
for image
<?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?>
<!-- Item Image -->
<div class="catItemImageBlock">
<span class="catItemImage">
<a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>
<div class="clr"></div>
</div>
<?php endif; ?>
for readmore
<?php if ($this->item->params->get('catItemReadMore')): ?>
<!-- Item "read more..." link -->
<div class="catItemReadMore">
<a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
<?php echo JText::_('K2_READ_MORE'); ?>
</a>
</div>
<?php endif; ?>
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 71
11 years 3 months ago #121471
by Moustakakis
Replied by Moustakakis on topic Re: Redirect Multiple K2 item to one K2 item
ok.
I solve it with a 3rd part extension.
Thank you anyway.
I solve it with a 3rd part extension.
Thank you anyway.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
11 years 3 months ago #121472
by Yiota
Replied by Yiota on topic Re: Redirect Multiple K2 item to one K2 item
Could you share with us the 3rd party extension you used?
Thank you and glad you sorted it out.
Thank you and glad you sorted it out.
Please Log in or Create an account to join the conversation.
- Moustakakis
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 71
11 years 3 months ago #121473
by Moustakakis
Replied by Moustakakis on topic Re: Redirect Multiple K2 item to one K2 item
yes of course!
JoomlaXTC K2 Content Wall
www.joomlaxtc.com/joomla/extensions?view=item&cid=18&id=2003
Best Regards.
JoomlaXTC K2 Content Wall
www.joomlaxtc.com/joomla/extensions?view=item&cid=18&id=2003
Best Regards.
Please Log in or Create an account to join the conversation.