- Posts: 10
COMMUNITY FORUM
Read more only if there is a full text
- Nancy
-
Topic Author
- Offline
- New Member
I've tried to use this tip: www.slurpitup.com/joomla/k2-tip-how-to-show-read-more-when-necessary
Changed the line in the template version of the php file. But it didn't work at all. Also tried the 'dirty way' he's talking about, but still nothing happened. I've checked if there is any hard show in the parameters from the item, where there should be no read more button. But there isn't.
Does anyone got any idea how to fix this?
I can't send you a link, because the website is still offline.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Try echoing $this->item->fulltext
<?php echo $this->item->fulltext; ?> to see if the item does indeed have a full text.
Please Log in or Create an account to join the conversation.
- Nancy
-
Topic Author
- Offline
- New Member
- Posts: 10
I'm sorry, could you tell me where to put this?
I think it should be in the category_item.php from my template.
<?php if($this->item->params->get('catItemIntroText')): ?>
<div class="catItemIntroText">
<?php echo $this->item->introtext; ?>
<!-- Item "read more..." link -->
<?php if ($this->item->params->get('catItemReadMore') && ($this->item->fulltext != "")): ?>
<div class="catItemReadMore">
<a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
<?php echo JText::_('K2_READ_MORE_THEME'); ?>
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="clr"></div>
Thanks a lot for your respond.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
paste
<?php echo $this->item->fulltext; ?>
you can also try isset($this->item->fulltext) eg:
<?php if ($this->item->params->get('catItemReadMore') && isset($this->item->fulltext) ): ?>
Please Log in or Create an account to join the conversation.
- Nancy
-
Topic Author
- Offline
- New Member
- Posts: 10
When using the second line you write about, I got a syntaxis error in Dreamweaver.
Do you have more suggestions?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Nancy
-
Topic Author
- Offline
- New Member
- Posts: 10
This code is active at this moment:
<!-- Item introtext -->
<?php if($this->item->params->get('catItemIntroText')): ?>
<div class="catItemIntroText">
<?php echo $this->item->introtext; ?>
<?php if ($this->item->params->get('catItemReadMore') && isset($this->item->fulltext) ): ?>
<!-- Item "read more..." link -->
<?php if ($this->item->params->get('catItemReadMore') && ($this->item->fulltext != "")): ?>
<div class="catItemReadMore">
<a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
<?php echo JText::_('K2_READ_MORE_THEME'); ?>
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="clr"></div>
What about this line in the Original file category_item.php
Is that correct, or do I need to make a change in that line?
<?php if ($this->item->params->get('catItemReadMore') && ($this->item->fulltext != "")): ?>
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
The initial code should work:
<?php if ($this->item->params->get('catItemReadMore') && $this->item->fulltext !== ''): ?>
Provided that you have set an introtext/ fulltext.
Please Log in or Create an account to join the conversation.
- Nancy
-
Topic Author
- Offline
- New Member
- Posts: 10
Where do I need to read this output you're talking about. I think my experience i'n't enough for this maybe.
The item where de read more button appears, only have a fulltext in the editor, no intro at all.
I'll set the website online right now, so you can see what I mean.
Please see:
Follow Lezingen & Interviews --> first and third item diplayed. There is no more tekst available, but the button is there.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
If you haven't used the read more or used two separate editors the item might not have a fulltext. In itemlistings the entire text will be handled as introtext.
Please Log in or Create an account to join the conversation.
- Nancy
-
Topic Author
- Offline
- New Member
- Posts: 10
Could you tell me step by step what to do. Do I need to edit a read more in the item first en then write the tekst, to have the item appear without a read more button?
I didn't use two editors.
Well I do not understand how I can manage this by your last message. I'm sorry!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
As I explained you have two options.
a) Use your editor's read more button to separate your text
b) Enable two editors from K2's advanced settings and use them both.
If you have not specified a fulltext and an intro then in listings all the text is handled as introtext.
PS. 2.6.1 is really outdated. You should consider updating to 2.6.8
Please Log in or Create an account to join the conversation.
- Nancy
-
Topic Author
- Offline
- New Member
- Posts: 10
The problem is, I only want to display an intro tekst in the category view. There is no fulltext neccessary in this item. I want no read more button after this first item on this page: [link]www.artmeaning.nl/index.php/nl-NL/lezingen[/link]
I can't change the parameters in this category hiding the read more, because the second item on this category view page does have a full text.
Now you are explaining me how to use a read more. That's not my question.
It should bij like the regular Joomla Article category view. They will only show a read more if I used the read more in the editor.
I'm using JCE at this site.
I'll update K2.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.