Follow us on

  1. Posted 2 years ago #

  2. Codestar
    Admin

    Hi,

    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.

    Regards, Codestar

    Posted 2 years ago #
  3. Hi,
    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
    Thanks

    Posted 2 years ago #

  4. Codestar
    Admin

    Hi,

    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.

    Regards, Codestar

    Posted 2 years ago #
  5. Hello
    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.
    Special thanks

    Posted 2 years ago #

  6. Codestar
    Admin

    Hi,

    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-onload div is required for run javascript.
    CSF::$enqueue = true; added new. you should to upgrade codestar-framework/classes/setup.class.php

    Download

    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...

    Regards, Codestar

    Posted 2 years ago #
  7. Hello
    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.
    There appear to be fields that require JavaScript processing, I have attached a video for you, please watch it.
    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

    Posted 2 years ago #

  8. Codestar
    Admin

    Hi,

    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.

    $('.list-item').csf_reload_script();CopyCopied!

    because this affect trigged items again again as well. I think you got the main idea.

    Regards, Codestar

    Posted 2 years ago #
  9. Hello
    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.
    Regards, Behi76

    Posted 2 years ago #

  10. Codestar
    Admin

    Hi,

    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.

    Regards, Codestar

    Posted 2 years ago #