Keyword

Line break to k2 item title

  • dimitris skourlis
  • dimitris skourlis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 1 day ago - 11 years 1 day ago #118814 by dimitris skourlis
Line break to k2 item title was created by dimitris skourlis
Hello,

If could someone help, I ld appreciate so much!!!! I need to have line break to k2 item title.
For example:

We have the item title: I said hello!
I need to be like this:
I said
Hello!

K2 item title strips html tags and the only thing I ve found is &nbsp , but this does not work as I need. Is this possible? I am using the latest joomla 2.5.14 and the latest com_k2. Please help...

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 21 hours ago #118815 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Line break to k2 item title
Its possible that you insert a special string, like
for example, to be replaced by a line break whenever title is displayed.

Example:
1- Enter the title as: I said
Hello!
2- edit the item.php file and modify this code snippet:
<?php echo $this->item->title; ?>
to be:
<?php echo str_replace("[br]","</br>"$this->item->title); ?>

step 2 should be done in other files to display the title correctly.

The best solution will be to develop a plugin to replace display the title automatically with proper replacement.

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.

  • dimitris skourlis
  • dimitris skourlis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 6 hours ago #118816 by dimitris skourlis
Replied by dimitris skourlis on topic Re: Line break to k2 item title
Thank you for the quick response!
Nothing changed with this. Is any other way to get his done please? I ve some titles that are really huge...

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 6 hours ago #118817 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Line break to k2 item title
The above example is for the item.php file, you need to apply it to category_item.php or latest_item.php as well.

Which view have you tested?

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.

  • dimitris skourlis
  • dimitris skourlis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 6 hours ago #118818 by dimitris skourlis
Replied by dimitris skourlis on topic Re: Line break to k2 item title
I tested to in a specific item page...is this wrong?

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

More
10 years 3 months ago #118819 by Tomasz Pieta
Replied by Tomasz Pieta on topic Re: Line break to k2 item title
The exact way i used the code and works is
<?php echo str_replace("[br]","<br>",$this->item->title); ?>

So in my K2 item title when i need a break i use this custom tag


I inserted this in category_item.php because this is where i needed that

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


Powered by Kunena Forum