⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

how to change the generic add text editor



colito4
  • profile picture
  • Member

Posted 23 November 2016 - 12:44 PM

Hi everyone.

 

I have a newbie question.

I add items using grocery crud but then i use my own .php to show it (echo item->description). 
Using GC when i write a description in my text editor with an enter, it adds a <p> which makes a big space between lines in my .php

 

Now if i edit this in source and take out the <p> the text displays fine.

 

The idea is that when adding a new field it doesnt add the <p> after every enter, just the normal space.

 

I have attached the two image of what happens and what i want to happen by default

Can you help me?

Thanks!!


larasmith
  • profile picture
  • Member

Posted 23 November 2016 - 13:23 PM

Try this in ur php:
$tmp = item->description;
$tmp = str_replace("<p>","",$tmp);
$tmp = str_replace("</p>","",$tmp);
echo $tmp;

I hope this helps. 😀