- Posts: 4
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
- GeGeFe
-
Topic Author
- Offline
- New Member
Less
More
14 years 2 months ago #93363
by GeGeFe
I'd like to move the 'read more' button directly to the end of the intro text (joomla component) was created by GeGeFe
in my template the 'read more' button is located below the intro text div. Actually I'd like to attach it directly to last sentence of the abstract like on many news pages. I hope to catch visitors attention even better this way because some of them reported that it didn't even occur to them that there is a button like this at all...
I've edited the template to my needs but I have no idea how to get the read more div into the intro text div. Has anybody managed to do so yet?
the url is www.gegefe.de
cheers
I've edited the template to my needs but I have no idea how to get the read more div into the intro text div. Has anybody managed to do so yet?
the url is www.gegefe.de
cheers
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 2 months ago #93364
by william white
Replied by william white on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
In 2.4.1 look in category_item.php around line 264-271 for catItemReadMore
Move this entire block of code to just below catItemIntroText around line 123-128
This should move the read more to just below the intro text
All of this would be best accomplished by using an override and assigning it to the categorie or categories in question.
If you are using an earlier version just search for the div names and it should be smiliar
Move this entire block of code to just below catItemIntroText around line 123-128
This should move the read more to just below the intro text
All of this would be best accomplished by using an override and assigning it to the categorie or categories in question.
If you are using an earlier version just search for the div names and it should be smiliar
Please Log in or Create an account to join the conversation.
- GeGeFe
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
14 years 2 months ago #93365
by GeGeFe
Replied by GeGeFe on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
Hey William,
I've moved the readMore block right into the introText but there's still a break between them. You can check my website to see the effect. There's no display:block or inline-tag in the CSS so far. As I'm not a pro in templating yet I may have missed something.
I'm not using any override yet. In fact I had no idea about overriding until you told me to do so. I'll try to extract all modified code using the override before updating k2 next time. Thanks for that!
The actual code looks like this:
<?php if($this->item->params->get('catItemIntroText')): ?> <!-- Item introtext -->
<div class="catItemIntroText">
<?php echo $this->item->introtext; ?>
<?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; ?>
</div>
<?php endif; ?>
I've moved the readMore block right into the introText but there's still a break between them. You can check my website to see the effect. There's no display:block or inline-tag in the CSS so far. As I'm not a pro in templating yet I may have missed something.
I'm not using any override yet. In fact I had no idea about overriding until you told me to do so. I'll try to extract all modified code using the override before updating k2 next time. Thanks for that!
The actual code looks like this:
<?php if($this->item->params->get('catItemIntroText')): ?> <!-- Item introtext -->
<div class="catItemIntroText">
<?php echo $this->item->introtext; ?>
<?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; ?>
</div>
<?php endif; ?>
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 2 months ago #93366
by william white
Replied by william white on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
Im not sure if this will work or not, but you might try taking the div class and / div out of the readmore and see what happens
Please Log in or Create an account to join the conversation.
- GeGeFe
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
14 years 2 months ago #93367
by GeGeFe
Replied by GeGeFe on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
It's a pity but I've already tried this and it applies without having any effect at all.
cheers
cheers
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 2 months ago #93368
by william white
Replied by william white on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
The continue reading link looks ok to me just below the intro text in the category view at the link above you posted.
I checked both in ie and ff and i do not see the space there
I checked both in ie and ff and i do not see the space there
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 2 months ago #93369
by william white
Replied by william white on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
Please see friend request and pm me
Please Log in or Create an account to join the conversation.
- GeGeFe
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
14 years 2 months ago #93370
by GeGeFe
Replied by GeGeFe on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
You're right. Now it's just below the last sentence. But what I'd like to do is to put it directly at the end of each articles abstract (at the end of the sentence) and not below it.
Like on www.spiegel.de e.g.
Like on www.spiegel.de e.g.
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 2 months ago #93371
by william white
Replied by william white on topic I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
There is a p tag around intro text by default. Add the strip_tags php function to the itemIntroText and this will work. See Attached snipet
Please Log in or Create an account to join the conversation.
- Tom
-
- Offline
- New Member
Less
More
- Posts: 14
12 years 2 months ago #93372
by Tom
Replied by Tom on topic Re: I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
:cheer: i have still the same problem in the newest k2 version-
I try this out but the Readme buton is not exactly behind the ReadMore Text.
Maybe you can give me some further helps?
Best wishes Tom
I try this out but the Readme buton is not exactly behind the ReadMore Text.
Maybe you can give me some further helps?
Best wishes Tom
Please Log in or Create an account to join the conversation.
- Tom
-
- Offline
- New Member
Less
More
- Posts: 14
12 years 2 months ago - 12 years 2 months ago #93373
by Tom
Replied by Tom on topic Re: I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
After changing:
from before
The preview of pictures get lost-.
<?php if($this->item->params->get('catItemIntroText')): ?>
<!-- Item introtext -->
<div class="catItemIntroText">
<?php echo strip_tags( $this->item->introtext); ?>
</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::_('K2_READ_MORE'); ?>
</a>
</div>
<?php endif; ?>
from before
<?php if($this->item->params->get('catItemIntroText')): ?>
<!-- Item introtext -->
<div class="catItemIntroText">
<?php echo $this->item->introtext; ?>
</div>
<?php endif; ?>
<div class="clr"></div>
<?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::_('K2_READ_MORE'); ?>
</a>
</div>
<?php endif; ?>
The preview of pictures get lost-.
Please Log in or Create an account to join the conversation.
- Gizella
-
- Offline
- New Member
Less
More
- Posts: 1
12 years 1 month ago #93374
by Gizella
Replied by Gizella on topic Re: I'd like to move the 'read more' button directly to the end of the intro text (joomla component)
Dear William and GEGEFE,
I happened to find this old thread when I was searching about moving the READ MORE button directly under the introtext. I followed the directions from William and made the change in the category-item.php file. Unfortunately, the read more button stayed at the same place. My question is this: do I need to make the same change in other php files as well? GEGEFE, you were able to move the button up, this is why I am asking you as well.
I am using the newest version of K2 (just installed it yesterday) on a Joomla 2.5.9 platform.
I am still building the site and it is most of the time locked. But if it were helpful for someone to look at it, I will post the URL and unlock it for some time.
Thanks,
Gizella
I happened to find this old thread when I was searching about moving the READ MORE button directly under the introtext. I followed the directions from William and made the change in the category-item.php file. Unfortunately, the read more button stayed at the same place. My question is this: do I need to make the same change in other php files as well? GEGEFE, you were able to move the button up, this is why I am asking you as well.
I am using the newest version of K2 (just installed it yesterday) on a Joomla 2.5.9 platform.
I am still building the site and it is most of the time locked. But if it were helpful for someone to look at it, I will post the URL and unlock it for some time.
Thanks,
Gizella
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- I'd like to move the 'read more' button directly to the end of the intro text (joomla component)