- Posts: 4
COMMUNITY FORUM
target window
- johnatan
-
Topic Author
- Offline
- New Member
Less
More
11 years 11 months ago #114342
by johnatan
target window was created by johnatan
how i can set k2 to open a link in new window instead of parent window?
Please Log in or Create an account to join the conversation.
- jean-philippe
-
- Offline
- Premium Member
- [email protected]
11 years 11 months ago - 11 years 11 months ago #114343
by jean-philippe
Replied by jean-philippe on topic Re: target window
Hi Johnatan,
can you explain?
if you create a "link" into the "extra field" you can choose your target..
if you want to modify link into the template... you can create your custom k2 template and
change your item.php and your "category.php" and adding the parameter:
Emond, Jean-Philippe
can you explain?
if you create a "link" into the "extra field" you can choose your target..
if you want to modify link into the template... you can create your custom k2 template and
change your item.php and your "category.php" and adding the parameter:
Read this tutorial
!
Best Regards,
Emond, Jean-Philippe
Emond, Jean-Philippe
Please Log in or Create an account to join the conversation.
- johnatan
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
11 years 11 months ago #114344
by johnatan
Replied by johnatan on topic Re: target window
hi jean-philippe,
it should open a new window by clicking item tittle.
may you please tell me where i should put the code in "item.php" and "category.php"?
it should open a new window by clicking item tittle.
may you please tell me where i should put the code in "item.php" and "category.php"?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 11 months ago #114345
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: target window
Hello johnatan,
Depending on your template the code should be located inside category_item.php if you want to click the title in the category listings.
Look for something like
[code type=php-brief] <?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>">
<?php echo $this->item->title; ?>
</a>[/code]
and add what jean-philippe told you
the code should look like
<a href="<?php echo $this->item->link; ?>" target="_blank">
As for locating the files, Depending on your template you may have or have not template overrides.
This tutorial will help you locating these files.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
Look at the bottom table.
Depending on your template the code should be located inside category_item.php if you want to click the title in the category listings.
Look for something like
[code type=php-brief] <?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>">
<?php echo $this->item->title; ?>
</a>[/code]
and add what jean-philippe told you
the code should look like
<a href="<?php echo $this->item->link; ?>" target="_blank">
As for locating the files, Depending on your template you may have or have not template overrides.
This tutorial will help you locating these files.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
Look at the bottom table.
Please Log in or Create an account to join the conversation.
- johnatan
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
11 years 11 months ago #114346
by johnatan
Replied by johnatan on topic Re: target window
hi Krikor,
thank you for your reply.
i put the code you provide in category_item.php (my templates/html/com_k2/templates/default) but nothings happen. do i something wrong?
thank you for your reply.
i put the code you provide in category_item.php (my templates/html/com_k2/templates/default) but nothings happen. do i something wrong?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 11 months ago #114347
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: target window
then the default override is not being used for some reason.
Try also putting it in components/com_k2/templates/default/ and tell what is happening.
Try also putting it in components/com_k2/templates/default/ and tell what is happening.
Please Log in or Create an account to join the conversation.
- johnatan
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
11 years 11 months ago #114348
by johnatan
Replied by johnatan on topic Re: target window
i did it, nothings happens. same as before.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 11 months ago #114349
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: target window
Jonathan send me a link please.
Please Log in or Create an account to join the conversation.