Keyword

Limit text title Module COntent

More
11 years 1 week ago #118545 by Web75
Limit text title Module COntent was created by Web75
Hello, I use k2 2.6 and I would like to limit the number of characters of the title for the module k2 content. Have you already made this change? thanks

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #118546 by Sarah
Replied by Sarah on topic Re: Limit text title Module COntent
Me too, anyone please???? my client's k2 titles are too long , throwing off my beatiful design : )
please help, how do we do this title character limit?

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 10 months ago #118547 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Limit text title Module COntent
Hi
You can edit the file: /modules/mod_k2_content/tmpl/default.php
Replace this text:
<?php if($params->get('itemTitle')): ?>
      <a class="moduleItemTitle" href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a>
      <?php endif; ?>

With this code:
<?php if($params->get('itemTitle')): ?>
      <a class="moduleItemTitle" href="<?php echo $item->link; ?>"><?php echo substr($item->title, 0, 20); ?></a>
      <?php endif; ?>

This will limit the title to 20 characters for example, you can change the limit of course to match your design.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #118548 by Sarah
Replied by Sarah on topic Re: Limit text title Module COntent
yaaaay it worked!! a couple more little things if you can answer.

1. is there any way to get the ... after the text title?
2. The readmore isn't showing up in the k2_content medule even tho it's enabled, do you know a work around to get that to pop up?

thank you again!

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 10 months ago #118549 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Limit text title Module COntent
Great :)
1- change
<?php echo substr($item->title, 0, 20); ?>
to
<?php echo substr($item->title, 0, 20).'...'; ?>
2- Do you already have inserted readmore link in the item text?

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago - 10 years 10 months ago #118550 by Sarah
Replied by Sarah on topic Re: Limit text title Module COntent
Hi, thank you again! Your "..." solution worked!

here is the read more i enabled in the K2 Content Module: prntscr.com/2699vd
and
here is how it looks in my site: prntscr.com/269b4h


UPDATE:
I found this post from a user named "betneb"

Go to .../modules/mod_k2_content/tmpl/Default/default.php

if($params->get('itemReadMore') && $item->fulltext):

I've deleted the "&& $item->fulltext" part and now it's working fine.


and this worked for me, i hope it doesn't hurt anything...

Thanks again!

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 10 months ago #118551 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Limit text title Module COntent
I think it is not a problem, but seems that you have not configured the category parameters well.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago - 10 years 10 months ago #118552 by Sarah
Replied by Sarah on topic Re: Limit text title Module COntent
Hi Mohamed
I am making a charity website and I just noticed your logo and a logo on a component i think i need. Are you the dev of this www.joomseller.com/joomla-components/jse-donation.html

if so, i have a question. I would want random people who would want to, sign up on my site and start their own Fundraisers and lead people to the page (all money would go to one place of course) but this would let them see how much they are raising for their own fundraiser etc.. once they make a fundraiser, they can Lead others to their campaign page etc..

is this capable with this component?
also, is this working perfectly in j3.2?

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 10 months ago #118553 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Limit text title Module COntent
Sorry Sarah, I'm not the developer of this component, my products are published on my website with the same name of my logo.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #118554 by Sarah
Replied by Sarah on topic Re: Limit text title Module COntent
are you able to instruct me on how to get rid of these little dots that show up everywhere on the page?

see pic here: prntscr.com/2ln6zu


WHAT I DID FOR A FIX - DID I DO IT RIGHT?

In the default.php i replaced the <li class... with <div class
and also closed it with </div> (it was </li>

did i do it correctly?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum