Hello,
So, I am using one of my many applications as a content management system. So far everything is going swimmingly. however, I would like to be able to embed html code and it seems that you can't do this in the most current text editor in detail view. There is no button for source or and option for code. There is only standard change font color, bg color, images, links, font sizes and such.
If you post the <embed> code directly in the detail view text editor it turns it into text on display in my output to website. I am sure I can go into the backend of the MySQL db and do this on those occasions, however I would like to make it easier as it is a function most people use. Whether making a blog app, cms, data management. I could swear that it used to function that way but now it is more user friendly and less coder friendly.
So.. I guess what i want to know is where do I go about changing the text editor in use on the detail screen for the Rich HTML field types. If I have to I will try to implement ckeditor of sorts but I would rather just see a function that allows me to go to the source of the field instead of the display output.
As always,
Kind Regards - Red
How would I go about changing the text editor?
Re: How would I go about changing the text editor?
Hmm .. I'd suggest that you set the field as a normal text area rather than rich HTML in AppGini. Then add a new file in the hooks folder and name it "tablename-dv.js" (where tablename is the name of the concerned table) ... This is a "magic file", meaning that once created in the hooks folder, it will be automatically loaded by your application ... *-dv.js files are loaded in the detail view ... In that file, you should add the javascript code for applying the third-party HTML editor to your text area. For ckEditor, according to http://docs.ckeditor.com/#!/guide/dev_installation , the code would be:
You also need to load the ckEditor component .. To do so, the simplest way is to edit the geenrated "header.php" file to add this line to the <head> section:
You need to re-apply the above edit to the header.php file if you regenerate your application later. To avoid this, you could use the tablename_header hook instead: http://bigprof.com/appgini/help/advance ... ame_header
Code: Select all
CKEDITOR.replace( 'fieldname' );
Code: Select all
<script src="path/to/ckeditor.js"></script>

- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
- Need personalized consulting on your specific app and customizations? Book an online call with me here.
-
- Posts: 26
- Joined: 2014-05-01 12:57
Re: How would I go about changing the text editor?
Thank you as always. I will give this a try this evening and report back. Of course I would have to change the field type to text and regenerate my code/template files. Correct?