• Content Count

  • Joined

  • Last visited

Community Reputation

4 Neutral

About siilak

  • Rank
    Jr. Member
  • Birthday 04/28/1980

Contact Methods

  • Website URL
  • Skype

Profile Information

  • Gender
  • Location
    Tallinn, Estonia

Recent Profile Visitors

1,281 profile views
  1. siilak

    There are nice and easy examples in GitHub for using Processwire Rest API with Vue / Angular / React Whit them you can easily build nice websites with smooth page render, navigation and more.
  2. siilak

    I also made function for Page Reference field in pagefields.php. private function getReference($p, $apiField) { $p->of(false); $pages = $apiField->name; $id = $p->get($pages); $apiFields = []; if ($id) { $output[$pages]['title'] = $id->title; $output[$pages]['name'] = $id->name; $output[$pages]['url'] = $id->url; return $output; } return $apiFields; } Then add this to function "getAllFields" else if ($apiFieldType instanceof FieldtypePage) { $apiFields = array_merge($this->getReference($p, $apiField), $apiFields); }
  3. siilak

    There is a solution for filefield. In pagefields.php file add after image_fields 'file_fields' => [ 'fields' => ['description', 'httpUrl'], ], Then after private function getImages private function getFiles($p, $fld) { $fldName = $fld->name; $files = []; $i = 0; foreach ($p[$fldName] as $file) { $fileConf = $this->conf['file_fields']; foreach ($fileConf['fields'] as $fileField) { $files[$fldName][$i]['file'][$fileField] = $file[$fileField]; } $i++; } return $files; } Then make a change for field type if ($fldType instanceof FieldtypeImage) { $flds = array_merge($this->getImages($p, $fld), $flds); } else if ($fldType instanceof FieldtypeFile) { $flds = array_merge($this->getFiles($p, $fld), $flds); } else if ($fldType instanceof FieldtypeRepeater) { $flds = array_merge($this->getRepeaters($p, $fld), $flds); } else { $flds = array_merge($this->getFields($p, $fld), $flds); }
  4. siilak

    Thank you for a answer. In pagefields.php are good solution for a images. I also trying to write a file field part.
  5. siilak

    I added file field called "video". Result in API is "video": [ { "data": "filename.mp4", "description": "[\"\"]", "modified": "2018-04-22 23:08:59", "created": "2018-04-22 23:08:59", "filedata": null } ], But how I can show "data" field as a httpUrl with full path "/site/assets/files/PageID/filename.mp4"
  6. siilak

    One good thing with a PW is you not need any modules to build something. For social media Icons you can use textfields and displaying is pure php and font awesome icons or with some front end framework (Foundation, bootstrap, uikit etc). For example: Make new field called instagram and you can display like this with Font Awesome: <?php if ($page->instagram) { ?> <a href="<?php echo $page->instagram; ?>" target="_blank"><i class="fa fa-2x fa-instagram"></i></a> <?php } ?>
  7. siilak

    Really nice example. Thanks!
  8. siilak

    Yes, I made clean install and its ok now. I think it was my own fault.
  9. siilak

    Nice upgrade for a module. I tested it on latest ProcessWire DEV version and only error I get is Front-End Page Editor error. Added a video. Maybe there is a simple solution for that
  10. Really love that theme. I use Semantic UI on frontend pages also
  11. siilak

    I see that in 3.0 version and love it
  12. siilak

    I made a template for add new page. Page is added under home page. <?php include('./_header.php'); ?> <?php // Load FormHelper module and also set wire('fh') variable $fcm = $modules->get('FrontendContentManager'); // add a new page based on a template and a parent object $parent = $pages->get('name=home'); $form = $fcm->add($parent, $parent->template); // jsConfig needed by ckeditor echo $fcm->JsConfig(); // outpunt needed scripts for inputfield modules, ... foreach ($config->styles as $file) { echo "<link type='text/css' href='$file' rel='stylesheet' />\n"; } foreach ($config->scripts as $file) { echo "<script type='text/javascript' src='$file'></script>\n"; } ?> <div class="uk-container uk-container-center"> <h1><?php echo $page->title; ?></h1> <?php // output the forom echo $form; ?> </div> <?php include('./_footer.php'); ?> and only result I get is this. Any help?
  13. Hi and thanks for quick reply I know that, my code looks funny but I'm front-end and design comes first I end my 7 years marriage with drupal and PW is something new and much better for me. Thanks mr-fan, first link is exactly what i need.
  14. Hi I can dsplay post author username echo "Posted by "; echo $page->createdUser->name; Its ok, but I also want to print user images foreach ($page->createdUser->images as $userimage) { $thumb = $userimage->size(480, 480); echo "<img src='{$thumb->url}' alt='{$thumb->description}' />"; } But its not working. Any help?