- Posts: 28
COMMUNITY FORUM
How can I keep the with bar in my post?
- JustBe
-
Topic Author
- Offline
- Junior Member
Less
More
14 years 2 months ago #94432
by JustBe
Hello,
I have made an item and it adds a white bar if I choose the options to add a print button, or if I choose to add a font resize option or an email option ( I am changing catagory options that effects item).
But I don't really care about those options, but when I remove those, the white bar also is gone.
Any tips?
How can I keep the with bar in my post? was created by JustBe
Hello,
I have made an item and it adds a white bar if I choose the options to add a print button, or if I choose to add a font resize option or an email option ( I am changing catagory options that effects item).
But I don't really care about those options, but when I remove those, the white bar also is gone.
Any tips?
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
14 years 2 months ago #94433
by Yiota
Replied by Yiota on topic How can I keep the with bar in my post?
This bar gets its styling from the block with class name itemToolbar. This block appears if some statements are true. You can see which elements are in that block if you open the item.php in the k2 template.
Please Log in or Create an account to join the conversation.
- JustBe
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
14 years 2 months ago #94434
by JustBe
Ok, thanks for answer.
I think it is a bit too difficult at this moment to adjust this file.
I mean, I want to apply it for just one catagory.
If it is simple, then let me know. Otherwise I use what I have.
I have found the relevant part about itemToolbar.
___________________________________________________________
<div class="itemToolbar"> <ul> <?php if($this->item->params->get('itemFontResizer')): ?> <!-- Font Resizer --> <li> <span class="itemTextResizerTitle"><?php echo JText::_('font size'); ?></span> <a href="#" id="fontDecrease"> <span><?php echo JText::_('decrease font size'); ?></span> <img src="components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('decrease font size'); ?>" /> </a> <a href="#" id="fontIncrease"> <span><?php echo JText::_('increase font size'); ?></span> <img src="components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('increase font size'); ?>" /> </a> </li> <?php endif; ?> <?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; ?> <?php if($this->item->params->get('itemSocialButton') && !is_null($this->item->params->get('socialButtonCode', NULL))): ?> <!-- Item Social Button --> <li> <?php echo $this->item->params->get('socialButtonCode'); ?> </li> <?php endif; ?> <?php if($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)): ?> <!-- Anchor link to item video below - if it exists --> <li> <a class="itemVideoLink k2Anchor" href="<?php echo $this->item->link; ?>#itemVideoAnchor"><?php echo JText::_('Video'); ?></a> </li> <?php endif; ?> <?php if($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)): ?> <!-- Anchor link to item image gallery below - if it exists --> <li> <a class="itemImageGalleryLink k2Anchor" href="<?php echo $this->item->link; ?>#itemImageGalleryAnchor"><?php echo JText::_('Image Gallery'); ?></a> </li> <?php endif; ?> <?php if($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?> <!-- Anchor link to comments below - if enabled --> <li> <?php if(!empty($this->item->event->K2CommentsCounter)):?> <!-- K2 Plugins: K2CommentsCounter --> <?php echo $this->item->event->K2CommentsCounter; ?> <?php else:?> <?php if($this->item->numOfComments > 0): ?> <a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('comments') : JText::_('comment'); ?> </a> <?php else: ?> <a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo JText::_('Be the first to comment!'); ?> </a> <?php endif; ?> <?php endif; ?> </li> <?php endif; ?> </ul>
Replied by JustBe on topic How can I keep the with bar in my post?
Ok, thanks for answer.
I think it is a bit too difficult at this moment to adjust this file.
I mean, I want to apply it for just one catagory.
If it is simple, then let me know. Otherwise I use what I have.
I have found the relevant part about itemToolbar.
___________________________________________________________
<div class="itemToolbar"> <ul> <?php if($this->item->params->get('itemFontResizer')): ?> <!-- Font Resizer --> <li> <span class="itemTextResizerTitle"><?php echo JText::_('font size'); ?></span> <a href="#" id="fontDecrease"> <span><?php echo JText::_('decrease font size'); ?></span> <img src="components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('decrease font size'); ?>" /> </a> <a href="#" id="fontIncrease"> <span><?php echo JText::_('increase font size'); ?></span> <img src="components/com_k2/images/system/blank.gif" alt="<?php echo JText::_('increase font size'); ?>" /> </a> </li> <?php endif; ?> <?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; ?> <?php if($this->item->params->get('itemSocialButton') && !is_null($this->item->params->get('socialButtonCode', NULL))): ?> <!-- Item Social Button --> <li> <?php echo $this->item->params->get('socialButtonCode'); ?> </li> <?php endif; ?> <?php if($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)): ?> <!-- Anchor link to item video below - if it exists --> <li> <a class="itemVideoLink k2Anchor" href="<?php echo $this->item->link; ?>#itemVideoAnchor"><?php echo JText::_('Video'); ?></a> </li> <?php endif; ?> <?php if($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)): ?> <!-- Anchor link to item image gallery below - if it exists --> <li> <a class="itemImageGalleryLink k2Anchor" href="<?php echo $this->item->link; ?>#itemImageGalleryAnchor"><?php echo JText::_('Image Gallery'); ?></a> </li> <?php endif; ?> <?php if($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?> <!-- Anchor link to comments below - if enabled --> <li> <?php if(!empty($this->item->event->K2CommentsCounter)):?> <!-- K2 Plugins: K2CommentsCounter --> <?php echo $this->item->event->K2CommentsCounter; ?> <?php else:?> <?php if($this->item->numOfComments > 0): ?> <a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('comments') : JText::_('comment'); ?> </a> <?php else: ?> <a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo JText::_('Be the first to comment!'); ?> </a> <?php endif; ?> <?php endif; ?> </li> <?php endif; ?> </ul>
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
14 years 2 months ago #94435
by Yiota
Replied by Yiota on topic How can I keep the with bar in my post?
You want the bar to exist and include what elements?
Please Log in or Create an account to join the conversation.
- JustBe
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
14 years 2 months ago #94436
by JustBe
Mm, I think it is ok to change this for every item on my site.
Makes it much easier, I think.
I understand from above the toolbar is only displayed if one of the options are true. Like
<? php if (!empty ($This->item->event->K2CommentsCounter)):?>
If this is true then then the toolbar is displayed.
But how to implement, when nothing is true to display this toolbar?
Replied by JustBe on topic How can I keep the with bar in my post?
Mm, I think it is ok to change this for every item on my site.
Makes it much easier, I think.
I understand from above the toolbar is only displayed if one of the options are true. Like
<? php if (!empty ($This->item->event->K2CommentsCounter)):?>
If this is true then then the toolbar is displayed.
But how to implement, when nothing is true to display this toolbar?
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
14 years 2 months ago #94437
by Yiota
Replied by Yiota on topic How can I keep the with bar in my post?
You can simply move the itemToolbar block outside the if statement. Don't forget to move also the close </div> of the block outside the if statement.
Please Log in or Create an account to join the conversation.