Jump to content

saml

Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by saml

  1. Thanks all for the input! ? I ended up re-creating the site from scratch and doing the (now finished) import workflow one final time (and for any subsequent updates via API made sure to just update existing pages when possible). It worked OK for me as I didn't have too much manually set up pages, so I could redo it all in under an hour anyways.
  2. I have a case where I have been troubleshooting a page import script (via commandline) by repeatedly importing a bunch of pages (a bit over a hundred), deleting them, adjusting my import process and then redoing this, over and over. The result is now that page IDs are starting to be up over 10 000. Not an actual problem of course, but it would somehow look nicer if those early pages had page IDs starting from a lower number. Thus I was wondering if there is a way to "restore" the increasing page ID number to start by a low number, when deleting pages? Can it be done through the API somehow, or would I need to dive in and fix the AUTO_INCREMENT value in the database, and would that risk to lead to other problems?
  3. Just seconding this here, as @kolewu is completely right. This has nothing to do with security AFAIK, but with the ability to install multiple CMSes in a single database. I have in many situations (for customers using obscure ISPs etc) been dependent on the ability to prefix the db tables of different CMSes we ran on the single MySQL database provided by the web hotel.
  4. Since I didn't see it mentioned in any changelogs, I just want to give a heads up to the new ability to import field values via JSON files, which @justb3a implemented in top notch quality after my fiddly proof-of-concept patch . I find this to be a major improvement, since it enables so much easier import of data from e.g. Drupal, so just wanted to make you all aware of it. I have outlined in very broad broad terms how I went about transferring data from a Drupal 7 site, to processwire, in this post.
  5. Thanks a lot @tpr, @cstevensjr and @kongondo! Admin Restrict Branch looks exactly right for us! (Don't know how I missed it) Cheers!
  6. Hi folks, I'm trying to find what is the best strategy for role-based edit access to subtrees of the page tree, as of today, in February 2016? We will have a varied group of editors who all need edit access to their particular pages and subtrees of the page tree. I find it a little hard to find what is the most up to date strategy and information. I found the PageEditPerRole module (http://modules.processwire.com/modules/page-edit-per-role/) that seems to come close, but it is stated to only support PW up to 2.4, and also requires other modules, so I was hesitant to install it. What would you recommend?
  7. Well, I managed to solve this now by just saving the page twice: Once before populating the page's fields, and once after.
  8. I'm creating a general function for batch import, for a site migration, and while looping through fields (field names) to be imported for a page, I need to check whether the field is an image (or other file type), so that it can be imported after the first pave save. What would be the recommended way to check this, with PHP code?
  9. Well, I made a little hack to it now, so it can take field contents as a JSON string on the commandline. Will try it out a bit and see if it fulfills my importing needs. EDIT: Updated link to new pull request.
  10. Btw, just found the wireshell tool ... wow! ... but it doesn't seem to be able to import page content, only creating pages?
  11. Anyone knows a good way to create a php-file that can be executed by php on the commandline (php.exe on windows), to do the same thing?
  12. We have to make the world know! Discuss and upvote: https://news.ycombinator.com/item?id=10345280
  13. I realize setting the created date programmatically is very important when migrating content from an old site (I do that now, from drupal). I would very much be able to do that at least from the API. So, is SQL the only option?
  14. Hi, Yeah, I guess probably my problem was in part that I hoped to be able to use a rich text editor together with my solution, since I really like the manual scaling-feature, for automatically creating thumbs. But indeed, it should not be hard to add some kind of solution in the front-end, that parses out any kind of "wrapper-syntax", and formats the code. Didn't think about that ... tend to forget how powerful this aspect of pw is, and how it opens up new approaches to how to solve these problems
  15. I'm using processwire to power my (mostly) coding blog, and have had problem finding a stable solution for including code snippets from various langauges, to display them with proper formatting and syntax highlighting etc. I finally ended up just embedding gists (gist.github.com) since it was the only thing that would not mess up totally with the HTML on the page, etc, but that is some extra work, creating a new gist for every little code snippet you want to show. So, I was wondering what other use for this purpose, and what seems to be the best solution right now?
  16. Awesome, thanks! Seems I have been unneccessarily scared to touch this jquery stuff myself - your example seems simple enough For the reference, I also in fact found a a very simple, light-weight and good-looking (smoothproducts, demo) just a while after posting my question, but I like the ability to be able to roll an own and be in full control, so I'll experiment with both a bit and see which works best. Cheers
  17. Hi, I have been googling around like crazy to find a suitable very light-weight javascript library for showing a simple image gallery with one bigger main picture (just on the page, not in a lightbox), with clickable thumbnails that will show the selected image in a bigger version in the main image area when clicked. See the attached screenshot for an example! Most libraries out there seem to focus on fancy transitions, lightbox style image viewing, or don't include the thumbnail feature (just showing these dots, for selecting pictures) ... and so I haven't so far found what I'm looking for. Any hints? (Again, preferrably something super-lightweight, that is super-easy to integrate with pw).
  18. saml

    Codesense

    Getting processwire autocompletion in the top PHP IDE PHPStorm would be killer. In the meantime, I just realized how much more useful the ProcessWire Cheatsheet is, when using the search feature more. Inspired by the awesome devdocs, I tried searching with "$page-> [Enter]", "$files-> [Enter]" etc, and found out how much faster I find results. Maybe the search box should be more prominently placed in the cheatsheet, and be named something like "filter" rather than "search" to highlight how it works? (I don't tend to like to get thrown away to another search page to find stuff, but love when I can filter the stuff in the current view).
  19. Thanks! I'll have to go through all the text more carefully ...
  20. Thanks, very nice links! I liked especially the first one, with the css syntax support - Always good to avoid re-inventing the wheel in terms of syntax Would be interesting to see how much of a performance hit there is to the regex parsing involved ... though hopefully that's not anything major. Personally I would probably have "shortcut" functions on the form of a( ), li( ) anyway, which would pass on to any underlying library api. Will keep these links in mind as I continue playing with this.
  21. Well, thinking about this now, there is the problem that it is not exactly clear as to what to link, when embedding the functions in each other like this. E.g. one might want either to link directly to the image url, or to the image page, or something else, for each image. It seems to me that the most general way to handle this, is to create a specialized map function for processwire PageArrays, which can be used with an anonymous function, like this: echo ul( pagearray_map( function ( $p ) { return li( a( $p->url, $p->title ) ); }, $page->children )); ... this might be a little clearer if storing the anonymous function in a named variable, like so: $func = function ( $p ) { return li( a( $p->url, $p->title ) ); }; echo ul( pagearray_map( $func, $page->children )); But well ... things are getting slightly more involved now of course, though I think it is still manageable. Gotta chew on that
  22. Thanks! Indeed, with a little bit of type checking one should be able to do like this as well! ... and this is going towards where I was hoping to get in the end as well. I should probably give it another try and try to make it shorter, like you propose!
  23. Many thanks for the link, that is indeed useful code to study! Will have a look and see what ideas I can incorporate in my own collection too
×
×
  • Create New...