- Posts: 22
COMMUNITY FORUM
show email and print icon
- argie
-
Topic Author
- Offline
- Junior Member
Less
More
13 years 1 month ago #64353
by argie
show email and print icon was created by argie
Hi,
someone could tell me how to show the email and print icon on K2, please?
I searched on this forum and I don't find any answer... and on Google I found a couple of broken links pointing to the old K2 forum..
Thank you!
someone could tell me how to show the email and print icon on K2, please?
I searched on this forum and I don't find any answer... and on Google I found a couple of broken links pointing to the old K2 forum..
Thank you!
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
13 years 1 month ago #64354
by william white
Replied by william white on topic Re: show email and print icon
In your category, goto the item view settings and look for hide/show options for them.
If your using a template override switch to default and see if it was left out of the template
If your using a template override switch to default and see if it was left out of the template
Please Log in or Create an account to join the conversation.
- argie
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
13 years 1 month ago #64355
by argie
Replied by argie on topic Re: show email and print icon
Thank you William, but the problem is that K2 by default shows a link (as text) to email and print, and what I wish is to show a icon, and not text.
I checked the category, but there I just found to show or not the links, but nothing regarding to icon or text...
I checked the category, but there I just found to show or not the links, but nothing regarding to icon or text...
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
13 years 1 month ago #64356
by william white
Replied by william white on topic Re: show email and print icon
I understand, that will have to be done by using an override and editing the item.php, and inserting the html for the images
you should find the code or very similar to modify
you should find the code or very similar to modify
<?php if($this->item->params->get('itemPrintButton')): ?>
<!-- Print Button -->
<li>
<?php if(JRequest::getCmd('print')==1): ?>
<a class="itemPrintLink" href="<?php echo $this->item->printLink; ?>" onclick="window.print();return false;">
<span><?php echo JText::_('Print'); ?></span>
</a>
<?php else: ?>
<a class="modal itemPrintLink" href="<?php echo $this->item->printLink; ?>" rel="{handler:'iframe',size:{x:900,y:500}}">
<span><?php echo JText::_('Print'); ?></span>
</a>
<?php endif; ?>
</li>
<?php endif; ?>
<?php if($this->item->params->get('itemEmailButton') && (!JRequest::getInt('print')) ): ?>
<!-- Email Button -->
<li>
<a class="itemEmailLink" onclick="window.open(this.href,'win2','width=400,height=350,menubar=yes,resizable=yes'); return false;" href="<?php echo $this->item->emailLink; ?>">
<span><?php echo JText::_('E-mail'); ?></span>
</a>
</li>
<?php endif; ?>
Please Log in or Create an account to join the conversation.
- Paul van Haren
-
- Offline
- New Member
Less
More
- Posts: 9
12 years 7 months ago #64357
by Paul van Haren
Replied by Paul van Haren on topic Re: show email and print icon
You may want to use the following lines of JS somewhere....
These lines would nicely fit at the bottom of your k2.js files.
$K2(document).ready(function(){
$K2('.itemPrintLink span').replaceWith('<img src="' + K2SitePath + 'media/system/images/printButton.png" alt="Print">');
$K2('.itemEmailLink span').replaceWith('<img src="' + K2SitePath + 'media/system/images/emailButton.png" alt="Print">');
$K2('.itemEditLink a').html('<img src="' + K2SitePath + 'media/system/images/edit.png" alt="Edit">');
$K2('.itemCommentsLink').html('<img src="' + K2SitePath + 'media/k2/assets/images/system/tick.png" alt="Feedback">');
});
These lines would nicely fit at the bottom of your k2.js files.
Please Log in or Create an account to join the conversation.
- marco
-
- Offline
- Junior Member
Less
More
- Posts: 33
12 years 6 months ago #64358
by marco
Replied by marco on topic Re: show email and print icon
great works perfectly as you said! I wanted to ask one thing?
you can put next to the printer icon and text messages even print and mail?
if so, how should I do?
you can put next to the printer icon and text messages even print and mail?
if so, how should I do?
Please Log in or Create an account to join the conversation.
- Tim Hewison
-
- Offline
- New Member
Less
More
- Posts: 1
10 years 11 months ago #64359
by Tim Hewison
Thanks, Paul
Works great! I had some errors with img src path and K2SitePath and just changed lines to read:
replaceWith('<img src="www.yoursite.com/media/system/images/printButton.png" alt="Print"> Print');
The last 'Print' in the line will display the text as well as the icon. If you just want the icon, delete the last 'Print' in the line after the >.
Replied by Tim Hewison on topic Re: show email and print icon
Paul van Haren wrote: You may want to use the following lines of JS somewhere....
$K2(document).ready(function(){ $K2('.itemPrintLink span').replaceWith('<img src="' + K2SitePath + 'media/system/images/printButton.png" alt="Print">'); $K2('.itemEmailLink span').replaceWith('<img src="' + K2SitePath + 'media/system/images/emailButton.png" alt="Print">'); $K2('.itemEditLink a').html('<img src="' + K2SitePath + 'media/system/images/edit.png" alt="Edit">'); $K2('.itemCommentsLink').html('<img src="' + K2SitePath + 'media/k2/assets/images/system/tick.png" alt="Feedback">'); });
These lines would nicely fit at the bottom of your k2.js files.
Thanks, Paul
Works great! I had some errors with img src path and K2SitePath and just changed lines to read:
replaceWith('<img src="www.yoursite.com/media/system/images/printButton.png" alt="Print"> Print');
The last 'Print' in the line will display the text as well as the icon. If you just want the icon, delete the last 'Print' in the line after the >.
Please Log in or Create an account to join the conversation.
- Futzmann
-
- Offline
- New Member
Less
More
- Posts: 2
10 years 10 months ago #64360
by Futzmann
Replied by Futzmann on topic Re: show email and print icon
Hello does it work. ;)
If I set "Menu" "K2" "Categories", shows text. How does that work with the Edit picture? Thanks for your help. Do I need to edit another file?
Futzi
If I set "Menu" "K2" "Categories", shows text. How does that work with the Edit picture? Thanks for your help. Do I need to edit another file?
Futzi
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 10 months ago #64361
by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: show email and print icon
Hello Futzi,
By default K2 does not have an edit picture button on the front-end.
All these buttons are located in the same file, item.php
By default K2 does not have an edit picture button on the front-end.
All these buttons are located in the same file, item.php
Please Log in or Create an account to join the conversation.