Yes I got, but unfortunately the framework fields can not be used another area. There are many factors for run a field (js/css/php).
Let's try our luck, Send me the the project (lite version can be) and Let me try to run field for you.
can I request that you do this in a simple test plugin and send samples of the code?
Because I am in the development version of the plugin and it is not possible to send it at the moment
Ok no problem for me.
The idea is: we can use CSF files directly like this.
CSF::field( array( 'id' => 'opt-overview-text', 'type' => 'text', 'title' => 'Text', ), 'SAVED_AND_DEFAULT_VALUE_HERE', );CopyCopied!
Maybe this help you. I am not sure. Said as me, there is no a absolute way to use framework fields another area.
Hmm, this idea seems to work.
I started adding fields
Thank you for taking the time to come up with a solution.
The question I have now is how to add essential Css and JS of codestar framework to the page? Does it have a special code? Or is there a specific action for this?
Please guide this as well. During the process, if I come across a specific issue, I will share it with you.
You're welcome I love to help.
CSF::$enqueue = true; CSF::add_admin_enqueue_scripts(); echo '<div class="csf-onload">'; CSF::field( array( 'id' => 'opt-overview-text', 'type' => 'text', 'title' => 'Text', ), 'Hello world', ); CSF::field( array( 'id' => 'opt-switcher-text', 'type' => 'switcher', 'title' => 'Switcher', ), false, ); echo '</div>';CopyCopied!
CSF::$enqueue = true; added new. you should to upgrade codestar-framework/classes/setup.class.php
Btw, I have updated that file for next version as well.
But, might you need write/overwrite some custom css for best looks. It's normal...
With your guidance, a great deal of work has progressed properly. But the problem is that some of the fields added by Ajax do not work properly.
You can see that the fields that load when the page is reloaded work properly, but the ones that are added to the page as Ajax do not work properly.
If we save the same fields and reload the page, the problem will be solved, but since all operations are in Ajax, this is a problem for us.
We are waiting for a surprise from you again
Yea, a surprise coming.
As you know when we use js ajax append idea, we must to trigger js again for new appended content.
( I am using jQuery )
You must reload scripts like this:
var $appended = $( newContent ).appendTo( '.maybe-the-list' ); $appended.csf_reload_script();CopyCopied!
Do not use like this.
because this affect trigged items again again as well. I think you got the main idea.
Again, your solution worked. Thanks
With your previous method, the problem of loading fields was solved.
If you have a user who needs such an experience like me, I can share my experiences with them.
I have another question from your experience.
How to get the content of the editor created by your framework with JQuery.
I tested different modes, From getting the value of textarea to the body.html() of the editor, But I do not know what the best solution is.
Nice... You're welcome
Yes said as you, the wp_editor field using a hidden textarea and yes you can get value by $textarea.val(); It's most easy way.