Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. Just tried it: it works Just follow the RuntimeMarkup instructions, and make sure you choose the wireRenderFile method. Add your new RM field to your repeater, and include something like <li class="Inputfield InputfieldSubmit Inputfield_submitSelection uk-width-auto uk-margin-top uk-grid-margin uk-first-column reloaded InputfieldRowLast" id="make-this-id-unique"> <div class="InputfieldContent uk-form-controls"> <button id="make-this-unique-too" class="ui-button ui-widget ui-corner-all ui-state-default" name="ditto" value="Submit / Send x" type="submit"> <span class="ui-button-text">Submit / Send x</span> </button> </div> </li> I guess you'll want to edit the IDs, and add data-attributes or hidden fields to do whatever you've got to do
  2. Well, each item inside a repeater is a field. Since there are no button input fields you could choose from, you could try building something with FieldtypeRuntimeMarkup? https://modules.processwire.com/modules/fieldtype-runtime-markup/
  3. Another nice one: http://input.fontbureau.com/
  4. They should be, all seven listed here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/LanguageSupport/LanguageSupportPageNames.module#L133 However, there's also this comment a few lines down, that may clash with what you're doing: // verify that page path doesn't have mixed languages where it shouldn't $redirectURL = $this->verifyPath($this->requestPath); if($redirectURL) return wire('session')->redirect($redirectURL); In your alternate languages, the pagenames for products and projects are probably different (i.e. produkte / projekte in german etc.).
  5. I get a fatal error, when I want to edit a page that has no image field. Well, actually there are image fields, but they are part of repeaters or matrix-repeaters, or some other fields. btw: this refers to the wire module file, not site The template of this page has the following fields/field-types: I feel kinda bad for posting all these issues... I'm sure the community can wait till 2018 until these things are ironed out. Enjoy your well-deserved holidays!
  6. With Firefox, I can drag and drop, but copy+paste does nothing. If I drag and drop, and right click on "image properties", I get the same errors I posted above... Once I save the page, the image stays in the WYSIWYG editor, but it hasn't been added to the images-field. And right-clicking again only shows the same errors... checking the HTML source code, I see the image src is still the remote (source) URL. I don't know if this is related, but my JS console is showing the following error: 17:27:24.227 ckeditor.js:253 Uncaught Error: [CKEDITOR.resourceManager.add] The resource name "mystyles" is already registered. at CKEDITOR.resourceManager.add (ckeditor.js:253) at /site/modules/InputfieldCKEditor/mystyles.js?nc=1512242401&t=2015030801.160:9 the contents of mystyles.js: /** * mystyles.js * * This file may be used when you have "Styles" as one of the items in your toolbar. * * For a more comprehensive example, see the file ./ckeditor-[version]/styles.js * */ CKEDITOR.stylesSet.add('mystyles', [ {name: 'Inline Code', element: 'code'}, {name: 'Inline Quotation', element: 'q'}, {name: 'Left Aligned Photo', element: 'img', attributes: {'class': 'align_left'}}, {name: 'Right Aligned Photo', element: 'img', attributes: {'class': 'align_right'}}, {name: 'Centered Photo', element: 'img', attributes: {'class': 'align_center'}}, {name: 'Two Columns', element: 'p', attributes: {'class': 'columns-2'}}, {name: 'Three Columns', element: 'p', attributes: {'class': 'columns-3'}}, {name: 'Justify', element: 'p', attributes: {'class': 'justify'}}, {name: 'Small', element: 'small'}, {name: 'Deleted Text', element: 'del'}, {name: 'Inserted Text', element: 'ins'}, {name: 'Cited Work', element: 'cite'} ]);
  7. I guess @pwuser1 was asking about a code-editor / IDE that supports jQuery autocomplete while typing etc. Just about any code-editor should support it, or at least have extensions. Try Sublime or VSCode.
  8. That's a nice one to end the year Unfortunately, the new CKEditor image feature doesn't quite work as expected. (Win 8, latest Chrome). I can copy + paste, and drag and drop. But when I right-click on the image and select "image settings", I see this in the modal: ProcessWire: ProcessPageEditImageSelect: No page specified DEBUG MODUS ABLAUFVERFOLGUNG ($config->debug == true): #0 /home/mysite/public_html/dev.mysite.ch/wire/core/Modules.php(607): ProcessWire\ProcessPageEditImageSelect->init() #1 /home/mysite/public_html/dev.mysite.ch/wire/core/Modules.php(1288): ProcessWire\Modules->initModule(Object(ProcessWire\ProcessPageEditImageSelect), Array) #2 /home/mysite/public_html/dev.mysite.ch/wire/core/ProcessController.php(168): ProcessWire\Modules->getModule('ProcessPageEdit...', Array) #3 /home/mysite/public_html/dev.mysite.ch/wire/core/ProcessController.php(259): ProcessWire\ProcessController->getProcess() #4 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(380): ProcessWire\ProcessController->___execute() #5 /home/mysite/public_html/dev.mysite.ch/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___execute', Array) #6 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessController), 'execute', Array) #7 /home/mysite/public_html/dev.mysite.ch/wire/core/admin.php(113): ProcessWire\Wire->__call('execute', Array) #8 /home/mysite/public_html/dev.mysite.ch/wire/core/admin.php(113): ProcessWire\ProcessController->execute() #9 /home/mysite/public_html/dev.mysite.ch/wire/modules/AdminTheme/AdminThemeUikit/controller.php(15): require('/home/mysite/...') #10 /home/mysite/public_html/dev.mysite.ch/site/templates/admin.php(15): require('/home/mysite/...') #11 /home/mysite/public_html/dev.mysite.ch/wire/core/TemplateFile.php(287): require('/home/mysite/...') #12 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #13 /home/mysite/public_html/dev.mysite.ch/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___render', Array) #14 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #15 /home/mysite/public_html/dev.mysite.ch/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #16 /home/mysite/public_html/dev.mysite.ch/wire/modules/PageRender.module(514): ProcessWire\TemplateFile->render() #17 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #18 /home/mysite/public_html/dev.mysite.ch/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___renderPage', Array) #19 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #20 /home/mysite/public_html/dev.mysite.ch/wire/core/WireHooks.php(808): ProcessWire\Wire->__call('renderPage', Array) #21 /home/mysite/public_html/dev.mysite.ch/wire/core/WireHooks.php(808): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent)) #22 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #23 /home/mysite/public_html/dev.mysite.ch/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array) #24 /home/mysite/public_html/dev.mysite.ch/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Page->render() #25 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(383): ProcessWire\ProcessPageView->___execute(true) #26 /home/mysite/public_html/dev.mysite.ch/wire/core/WireHooks.php(714): ProcessWire\Wire->_callMethod('___execute', Array) #27 /home/mysite/public_html/dev.mysite.ch/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #28 /home/mysite/public_html/dev.mysite.ch/index.php(55): ProcessWire\Wire->__call('execute', Array) #29 /home/mysite/public_html/dev.mysite.ch/index.php(55): ProcessWire\ProcessPageView->execute(true) #30 {main} Der Prozess hat keinen Inhalt ausgegeben. (the process didn't return any content) Once I save the page and do the same thing again, those errors are gone. Do I have to adjust my settings somewhere?
  9. I'm quite impressed by https://canadabusiness.ca/ They built a full-blown REST server with ProcessWire: https://canadabusiness.ca/developer/docs/ And widgets too: https://canadabusiness.ca/developer/widgets/ Does anybody know who built this site?
  10. @Federico I did a little exercise myself after your last forum thread (without using @kongondo's VS though)
  11. @Federico I am just curious - why do you need such a setup?
  12. Did you see this thread? https://processwire.com/talk/topic/16689-exception-unknown-selector-operator/ Also, what is exactly on line 64 of index.php? And did you check perhaps your error logs? Maybe you'll find more infos there (although the above seems pretty verbose)
  13. Does this happen in the frontend or backend? Did you also replace the index.php and .htaccess file? Try deleting the site/assets/cache/ folder contents. If that doesn't help (and you can login to the backend), try clearing the modules cache. If that doesn't help either, disable all modules (other than core modules), and re-install one by one. Or add namespacing on the very first line of your .module files: <?php namespace ProcessWire;
  14. Thank you! Works like a charm. Didn't yet know about renderReady() - bookmarked
  15. I am trying to create an input field type InputfieldPageListSelectMultiple in a module, but for some reason, it doesn't quite work as expected... (abbreviated) code: $this->addHookAfter('ProcessPageLister::renderResults', function ($event) { $out = ''; if(wire('page')->id === 1224) { // the particular Lister instance page id $form = wire('modules')->get("InputfieldForm"); $field = wire('modules')->get("InputfieldPageListSelectMultiple"); $field->attr('name+id', 'current_selection'); $field->attr('class', 'InputfieldAsmSelect'); $field->label = 'Your current selection'; $field->derefAsPage = FieldtypePage::derefAsPageOrNullPage; // this part works - $total is taken from a session variable if($total) { $sel = $total["selector"]; $myPages = wire('pages')->findIDs($sel); foreach($myPages as $k=>$v) { $field->attr('value', $v, wire('pages')->get($v)->title); } } $form->append($field); $myForm = $form->render(); $event->return = $myForm; } }); What I get is this: I can't drag and drop, the layout is not correct (trashcan should be on the right), and I also can't delete. Furthermore, I see a textinput with the page IDs underneath. Why? Oh, and also: the first item is "Label" o_O I've googled, and looked at Ryan's code, but I guess I'm missing important stuff. (if you're wondering: I'm trying to do a little proof of concept that would (partly) solve this question here)
  16. did you try has_parent and do it the other way around? foreach($everything as $e) { foreach($parent as $p) { if($e->has_parent($p) { // do something } } } Without knowing what you actually do with $childlist, it's hard to suggest maybe a more efficient way to do this...
  17. You're welcome. It's under modules: https://www.yoursite.com/backend/module/?reset=1 of course, replace "backend" with whatever name you have chosen during install (default = processwire)
  18. http://processwire.com/api/ Some stuff, like newer additions in v.3.x, are explained in the blog posts, and are sometimes not yet in the docs. In some cases, like PageArray and WireArray, the more comprehensive documentation is in the Wire chapter, e.g. http://processwire.com/api/ref/wire-array/. But then there shold be a note at the top, like here: http://processwire.com/api/ref/page-array/ There's also https://processwire-recipes.com/
  19. Make sure your FTP upload was complete. Refresh the module cache. You could also try to delete everything inside site/assets/cache/. The locale is just an example. Set it to whatever you need. It has nothing to do with a site being multilanguage or not. Try setlocale(LC_ALL, 'de_DE.UTF-8');
  20. And then, there's always array_unique() or http://cheatsheet.processwire.com/pagearray-wirearray/getting-items/a-unique/
  21. You could try like this: http://thisinterestsme.com/php-login-to-website-with-curl/ That doesn't work (would have been too easy). PW uses some hidden token field, for security reasons I guess, which changes on each request.
  22. I tried that as well, but I always got an error. I switched now from findIDs to findMany, and my first line after foreach() is now $useAsRef = $m->use_as_ref_select->id; Later on, I use $matches->remove() and $matches->add() to get the desired new Page array.
  23. I'm having a similar (same?) problem. $matches = $pages->findIDs($selector); foreach($matches as $v) { $useAsRef = $pages->get($v)->use_as_ref_select; echo "useAsRef $v: $useAsRef <br>"; //echo gettype($useAsRef) . "<br>"; // object //echo "<pre>"; //print_r($useAsRef); // PW page //echo "</pre>"; if( ($pages->get($useAsRef->id)) === 10132 ) { $removeArray[] = $v; // remove those $whichOneInstead = $pages->findIDs($v)->sammelref_rel; // add these instead echo "whichOneInstead : $whichOneInstead <br>"; $addArray[] = $whichOneInstead; } else { echo "else: " . $pages->get($useAsRef->id) . " <br>"; } } Now, my debug output is: useAsRef 9609: 10132 else: 10132 useAsRef 9615: 10132 else: 10132 useAsRef 9611: 10132 else: 10132 useAsRef 9607: 10132 else: 10132 useAsRef 9589: 10129 else: 10129 useAsRef 9619: 10129 else: 10129 useAsRef 9599: 10129 else: 10129 useAsRef 9623: 10132 else: 10132 Why is it outputting the wanted page id in my else() several times, but ignoring my if statement? I tried hacks like (int) or using == instead of ===, but to no avail. use_as_ref_select is a pagefield, btw. value type: "single page Page or boolean false when none selected" input: single select, with a default value and required Any ideas?
  24. Or, you could set cookies (completely client-side) instead.
×
×
  • Create New...