Keyword

Parameter for maximum caracter in the title

  • Andreas Voigt
  • Andreas Voigt's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 3 months ago #62136 by Andreas Voigt
Parameter for maximum caracter in the title was created by Andreas Voigt
Hi,

i would like customizing the tilte. I would like setting maximum caracter in the title.
Please see link: www.checkdivers.com/index.php/cdc-blog

Example:
now:
boot 2012 - Erwartungen der Branche voll erfüllt

After setting:
boot 2012 - Erwartungen der Branche...

Can i setting this?

Thanks

Andyowl

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

More
12 years 3 months ago #62137 by william white
Replied by william white on topic Re: Parameter for maximum caracter in the title
I have done this before by using a k2 override and finding the title in the category_item.php and reworking the php a bit with substring commands to display on the first x characters of every title.

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

  • Andreas Voigt
  • Andreas Voigt's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 3 months ago #62138 by Andreas Voigt
Replied by Andreas Voigt on topic Re: Parameter for maximum caracter in the title
Hi,

i have tried it with
<?php echo $this->item->(title,30) ?>
but this code will not work.

I come with my knowledge further.

Help my please.

thanks and best regards

Andreas

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

More
12 years 3 months ago #62139 by william white
Replied by william white on topic Re: Parameter for maximum caracter in the title
reference here
php.net/manual/en/function.substr.php
try something like

<?php echo substr($this->item->title,0,10); ?>
instead of
<?php echo $this->item->title; ?>
You will have to test it

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

  • Andreas Voigt
  • Andreas Voigt's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 3 months ago #62140 by Andreas Voigt
Replied by Andreas Voigt on topic Re: Parameter for maximum caracter in the title
Hi William,

thanks for your help. This code work very perfect.

Thanks and best regards.

Andreas

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

  • Andreas Voigt
  • Andreas Voigt's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 3 weeks ago #62141 by Andreas Voigt
Replied by Andreas Voigt on topic Re: Parameter for maximum caracter in the title
Hi,

i would like use the same code for setting maximum charakters in the title for the introtext

code for title work perfect
Log in  or Create an account to join the conversation.

More
10 years 3 weeks ago #62142 by Lefteris
@Andreas V

It's good that it didn't work since it might broke your site. When you need to cut out a part of a text containing HTML code then you must first remove the HTML tags. Otherwise it might produce invalid markup breaking your site. K2 has a built in function for this.
Try to use:
 <?php echo K2HelperUtilities::characterLimit($this->item->introtext,80); ?>

You can also have a word limit using :
 <?php echo K2HelperUtilities::wordLimit($this->item->introtext,80); ?>

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Andreas Voigt
  • Andreas Voigt's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 3 weeks ago #62143 by Andreas Voigt
Replied by Andreas Voigt on topic Re: Parameter for maximum caracter in the title
Hi,
thanks for your help. This code work perfect.

Thanks in advance and kind regards

Andreas

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

More
10 years 3 weeks ago #62144 by Lefteris
You are welcome.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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