shahed Posted December 9, 2018 Share Posted December 9, 2018 Hello, Recently I started to create new plugin for a IP.Page Template. Plugin currently works just fine, except in one area. and I don't know if it's a bug. I use this method to insert IP.Page Blocks through a plugin: $form->add( new \IPS\Helpers\Form\TextArea( 'setting_key', \IPS\Settings::i()->setting_key ) ); As a textarea field, like adding {block ="block_name"} in plugin line by line. while I can use HTML tags in textarea, but the {block ="block_name"} won't parser as a normal block. It's just adding a RAW {block ="block_name"} in IP.Pages template space. And this is for summon the setting contents in IP.Pages Template space. {{if settings.setting_key}}{setting="setting_key"}{{endif}} Link to comment Share on other sites More sharing options...
opentype Posted December 9, 2018 Share Posted December 9, 2018 Well, you are using a template tag (“setting”), which is then parsed and returns the result. But you expect the result to be parsed again as template tag (“block”). That doesn’t work. A simple solution would be to just collect the block identifier in the text field, not the entire template tag. {{if settings.setting_key}}{block="$block_name"}{{endif}} Link to comment Share on other sites More sharing options...
shahed Posted December 9, 2018 Author Share Posted December 9, 2018 19 minutes ago, opentype said: {{if settings.setting_key}}{block="$block_name"}{{endif}} Thanks, I think there is a miss describe, because it's not the entire template tag. It's just block identifier should be placed inside textarea. so this line are in template, in exact space as Just {block="block_name"} should be. {{if settings.setting_key}}{setting="setting_key"}{{endif}} I want add these blocks there line by line. and I don't want it for a single or two specific block. Link to comment Share on other sites More sharing options...
opentype Posted December 9, 2018 Share Posted December 9, 2018 20 minutes ago, shahed said: I think there is a miss describe, because it's not the entire template tag. It's just block identifier should be placed inside textarea. so this line are in template, in exact space as Just {block="block_name"} should be. My answer is still valid. Link to comment Share on other sites More sharing options...
shahed Posted December 9, 2018 Author Share Posted December 9, 2018 You mean as YesNo Field? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.