drawncodes Posted June 1 Share Posted June 1 (edited) So I see there is another editor so to say where Header / Footer HTML is and I also want to use it but I can't figure out how. Examples.Invisioncommunity:Mine: I want to make it show exactly like Header and Footer editor. help? I think I can access it and make it show through Custom PHP, but I don't know where to select it. There is no documentation for it. If i use it as shown in my example it will display like this and that's why I want it like in Header/Footer. Edited June 1 by drawncodes Link to comment Share on other sites More sharing options...
drawncodes Posted June 2 Author Share Posted June 2 (edited) Well, I guess there is no one here with a solution. I'll try to find something to work around it. @Jim M any thoughts?? Edited June 2 by drawncodes Link to comment Share on other sites More sharing options...
drawncodes Posted June 20 Author Share Posted June 20 bump Link to comment Share on other sites More sharing options...
Nathan Explosion Posted June 20 Share Posted June 20 If I read the above correctly, you will want to be using a Codemirror helper, and not a Text helper. A quick look at system\Theme\Theme.php for the theme_simple_header_settings and theme_simple_footer_settings fields gives the answer. drawncodes 1 Link to comment Share on other sites More sharing options...
Management Matt Posted June 21 Management Share Posted June 21 As Nathan said, make sure you're using a CodeMirror editor type, eg. $form->add( new \IPS\Helpers\Form\Codemirror( 'theme_simple_header_settings', $this->custom_header, FALSE, [ 'mode' => 'htmlmixed', 'height' => 400 ] ) ); drawncodes and G17 Media 1 1 Link to comment Share on other sites More sharing options...
drawncodes Posted June 21 Author Share Posted June 21 3 minutes ago, Matt said: As Nathan said, make sure you're using a CodeMirror editor type, eg. $form->add( new \IPS\Helpers\Form\Codemirror( 'theme_simple_header_settings', $this->custom_header, FALSE, [ 'mode' => 'htmlmixed', 'height' => 400 ] ) ); Uhhhh, thank you ❤️ Link to comment Share on other sites More sharing options...
drawncodes Posted June 21 Author Share Posted June 21 23 hours ago, Nathan Explosion said: If I read the above correctly, you will want to be using a Codemirror helper, and not a Text helper. A quick look at system\Theme\Theme.php for the theme_simple_header_settings and theme_simple_footer_settings fields gives the answer. 14 minutes ago, Matt said: As Nathan said, make sure you're using a CodeMirror editor type, eg. $form->add( new \IPS\Helpers\Form\Codemirror( 'theme_simple_header_settings', $this->custom_header, FALSE, [ 'mode' => 'htmlmixed', 'height' => 400 ] ) ); Thank you both, I did it: Matt 1 Link to comment Share on other sites More sharing options...
drawncodes Posted June 22 Author Share Posted June 22 Now I have another problem, which is this. @Matt Link to comment Share on other sites More sharing options...
Stuart Silvester Posted June 22 Share Posted June 22 You cannot save template logic in a theme setting and expect it to work when you include it. It has to be in a template and called properly as a template. Link to comment Share on other sites More sharing options...
drawncodes Posted June 22 Author Share Posted June 22 (edited) 4 hours ago, Stuart Silvester said: You cannot save template logic in a theme setting and expect it to work when you include it. It has to be in a template and called properly as a template. Ohh I see, but I already tried it, and still doesn't work.. am I doing smth wrong? Edited June 22 by drawncodes Link to comment Share on other sites More sharing options...
drawncodes Posted July 5 Author Share Posted July 5 <?php // Create a form using defaults $form = new \IPS\Helpers\Form; $form->add(new \IPS\Helpers\Form\Codemirror( "core_theme_setting_title_{$row['sc_id']}", $value, FALSE, [ 'mode' => 'htmlmixed', 'height' => 400 ], NULL, NULL, NULL, 'theme_setting_' . $row['sc_key'] )); // Send the form for output \IPS\Output::i()->output = $form; So we did some testing with this code from above and also the code from Theme.php and we were trying to replicate it directly in the Designer Mode custom settings for the fields I've created. /** * Get theme header and footer * * @return array */ public function getHeaderAndFooter(): array { $return = [ 'header' => null, 'footer' => null ]; if ( $this->custom_header ) { $key = 'custom_header_' . $this->_id; if ( ! isset( \IPS\Data\Store::i()->$key ) ) { \IPS\Data\Store::i()->$key = static::compileTemplate( $this->custom_header, NULL ); } $return['header'] = \IPS\Data\Store::i()->$key; } if ( $this->custom_footer ) { $key = 'custom_footer_' . $this->_id; if ( ! isset( \IPS\Data\Store::i()->$key ) ) { \IPS\Data\Store::i()->$key = static::compileTemplate( $this->custom_footer, NULL ); } $return['footer'] = \IPS\Data\Store::i()->$key; } return $return; } We want to know what limits we have in designer mode at customizing tabs and adding form through custom/manual PHP. Link to comment Share on other sites More sharing options...
drawncodes Posted July 15 Author Share Posted July 15 bump. Link to comment Share on other sites More sharing options...
Recommended Posts