Jump to content

LostKobrakai

PW-Moderators
  • Posts

    4,956
  • Joined

  • Last visited

  • Days Won

    100

Everything posted by LostKobrakai

  1. Would you please share for other how you tackled it now?
  2. As the errors do state it's an issue with your database, which seems related to multi language. The first 4 errors are there because a column is already existing, while something seems to try to create it again, while the last one tries to access a column, which is not existing.
  3. So you've not only a single csv, but multiple? I'd really suggest taking a look in the code of Ryan's module. It's essentially just reading the file line by line and if you code the thing on your own you can decide what you do with the data you're getting: Create a new page, setup a page field, … All of those things can be done with the processwire api like whereever else. To start out I'd just create a template for the import and copy paste code over to the template. If it's a one time import there's no need to work with modules and lots of functions.
  4. You would first import all the single pages, without anything dependent on other pages. Each page should include an unique identifier from the old db (id, linenumber, …). Now in a second run you can save all the references, as all pages are now existing and you find them via the "old" unique identifier. Edit: Ryan's module is solely equipped to do the first step. The second one is probably something you'd need to code yourself.
  5. Search engines are quite dump machines, if they cannot find a link to one of the files, they won't index them. As those bots are naturally unauthenticated, they should only see the login page. If you want to access control not only the page, where the link will be shown, but also the direct link to the files, then $config->pagefileSecure is the keyword.
  6. Wherever you echo out content, that shouldn't be part of any response to ajax calls.
  7. I'm not sure why you guys think that limiting flex-items to a fixed number per row is not possible via css: http://jsfiddle.net/yq5fopxh/ If you really want to use php, then use this: foreach($page->projectBox->getValues() as $num => $box) { // 0 1 2 // 3 4 5 // 6 7 8 // echo <br> before any number which is dividable by three without rest // and only if number is not 0 if($num && $num % 3 == 0) echo "<br>"; echo "<div class='projektbox'>"; // box stuff echo "</div>" }
  8. $box is not countable, it's just a page/repeater object. Also why don't you just use css for that job? flex-wrap and flex-basis should be enough for the job and you don't need any <br>'s.
  9. $q = $sanitizer->text($input->get->q); if($q) { $input->whitelist('q', $q); $qs = explode(" ", $q); foreach($qs as $key => $q){ $qs[$key] = $sanitizer->selectorValue($q) } $selector = "title|body|interests*=" . implode("|", $gs) . ", limit=50"; if($user->isLoggedin()) $selector .= ", has_parent!=2"; $matches = $pages->find($selector); if($matches->count) { $content .= "<h2>Found $matches->count pages matching your query:</h2>"; $content .= renderNavPanel($matches); } else { $content = "<h2>Sorry, no results were found.</h2>"; } } else { $content = "<h2>Please enter a search term in the search box (upper right corner)</h2>"; }
  10. Actually there's no simple answer besides "It depends". The part being responsible for how matches are determined is: "title|body|interests~=$q" or rather "~=", which by the docs means "Contains all the words". To get other results use an other operator in the selector. Also there's no such thing as "search operators" that you can directly enter into the search field. If you want something like that, you'd need to implement that on your own by parsing them down to different selectors in your code. About the two sanitizers: These are necessary to secure you're search from potential abuse. The first one does make sure you're getting text without markup, while the second one makes sure the selector value is properly escaped (e.g. quotes and commas), so it will be correctly parsed by the $pages->find() function and won't break the selector.
  11. Most likely you're using Firefox. Somehow firefox thinks it's a good thing to prevent developers from disabling auto-fill-in / autocomplete. https://github.com/ryancramerdesign/ProcessWire/issues/1236
  12. The name field is technically not a field, that's why it's not there.
  13. You can change the label for the name field in each template's settings individually.
  14. I'm not sure about the performance considerations of short vs long sessions, but I think it would be nice if the core would allow sessionless usage at least for unauthenticated requests. Shouldn't be to hard to declare everyone "guest", but there may be considerations regarding the $session api variable.
  15. The session is started by the wire/core/session.php, which currently seems to be a mandatory part of the core. Things like determining the current user and further down the road the template access management rely on a session being present.
  16. First time I've seen a DMCA takedown on Github https://t.co/4rCF1Qsh2k. 2. most popular on packagist after zendframework's implementation.

  17. WirePdf's $pdf->mpdf doesn't return the mpdf instance for me and a quick look through the code seems to confirm that.
  18. If you're using this you shouldn't implement ConfigurableModule. It's detecting the Config options without the interface.
  19. They are wrapped in article tags, which by the html5 spec create a new content section with own headline structure. I'm not sure how well search engines honor the spec by now, but they really should.
  20. That's strange! I can indeed confirm this behaviour. It could be related to the webfont you're using, but that's not more than a hunch.
  21. // works with keys / selectors // will return null if not present if($pageArray->get(1045)) //do something; if($pageArray->get("id=1045")) //do something; // Works for the above types and also // if you've already an page object to compare if($pageArray->has($page)) //do something; You'll find both of them here: http://cheatsheet.processwire.com/
  22. $files = explode( "|", $form->get( "cv_file" )->value ); foreach( $files as $file ){ if( $file && file_exists( $upload_path . $file ) ){ $page->cv_file->add( $upload_path . $file ); $page->cv_file->last()->description = $file; unlink( $upload_path . $file ); } } $page->of( false ); $page->save();
  23. I've written this on github a few days ago as well. I think this is deliberate, because superusers are the only people, who can interact with the trash. All other users can only delete pages and they are gone for them. Now, under those circumstances, nobody wants those users to delete pages by accidentally clicking on the wrong button in the pagelist. If users need batch deleting I'd rather suggest using ListerPro and the trash/delete PageAction, while few pages can also be deleted by opening those in new browser tabs and delete them via the page editor. But if one really would like a delete action in the pagelist: The method is hookable and everyone can add whatever one needs / wants to that actionlist.
  24. https://processwire.com/talk/topic/10589-nextprevious-links-excluding-pages-based-on-options-field/
×
×
  • Create New...