Jump to content

ukyo

Members
  • Posts

    262
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by ukyo

  1. Module working, but not on your side ?. I created a next branch on github repo can you download next branch and test it ? https://github.com/trk/FieldtypeFontIconPicker/tree/next After install module be sure, refresh modules and clear compiler cache.
  2. How to use core files()->find() function like php glob() function ? https://github.com/trk/FieldtypeFontIconPicker/blob/master/FieldtypeFontIconPicker.module#L50 If you don't have custom icons inside templates folder result look like ok.
  3. Can you check paths are true on your server ? on this line : https://github.com/trk/FieldtypeFontIconPicker/blob/master/FieldtypeFontIconPicker.module#L43 @bernhard have similar error with my other Mystique module Repo function line : https://github.com/trk/Mystique/blob/next/Mystique.module.php#L88 I can't find the issue. On my mac (macos mojave with valet (php 7.4.3)) and on my server (centos 7.7 with php (7.3)) i can't see this issue.
  4. @MilenKo and @LAPS What is your operation system ? Windows ?
  5. @bernhard i don't have a Windows PC and can't test it, Can you try to change ready function for next branch : public function ready() { $path = $this->wire("config")->paths->siteModules . "**/configs/Mystique.*.php"; $path .= "," . $this->wire("config")->paths->templates . "configs/Mystique.*.php"; foreach (glob("{" . $path . "}", GLOB_BRACE) as $file) { $dirname = dirname(dirname($file)); $base = strtolower(str_replace([dirname(dirname(dirname($file))), "/"], "", $dirname)); $name = str_replace([dirname($file), "/", "Mystique.", ".php"], "", $file); $this->resources[$base][$name] = $file; } } with public function ready() { $path = $this->wire("config")->paths->siteModules . "**" . DIRECTORY_SEPARATOR . "configs" . DIRECTORY_SEPARATOR . "Mystique.*.php"; $path .= "," . $this->wire("config")->paths->templates . "configs" . DIRECTORY_SEPARATOR . "Mystique.*.php"; foreach (glob("{" . $path . "}", GLOB_BRACE) as $file) { $dirname = dirname(dirname($file)); $base = strtolower(str_replace([dirname(dirname(dirname($file))), DIRECTORY_SEPARATOR], "", $dirname)); $name = str_replace([dirname($file), DIRECTORY_SEPARATOR, "Mystique.", ".php"], "", $file); $this->resources[$base][$name] = $file; } }
  6. Hi @bernhard Can you try @next branch https://github.com/trk/Mystique/tree/next, this will be next version.
  7. I am using Contabo VPS (Germany) services since 2015 and i can recommend this company to you.
  8. Yes, it's possible to do these kind of stuff. Create 1 Mystique field and do what you want with that field. Mystique config files Mystique seo configs Mystique admin edit for seo configs
  9. Module update to v2. Now it's possible to add or extend existing icon library via config file. Please check first post for example usage. Note: Hook method removed !
  10. @bernhard Thank you ! I fixed repo and thread broken images. Module allow you to add custom icons via hook and maybe i can or someone can add support for config file support like my Mystique module. I didn't add Font Awesome 5 support, because when you load FontAwesome 5 assets, it's breaking admin icons.
  11. @bernhard Nice work ! But, in module directory i have a module for pick icons. I hope you see it, before writing an icon picker. https://modules.processwire.com/modules/fieldtype-font-icon-picker/
  12. @neophron Always using this method may cause headache for you. What about add this method as property for each image field and use it like $imageField->alt. We need to add a hook method. Add hook method to existing /site/ready.php or create new /site/ready.php, copy below code and paste it in to /site/ready.php : /site/ready.php <?php namespace ProcessWire; wire()->addHookProperty('Pageimage::alt', function(HookEvent $event) { /* @var $image Pageimage */ $image = $event->object; $event->return = $image->description ?: str_replace('.' . $image->ext, '', $image->basename); }); Usage ($imageField->alt) : <?php foreach($page->images_slider as $image) { $slide = $image->size(0,700); echo "<li class='uk-width-3-4'>"; echo "<img class='photo' src='{$slide->url}' alt='{$image->alt}' width='{$slide->width}' height='{$slide->height}' />"; echo "</li>"; } ?>
  13. @neophron A solution about using filename as image alt info. You can try code below : <?php foreach($page->images_slider as $image) { $slide = $image->size(0,700); $alt = $image->description ?: str_replace('.' . $image->ext, '', $image->basename); echo "<li class='uk-width-3-4'>"; echo "<img class='photo' src='{$slide->url}' alt='{$alt}' width='{$slide->width}' height='{$slide->height}' />"; echo "</li>"; } ?>
  14. @cosmo @wbmnfktr I updated module, i tested it with fresh pw 140 dev installation and i see there is problem on https://github.com/trk/Mystique/commit/b16fdba23f508c4901aeed56e71041ad34cf8c8b and removed this function. Let me know if you still have problem ?
  15. @cosmo @wbmnfktr @next version is not fully working version. Use published version on module directory. If you want to try @next version, don't do it on live projects ! I will check @next version with latest processwire dev version.
  16. @bernhard if you are using ProcessWire 3 and if useFunctionsApi enabled you can call all api functions in rendered files directly.
  17. Nice to hear that. Processing input field there is not special check for input field. https://github.com/trk/Mystique/blob/master/InputfieldMystique.module.php#L135 Little bit worked on a base field type (basically this field type will get entered field type's database schemas and will create 1 database table for all entered fields), if i success about this field type, i will try to use input field based checks. For the moment getting and setting directly posted data.
  18. A tip, if your all code php in your template, you don't need to clode php tag. And no need to close and open tag again again <?php $content .= "<div class='uk-child-width-1-1 uk-child-width-1-3@m' uk-grid>"; foreach ($entries as $entry) { $content .= "<div> <a href='{$entry->url}'> <h2>{$entry->title}</h2><h4>{$publish_date}</h4></a>"; $content .= shortText($entry->body, 100); $content .= "<br><a href='{$entry->url}'> Read More </a></div>"; } $content .= "</div>";
  19. You can surround your list with grid component. <!-- 3 columns, for 4 columns, uk-child-child-width-1-4@m --> <div class="uk-child-width-1-1 uk-child-width-1-3@m" uk-grid> <div> Blog Title 1 </div> <div> Blog Title 2 </div> <div> Blog Title 3 </div> <div> Blog Title 4 </div> <div> Blog Title 5 </div> </div>
  20. I am using this module for SEO, LANGUAGE and ELEMENTS (uikit components) USAGE EXAMPLE : LANGUAGE On my private module, i added my custom configs path to Mystique module by using : Mystique::add('my-module-configs-path'); - Create config file <?php namespace ProcessWire; // Filename: MyModule/configs/Mystique.language.php // This options normally coming from a file array, i added 2 options for example $options = [ 'tr' => 'Türkçe', 'en' => 'English' ]; $defaultValue = 'en'; /** * Resource : MyModule => Language */ return [ 'title' => __('MyModule: Language'), 'fields' => [ 'title' => [ 'label' => __('Language title'), 'description' => __('Title of language'), 'type' => Mystique::TEXT, 'columnWidth' => 50 ], 'code' => [ 'label' => __('Code'), 'description' => __('Language short code'), 'type' => Mystique::SELECT, 'options' => $options, 'defaultValue' => $defaultValue, 'required' => true, 'columnWidth' => 50 ], 'flag' => [ 'label' => __('Flag'), 'description' => __('Language flag code'), 'type' => Mystique::TEXT, 'columnWidth' => 50 ], 'direction' => [ 'label' => __('Direction'), 'checkboxLabel' => __('Right to left'), 'description' => __('Direction of language'), 'type' => Mystique::TOGGLE_CHECKBOX, 'type_fallback' => Mystique::CHECKBOX, 'columnWidth' => 50 ], 'currency' => [ 'label' => __('Currency'), 'description' => __('Code of currency'), 'type' => Mystique::TEXT, 'columnWidth' => 50 ], 'symbol' => [ 'label' => __('Symbol'), 'description' => __('Symbol of currency'), 'type' => Mystique::TEXT, 'columnWidth' => 50 ], 'grouping_separator' => [ 'label' => __('Grouping separator'), 'description' => __('Thousand separator for amount'), 'type' => Mystique::TEXT, 'columnWidth' => 50 ], 'decimal_separator' => [ 'label' => __('Decimal separator'), 'description' => __('Decimal separator for amount'), 'type' => Mystique::TEXT, 'columnWidth' => 50 ], 'separator' => [ 'label' => __('Use separator'), 'checkboxLabel' => __('YES'), 'description' => __('Apply space between amount and currency symbol ?'), 'type' => Mystique::TOGGLE_CHECKBOX, 'type_fallback' => Mystique::CHECKBOX, 'columnWidth' => 33 ], 'show_decimal' => [ 'label' => __('Decimal'), 'checkboxLabel' => __('YES'), 'description' => __('Show amount decimals ?'), 'type' => Mystique::TOGGLE_CHECKBOX, 'type_fallback' => Mystique::CHECKBOX, 'columnWidth' => 33 ], 'symbol_after' => [ 'label' => __('Symbol after'), 'checkboxLabel' => __('YES'), 'description' => __('Display symbol after amount ?'), 'type' => Mystique::TOGGLE_CHECKBOX, 'type_fallback' => Mystique::CHECKBOX, 'columnWidth' => 33 ], ] ]; - Select config file from Mystique field settings - Add Mystique field to language template Access data via api (in this example mystique field name is : lang) <?php $language = $user->language; // lang is Mystique field echo 'Title : ' . $language->lang->title . '<br>'; echo 'Code : ' . $language->lang->code . '<br>'; echo 'Flag : ' . $language->lang->flag . '<br>'; echo 'Direction : ' . $language->lang->direction . '<br>'; echo 'Currency : ' . $language->lang->currency . '<br>'; echo 'Symbol : ' . $language->lang->symbol . '<br>'; echo 'Grouping separator : ' . $language->lang->grouping_separator . '<br>'; echo 'Decimal separator : ' . $language->lang->decimal_separator . '<br>'; echo 'Separator between amount and symbol : ' . $language->lang->separator . '<br>'; echo 'Show decimal : ' . $language->lang->show_decimal . '<br>'; echo 'Show symbol after amount : ' . $language->lang->symbol_after . '<br>'; Output: Title : English Code : en Flag : gb Direction : 0 Currency : GBP Symbol : £ Grouping separator : , Decimal separator : . Separator between amount and symbol : 1 Show decimal : 1 Show symbol after amount : 0
  21. Keep the field name same, do what you want. Because all data on database in string format (i am not checking user posted data), you can set field settings by using processwire fields api and you can limit user by settings. Hook methods could be used for custom usages.
  22. @BitPoet will check it, but i don't want to limit user's database options and if you need an important searchable field i am not advising to use this field, use a fully searchable field. @LostKobrakai I will add more details on readme.md file and will update this post and module page. About your question : as you see on youtube video, updating fields config file will update data entry form for admin page. If you remove field, you won't see this field on admin pages anymore. I am not caching your configs, always trying to get configs from selected config files.
×
×
  • Create New...