Jump to content

bernhard

Members
  • Posts

    5,714
  • Joined

  • Last visited

  • Days Won

    270

Everything posted by bernhard

  1. i think what COULD make sense is some kind of helper module that makes it easy to handle some more advanced features (sometimes necessities) like deviding the import in chunks or providing some helper functions like handling pagename collisions, importing images and so on. but i don't know if there are better solutions already providing such things like using lister pro or batch child editor, import csv and so on. for me it was just the quickest solution to code it on my own. i had only 168 pages in the blog and 165 persons to import and that went without even increasing execution time
  2. a module would be cool. but i think it will be difficult to handle all situations... the freedom of processwire will make it difficult to find some common standard in all installations / setups... i guess it will almost always be faster to use some simple unique script like mine above but i'm happy if you prove me wrong good luck with your import!
  3. i had this problem some days ago and wrote a simple script on both websites. both online on different domains: export on old website: <?php $export = false; if($export AND $input->get->export == 'blogitems') { echo "<?xml version='1.0' ?>"; echo '<pages>'; $parent = $pages->get('/blog'); $results = $parent->children(); //$results = $pages->find('id=3198'); // ohne pic //$results = $pages->find('id=3204'); // mit pic foreach($results as $p): $p->of(false); ?> <page> <title><?= $p->title ?></title> <date><?= $p->blog_date ?: $p->created ?></date> <featured>1</featured> <pic><?= $p->main_slider_coverpic->first()->httpUrl ?: '' ?></pic> <body><?= $p->body ?></body> <images><?php foreach($p->images as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></images> <files><?php foreach($p->files as $file) { echo '<file>' . $file->httpUrl . '</file>'; } ?></files> <gallery><?php foreach($p->gallery as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></gallery> </page> <?php endforeach; echo '</pages>'; die(); } and then the import: <?php $import = false; if($import AND $input->get->import == 'blogitems') { $items = simplexml_load_file('https://www.your-old-website.com/?export=blogitems'); foreach($items as $page) { $p = new Page(); $p->template = 'blogitem'; $p->parent = '/news'; $p->title = $page->title; $p->name = $sanitizer->pageNameUTF8($page->title, true); while($pages->find('parent='.$p->parent.',name='.$p->name)->count() > 0) $p->name .= '-1'; $p->date = $page->date; $p->featured = $page->featured; // get body html and remove root node // $p->body = substr($page->body->asXML(), 6, -7); // ###### update: it's better to use base64_encode($page->body) in your export and then base64_decode($page->body) in your import ##### $p->save(); // add images if(strlen($page->pic)) $p->pic->add((string)$page->pic); foreach($page->images->image as $image) $p->images->add((string)$image); foreach($page->files->file as $file) $p->files->add((string)$file); foreach($page->gallery->image as $image) $p->gallery->add((string)$image); $p->save(); echo 'new page <a href="' . $p->editUrl . '" target="_blank">' . $p->path . '</a><br>'; } die(); } of course that is not bulletproof but it's really simple and you can do whatever you want (export junks by adding start=0, limit=10 or the like to your selector) you can also try adrians batch child editor. or csv importer. but for me the example above worked like a charm ps: try it with limit=1 for testing
  4. thank you very much flydev, but they have a demo have you had any issues or drawbacks so far? what linux distro are you using it with?
  5. https://vestacp.com/ any experience with that? looks really nice! i think i'll give it a try this week but wanted to hear if anybody has some experiences/hints for me? the plan is to use it with a digitalocean droplet. i am not totally satisfied with other solutions like cloudways and serverpilot...
  6. i found one issue with ajax loaded fields. it breaks the UI totally - no input possible any more:
  7. just tried it on another site, so i consider this as a bug. can anybody confirm, please, then i will create an issue on github...
  8. hm... i guess yes, as it works correctly when i save a standard page with pagename äöü... edit, yes .../site# file -bi config.php text/x-php; charset=utf-8
  9. yesterday i imported some blog-posts from an old pw version to a new one. worked like a charm, but today i saw that the url does not show german umlauts. the pagename is created from the title automatically after sanitization, so i tried this: and after researching i found out about the new function: https://processwire.com/api/ref/sanitizer/page-nameut-f8/ As you see, the result is not right! my config says this: $config->pageNameCharset = 'UTF8'; $config->pageNameWhitelist = '-_.abcdefghijklmnopqrstuvwxyz0123456789æåäßöüđжхцчшщюяàáâèéëêěìíïîõòóôøùúûůñçčćďĺľńňŕřšťýžабвгдеёзийклмнопрстуфыэęąśłżź'; and trying lowercase letter it got even worse! am i missing anything? pw 3.0.30
  10. hi tpr, short (maybe) bugreport: i think the field-name-tooltips do not get loaded when using ajax collapsed fields. can you confirm that?
  11. there was some discussion about this years ago: don't know how ryan sees this nowadays where pw should be more a framework than a cms...
  12. jep, i think you are right with this
  13. related to the helpdesk topic i want to suggest that you offer the possibility to support this awesome project (module seems like an offense in that case) with donations and mention the donors somewhere in return. what do you think of that? I'm really thankful for what you built here as i learned a lot and i don't know where i would be today without all the help of tracy opening my eyes. maybe it's just me because tracy came in right in time and i've never used xdebug or the like - but i have the feeling i'm not the only one thinking a bit about it i'm asking myself if that wouldn't be a good feature for the modules directory? offering a donation button connected to the devs paypal account and showing the donors automatically ranked by amount? if that is getting too offtopic don't mind creating a new topic for it... my first intention was related to tracy though, so i'll leave my comment here
  14. ok throwing in some more ideas here as i think it would really be great to have something like this. i think the priority should be to help US at our work with our clients and not to develop something that spreads the word about processwire... imho the most important parts would be feedbackform directly on the page where the issue occurs (i always have to teach my clients that they send me the URL with every request they are sending). like in my post in tracy (see below) copy&paste screenshots would be awesome: https://github.com/vladmalik/pasteimage simple overview system both for clients and for devs simple notification system i'm really short on time but would help as much as i can if something like this would arise. i'm also willing to sponsor some euros for such a project
  15. creating something cool is the one thing, keeping it up to date is the other... that's the more challenging part. you would have to make sure that all installations of your system can get updated if the user decides to. that's a pain with site profiles. so i agree it would be cool to have simple project/task/ticket management in pw but i think the only possible way would be to develop a module. installable, updateable, maintainable... gitlab has recently announced their new issue board. that looks really nice from what i saw on the video: https://about.gitlab.com/2016/08/22/announcing-the-gitlab-issue-board/
  16. i have no problems on one 2.8.28 installation. i always use shortcut methods like this (you have to check the "enable shortcut methods" checkbox for this // test tracy dump anywhere in your files bd('tracy dump working'); im not sure about this backslash... i get the same error on pw3 when using TD::... everything works when using shortcuts
  17. the code is in your linked example, so what is your exact question?
  18. found a little display glitch on collapsed fields (standard theme pw3):
  19. haha ok sorry for that, i corrected my post here is the link: http://processwire.com/blog/posts/tesla-model-s/ @horst is it possible to share some details about that? what is planned? there was a lot of discussion around this topic in the past, i think it would be good to consider some of that feedback for a new version of the corefield (or will it again be a module?). i can't find the right topic now where we were talking about presets in the core field... what i found was only these two topics: and still on my wishlist, because that would make building image galleries a breeze: any chance that client side resizing finds its way to this update? at least it was mentioned in the roadmap for 2016 https://processwire.com/blog/posts/happy-new-year-heres-a-roadmap-for-processwire-in-2016/#what-else-is-coming-for-processwire-3.x-in-2016 thank you for all your work on the images field so far!!
  20. In the last Blog Post Ryan said he and Horst are working on it have had a chat about it... On Mobile no Link sorry Link in the next post
  21. thank you guys, especially @Soma, helped me a lot! i totally forgot i had to inject the variable on my own in frontend. when i was logged in it was present because i use frontendediting and there it gets injected automatically. totally makes sense i took a slightly different approach with my own js variable: // template <?php echo $modules->get('PwFullCalendar')->render(array( 'editable' => $page->editable(), )); ?> // module public function render($options = array()) { // get settings $settings = array_merge($this->settings, $options); extract($settings); // push settings to javascript $out = '<script>var fullcalsettings = ' . json_encode($settings) . ';</script>';
  22. i need to share some variables between my backend and frontend. i tried using $config->js for that: https://processwire.com/api/ref/config/js/ the strange thing is that it throws an "Uncaught ReferenceError: ProcessWire is not defined" error - but only when i am not logged in! i tried it on a different install (both pw3) and there is the same problem. is that intended? what can be the problem? _main.php [...] $config->js('test', 'bla'); ?> <script> $(document).ready(function() { console.log(ProcessWire.config.test); }); </script> ok without the document.ready i get the error both logged in and logged out... even more strange any ideas?
×
×
  • Create New...