Ivan Gretsky Posted June 22, 2020 Share Posted June 22, 2020 Thanks! Hope the modules directory will be ok soon. Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted September 14, 2021 Share Posted September 14, 2021 Good day @ukyo! Is there a way to manipulate field data from the API? Like batch setting / changing it? Link to comment Share on other sites More sharing options...
ukyo Posted September 14, 2021 Author Share Posted September 14, 2021 5 hours ago, Ivan Gretsky said: Good day @ukyo! Is there a way to manipulate field data from the API? Like batch setting / changing it? This should work <?php $page->of(false); $page->mystique_field_name->property1 = 'data'; $page->mystique_field_name->property2 = 'data'; $page->mystique_field_name->property3 = 'data'; $page->mystique_field_name->property4 = 'data'; $page->mystique_field_name->property5 = 'data'; $page->mystique_field_name->property6 = 'data'; $page->save(); 1 Link to comment Share on other sites More sharing options...
ukyo Posted September 14, 2021 Author Share Posted September 14, 2021 @Ivan Gretsky You can also try next version of Mystique field type. Now, its possible to display custom fields depend on template name or page, you imagine it. Here is an example usage: <?php namespace ProcessWire; /** * Resource: magic of mystique field */ return function ($page = null, $field = null, $value = null) { $fields = [ 'hello' => [ 'label' => 'Are you ready for a Magic ?', 'type' => 'select', 'options' => [ 'no' => 'No', 'yes' => 'Yes' ], 'required' => true, 'defaultValue' => 'no' ] ]; if ($page instanceof Page && $page->template->name == 'page') { $fields['current_page'] = [ 'label' => 'Current page title : ' . $page->title, 'value' => $page->title, 'showIf' => [ 'hello' => '=yes' ], 'columnWidth' => 50 ]; } if ($field instanceof Field) { $fields['current_field'] = [ 'label' => 'Current field label : ' . $field->label, 'value' => $field->label, 'showIf' => [ 'hello' => '=yes' ], 'columnWidth' => 50 ]; } return [ 'name' => 'magician', 'title' => 'Do A Magic ?', 'fields' => $fields ]; }; 1 Link to comment Share on other sites More sharing options...
Clarity Posted October 7, 2021 Share Posted October 7, 2021 Hello, @ukyo! Current variant of Mystique in "master" branch gives the error "You need to select a resource and save field before start to use Mystique." after creation of the page. I don't see that it is possible to select a resource just after creation of the field. Switching to the branch "next" solves the problem. In addition, Mystique will search files in form Mystique.*.php in site/templates/configs, not in site/templates. Link to comment Share on other sites More sharing options...
ukyo Posted October 7, 2021 Author Share Posted October 7, 2021 Quote In addition, Mystique will search files in form Mystique.*.php in site/templates/configs, not in site/templates. Yes, json or php file. I see my mistake on readme.md i will fix it. {Mystique.*.php,mystique.*.php,Mystique.*.json,mystique.*.json} Quote Current variant of Mystique in "master" branch gives the error "You need to select a resource and save field before start to use Mystique." after creation of the page. I don't see that it is possible to select a resource just after creation of the field. Switching to the branch "next" solves the problem. Long time i am not working with master branch, i have many updates on next branch, i will merge these 2 branch soon. 1 1 Link to comment Share on other sites More sharing options...
Clarity Posted October 7, 2021 Share Posted October 7, 2021 Somewhy when I save a page with fields given by Mystique, content from these fields disappear after saving. Is it a problem with next branch? Link to comment Share on other sites More sharing options...
ukyo Posted October 7, 2021 Author Share Posted October 7, 2021 1 hour ago, Clarity said: Somewhy when I save a page with fields given by Mystique, content from these fields disappear after saving. Is it a problem with next branch? I have many web projects using mystique fields, i didn't see an error like this. You can make a try with clean processwire install, after that if this error continue for your create an issue on github repo. 1 Link to comment Share on other sites More sharing options...
Clarity Posted October 8, 2021 Share Posted October 8, 2021 I found the root of the problem. The checkbox "Group fields inside fieldset" was unchecked, and it leads to values of fields being unsaved. Link to comment Share on other sites More sharing options...
ukyo Posted October 8, 2021 Author Share Posted October 8, 2021 @Clarity Can you share your Mystique config file ? Link to comment Share on other sites More sharing options...
Clarity Posted October 8, 2021 Share Posted October 8, 2021 @ukyo, mostly I was using the same config file as in the example. Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted October 8, 2021 Share Posted October 8, 2021 9 hours ago, Clarity said: I found the root of the problem. The checkbox "Group fields inside fieldset" was unchecked, and it leads to values of fields being unsaved. I think I had this issue as well in some version of Next a few months ago and downgraded. Sorry I can't provide more details at the moment. Link to comment Share on other sites More sharing options...
ukyo Posted October 8, 2021 Author Share Posted October 8, 2021 @Clarity @Jonathan Lahijani I pushed a fix, can u update next branch and try ? Entering language based data, Exporting and importing Mystique field data Video result Ekran Kaydı 2021-10-08 22.46.51.mov 1 1 Link to comment Share on other sites More sharing options...
Clarity Posted October 12, 2021 Share Posted October 12, 2021 @ukyo, I tested it and it worked. Thank you! Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted October 16, 2021 Share Posted October 16, 2021 Hey @ukyo! Every time I write here I want to start with a thank you, as I like the module so much) Now to the question. Is it possible now or could it be implemented to support repeater / repeater matrix fields? P.S. Are there any rumors about when is the next branch going to be merged? Link to comment Share on other sites More sharing options...
ukyo Posted October 17, 2021 Author Share Posted October 17, 2021 20 hours ago, Ivan Gretsky said: Hey @ukyo! Every time I write here I want to start with a thank you, as I like the module so much) Now to the question. Is it possible now or could it be implemented to support repeater / repeater matrix fields? P.S. Are there any rumors about when is the next branch going to be merged? Mytqiue works inside repeater fields. If you mean, create repeater field via Mystique, the answer is no. Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted October 17, 2021 Share Posted October 17, 2021 I was asking about creating Repeater fields as a type of Mystique. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now