• Content count

  • Joined

  • Last visited

Community Reputation

63 Excellent

About OLSA

  • Rank
    Full Member

Profile Information

  • Gender

Recent Profile Visitors

2,532 profile views
  1. Maybe you can do the same without hooks using option "Selector string" inside settings for page reference field: Example 1: - Some page tree: -- Link items ---- link-item 1 ---- link-item 2 ---- link-item 3 -- Page 1 with page reference field -- Page 2 with page reference field -- Page 3 with page reference field Example 2: - Some page tree: -- link-item 1 -- link-item 2 -- link-item 3 -- Page 1 with page reference field -- Page 2 with page reference field -- Page 3 with page reference field // selector string has_parent=page.rootParent,template='link-item' Example 3: - Some page tree: -- Page 1 with page reference field ---- child link-item 1 ---- child link-item 2 ---- child link-item 3 -- Page 2 with page reference field ---- child link-item 1 ---- child link-item 2 ---- child link-item 3 // selector string parent=page,template='link-item' Regards.
  2. OLSA

    Hi GFXmonkey, there are many option to do that. Here is very basic example. 1) Eg. outside of main pages tree, create hidden parent page, eg. "Addons" (or "Blocks", "Widgets", or...). 2) Inside "Addons" tree you create and store reusable content (pages) using various templates (eg. slider, text-image, call-to-action, downloads, etc...). 3) Now what you also need is page reference field (eg. name "widgets") on pages inside main tree - to select - pages from "Addons" tree. How to use this concept? Example: "Text-Image widget" 1) Inside "Addons", create new page using template "text-image", place some image and insert some text. 2) Go to desired page (where you have page reference field "widgets") and select newly created "text-image widget" (1) How to render it? Also many options, but simple can be: if(count($page->widgets)){ foreach($page->widgets as $widget){ // as example widgets templates are in folder "widgets" // also this part can be different, find tutorials about ProcessWire render() method... include('./widgets/' . $widget->template->name . '.php'); } } Regards.
  3. OLSA

    Lucky you! You have the best job in the world! Q: What is a ProcessWire? A: Coding with a smile
  4. If inside page field setup is checked "Allow new pages to be created from field", there is option to create new page in modal window using hook method inside "site/ready.php". Please note to write page field name inside if statement. // ready.php $this->addHookAfter('InputfieldPage::renderAddable', function ($event){ $inputfield = $event->object; // please note: inside if statement need to write page field name! if ($inputfield->name == 'your_page_field_name') //<= here { $link = $this->wire('config')->urls->admin . 'page/add/?parent_id=' . $inputfield->parent_id . '&modal=1'; $out = '<p><a href="' . $link . '" target="_blank" class="pw-modal pw-modal-large"> <i class="fa fa-plus-circle"></i> Create New</a></p>'; $event->return = $out; return $event->return; } }); Regards.
  5. Can you try to change url (without "-" separator) ajax: { url: './option1list/', dataSrc: '' },
  6. OLSA

    If someone is interested, here is example how to automatically assign icon to file depends on file type. No images or empty HTML tags "<i class="fa..."></i>", only CSS pseudo elements. Link to Codepen Regards.
  7. OLSA

    Hello Matthew, the same things happened to me few times on PW 3.0.xx, this is not some help, only few facts what I noticed. I rember that I had some errors in session logs (did not investigate). What works in my case was to use shortcut to edit pages from front-end ("go to back-end from front-end" and admin page tree problem disappear). Also you can try, logout, CTRL+F5 (clear browser cache), and login again. Regards.
  8. Thank you Pwired, but please note that I mostly posted here working/devs versions (to minimise websites promotions). They are mostly from template selling portals where client buy template (html, wp, joomla... what they likes), and after it my job is full conversion to PW. At the end, many of these templates in source has large part of unused CSS, and because of that, in last step, I like to do and css optimisation/cleaning (eg. using node.js + grunt-uncss). Regards.
  9. Hello, here are some examples, all is Processwire, and all is conversion from HTML to PW. bistro, lawyer, mtrace, nekretnine, registar, prteam, entext... If you are interested, feel free to contact me. sasaoluic (AT) yahoo (DOT) com Best regards.
  10. OLSA

    Hello, also the same problem (ProcessWire 3.0.98 ), and solved it with this script. Maybe it looks dangerous (overwriting translation files) but it's solve my problem. /* This script iterate over json translation files and replace 'file' path separator to "\/". If you want to try it - place it in some template and reload page with that template. After fix, delete this script. */ foreach($languages as $language){ $path = $config->paths->files . $language->id; $files = preg_grep('~\.(json)$~', scandir($path)); if( count($files) ){ foreach($files as $file){ // file path $file_path = $path . DIRECTORY_SEPARATOR . $file; // load file $contents = file_get_contents($file_path); // decode JSON data into a PHP array $contentsDecoded = json_decode($contents, true); if (strpos($contentsDecoded['file'], '\\') !== false) { $contentsDecoded['file'] = str_replace('\\', '/', $contentsDecoded['file']); // encode array back into a JSON string and prettify $json = json_encode($contentsDecoded, JSON_PRETTY_PRINT); // save file file_put_contents($file_path, $json); } } } } Regards.
  11. @cstevensjr thanks for the reply. I found that links before, but read to fast..., now understand that is still in development/testing phase. Before 2 years I build JSON fieldtype (for configuration only), but sometimes, I use it to store contact details. Because never totally finished, I didn't post it to module section. Please, allow me to suggest that in case of this new fieldtypes (FieldsetGroup and FieldsetPage), to try to find another one option for multilanguage tabs to reduce space in user interface (and to get some kind of "compact view"). To be more clear, here are some screenshots of my JSON configuration filedtype. Compact view/layout: Field settings: Thanks for Ryan and others who are involved in development of this new fieldtypes. Best regards.
  12. Hello, is FieldsetGroup included only inside Pro fields or it in core? I am asking this because I had updated from 2.8 to 3.098 and can't find option to create FieldsetGroup field type? Thanks and regards.
  13. OLSA

    Thank you Ryan for focus point feature. Before this, I used option with select field where editor define focus point (crop from top percentages) - but right now it would be more precious and editors will like it more! Thanks.
  14. OLSA

    In my last project I had a to import about 4000 images, and had problem with about 1200 images. Images uploaded (using API from frontend), but some of them doesn't had variations images. Problem was that PHP GD image resize engine is very strict, and if there is any problem with image (beginning and ending bytes of file) GD resize failed. More about my case and solution is here.
  15. OLSA

    Hello BitPoet and others, don't know if this can help, but before few days in one project I need some solution to store repeatable urls, and build fieldtype "Repeats". It is very simple repeatable input (varchar/text) field (one of custom fields created thanks to Ryan Events module). I am sure that for you wouldn't be a problem to copy/paste/rename and create integer/float repeatable field. I had build many PW fields types but never had enough time to polish it and place in PW modules section. Regards. FieldtypeRepeats.zip EDIT: I read this topic again, and because these days I am mostly in "backend forms job", my first thought was that you need this for backend forms. Sorry for that. Please note - this field type is not for front-end forms - it is for backend/admin forms. Also, here is example how to get field values at front-end. // my first plan was to store few "link" details // because of that, need to call "value" // default foreach($page->field_name as $url){ echo $url->value;// note: "value" } // to get first row echo $page->field_name->first->value;