- Posts: 25
COMMUNITY FORUM
Parameter for maximum caracter in the title
- Andreas Voigt
-
Topic Author
- Offline
- Junior Member
Less
More
13 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
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.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
13 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
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
13 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
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.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
13 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
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
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
13 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
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
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
11 years 2 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
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 2 weeks ago #62142
by Lefteris
Replied by Lefteris on topic Re: Parameter for maximum caracter in the title
@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:
You can also have a word limit using :
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); ?>
Please Log in or Create an account to join the conversation.
- Andreas Voigt
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 25
11 years 2 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
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 2 weeks ago #62144
by Lefteris
Replied by Lefteris on topic Re: Parameter for maximum caracter in the title
You are welcome.
Please Log in or Create an account to join the conversation.