- Posts: 15
COMMUNITY FORUM
Read More Button?
- Janet Fazio
- Topic Author
- Offline
- New Member
Less
More
13 years 10 months ago #90367
by Janet Fazio
Read More Button? was created by Janet Fazio
Is there a button that can be embedded in each item for "read more" rather than link that appears at the bottom? It's not always apparent that there's more to read.
Please Log in or Create an account to join the conversation.
- Yiota
- Visitor
13 years 10 months ago #90368
by Yiota
Replied by Yiota on topic Read More Button?
I don't quite understand. Why do you need another read more button? Why the link of read more doesn't suffice? You can move it wherever you like and of course control it to appear only if there is more to read.
Please Log in or Create an account to join the conversation.
- Janet Fazio
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
13 years 10 months ago #90369
by Janet Fazio
Replied by Janet Fazio on topic Read More Button?
I don't know how to move the read more link. If I could move it up or embed in the article, that would work.
Yiota Ziaggou said:I don't quite understand. Why do you need another read more button? Why the link of read more doesn't suffice? You can move it wherever you like and of course control it to appear only if there is more to read.
Yiota Ziaggou said:I don't quite understand. Why do you need another read more button? Why the link of read more doesn't suffice? You can move it wherever you like and of course control it to appear only if there is more to read.
Please Log in or Create an account to join the conversation.
- Yiota
- Visitor
13 years 10 months ago #90370
by Yiota
Replied by Yiota on topic Read More Button?
Before editing any k2 template files you need to do a template override. Just copy the templates folder from components/com_k2/ to templates/your template/html/com_k2. Then you can just open the item.php and after locating the read more block you can move it wherever you like.
Please Log in or Create an account to join the conversation.
- alex blanc
- Offline
- New Member
Less
More
- Posts: 2
13 years 9 months ago #90371
by alex blanc
Replied by alex blanc on topic Read More Button?
I think what Janet is asking is:
How to move the 'read more' link above the 'published in', 'tagged under', etc.
Do as Yiota says:
"copy the templates folder from components/com_k2/
TO:
templates/your template/html/com_k2
(you'll need to make a new folder titled 'com_k2' in which to put the copy in .... ;-)
Now, using your editor of choice, open the 'category_item.php' ... (not the item.php as Yiota said to do), found in your newly copied and moved folder.
On lines 244 to 272, you'll find the following code:
___________________
<?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?> <!-- Anchor link to comments below --> <div class="catItemCommentsLink"> <?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 href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('comments') : JText::_('comment'); ?> </a> <?php else: ?> <a href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo JText::_('Be the first to comment!'); ?> </a> <?php endif; ?> <?php endif; ?> </div> <?php endif; ?> <?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::_('Read more...'); ?> </a> </div> <?php endif; ?>
________________________
Cut them, and move up to line 155, (right after the " <div class="clr"></div> </div>), give yourself a couple of returns, and Paste.
Save it, and ... voila:
Hope it helps!
ps. I'm not an experienced coder by any means, so if someone here knows either an easier way, or if the process above is not a good idea, please comment.... !!!
;-)
How to move the 'read more' link above the 'published in', 'tagged under', etc.
Do as Yiota says:
"copy the templates folder from components/com_k2/
TO:
templates/your template/html/com_k2
(you'll need to make a new folder titled 'com_k2' in which to put the copy in .... ;-)
Now, using your editor of choice, open the 'category_item.php' ... (not the item.php as Yiota said to do), found in your newly copied and moved folder.
On lines 244 to 272, you'll find the following code:
___________________
<?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?> <!-- Anchor link to comments below --> <div class="catItemCommentsLink"> <?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 href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('comments') : JText::_('comment'); ?> </a> <?php else: ?> <a href="<?php echo $this->item->link; ?>#itemCommentsAnchor"> <?php echo JText::_('Be the first to comment!'); ?> </a> <?php endif; ?> <?php endif; ?> </div> <?php endif; ?> <?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::_('Read more...'); ?> </a> </div> <?php endif; ?>
________________________
Cut them, and move up to line 155, (right after the " <div class="clr"></div> </div>), give yourself a couple of returns, and Paste.
Save it, and ... voila:
Hope it helps!
ps. I'm not an experienced coder by any means, so if someone here knows either an easier way, or if the process above is not a good idea, please comment.... !!!
;-)
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
- Posts: 3722
13 years 9 months ago #90372
by william white
Replied by william white on topic Read More Button?
You could also try something like
and put the path to your button in it...
<a href="samesite.htm"><img src="image.gif" style="border: none"></a>
and put the path to your button in it...
Please Log in or Create an account to join the conversation.