Jump to content

Pete

Administrators
  • Posts

    4,054
  • Joined

  • Last visited

  • Days Won

    67

Everything posted by Pete

  1. Sweet, thanks Tom, looking forward to it
  2. I'll have to get my Reno colour schemes sorted on Sunday when I'm back off holiday. Tom - can you send me a copy of the theme when you send it to Ryan so I can make sure they're 100% compatible before the updated theme is released - shouldn't take me long.
  3. I was going to say same as Martin - unpublish them in the page tree would be easiest. A quick module could add similar functionality to the normal user profile page for superusers maybe as I don't think you can do it there (can't check quickly as on mobile).
  4. Just to clarify, AJAX in any CMS requires JavaScript. It cannot be done purely on the server side (PHP) as you have to get a request from the client side (your web browser) to tell the server what you want and listen for the response. Any plugins or modules you have seen in other systems must also use JavaScript if they are doing AJAX - indeed the J in AJAX stands for JavaScript.
  5. And here's some code for those that may need it: $myfieldset_start = false; foreach ($page->template->fields as $field) { // or something like $this->templates->get('templatename')->fields if ($field->name == 'myfield') { // opening element of a fieldset is just the field name you gave it $myfieldset_start = true; } elseif ($field->name == 'myfield_END') { // ending element is field name with _END on it - break out of the loop if we reach this break; } elseif ($myfieldset_start == 'true') { // otherwise we are iterating fields in the chosen fieldset so do what you like here echo $field . "<br>"; } }
  6. That would do it diogo - I hadn't thought of the simple answer! I had been looking for some magic function thinking there was some relationship stored between the fieldset and the fields inside it forgetting it's a purely visual thing.
  7. Hi folks I'm trying to fetch and iterate through fields in a specific fieldset in a page via the API but for some reason my brain cells are failing to work as a team tonight. Any suggestions?
  8. @mr-fan - Please feel free to add it there as I need to sleep now, mega-busy tomorrow and will be away for a week from Saturday - glad I could help @tpr - if you're viewing the first item, the link for Next will show to take you to the second item. I think maybe what you mean though is when viewing the first item should there be a "previous" link to the last item for consistency? I may be completely misunderstanding your question of course.
  9. @ryan - could also easily tie it in with forum user logins to prevent someone skewing the results. @apeisa - but $24 whole dollars? That's like... 4 pints of beer Seriously, that does look cool but maybe slight overkill? I guess it's down to whether Ryan has time to code a PW solution. We could also probably do a small part of what huboard does and hook into the Github API if we wanted to go that far with it - pull in a list of issues, convert them to requests locally on the PW system and have it close them out on Github with a link to relevant item on the PW wishlist perhaps? Or that could be done easily manually too, but if there are a lot of feature requests, clicking a button that does it all for you might not be a bad idea. Lots of options, it's just down to time and effort. The forum user login code for the dev directory is pretty simple and more or less ready to re-use for something like this too if required.
  10. You might also, depending on your scenario, want to change the "else" in my scenario to check for other pages at the same level as this page and not show any links if there are no other pages, so I think this would work for that scenario: if ($page->next) { // show the next link - $page->next; } elseif ($page->siblings) { // show the link to the first again - $page->siblings->first(); } Or for something that reads a little more clearly but does the same: if ($page->siblings) { // Only bother with next/back-to-first links if this page isn't all on its own if ($page->next) { // show the next link - $page->next; } else { // show the link to the first again - $page->siblings->first(); } }
  11. Try $page == $page->parent->children->last(). EDIT: Gah, there's a way to do it with siblings() where it includes the current page in the siblings() PageArray but the correct code eludes me and I suspect diogo will beat me to it Oooh, you could do if ($page->next) { // show the next link - $page->next; } else { // show the link to the first again - $page->siblings->first(); } I think.
  12. As tsd says, $page->rootParent, assuming it's always the "section" and not the "sub-section" you want. So for the current page, to return the root (root = as far up the tree before hitting the homepage) parent's template you would do: <?php echo $page->rootParent->template; ?> I think if you wanted the subcategory template in your example and the tree could run to any depth, you could do this: <?php echo $page->parentsUntil('id=' . $page->rootParent->id)->last()->template;?> The docs for parentsUntil suggest it will return every parent until the condition is met, so we only want the last one in your case, so hence the usage of last() there. Funny avatar pic by the way
  13. Yours should be approved now so you can make further edits as required. I've changed the text after a submission from "within 24-48 hours we will review your profile" to "7 days" though I'm aware some have been sitting there longer - I'll work on that so people don't have to wait as long in future, but also so I'm giving myself a more reasonable timescale.
  14. I need to catch up on the backlog - will check yours out shortly.
  15. Just tested and with the latest change you made it works perfectly - thanks!
  16. Submitted a PR to add CC and BCC support. Needs testing because I'm in a hurry until this evening but I don't see why it wouldn't
  17. Thanks horst - saw your updates on Github so will have a look tonight
  18. @horst - just in case you missed it: https://github.com/horst-n/WireMailSmtp/issues/3
  19. Indeed - it depends what you are trying to build - I made the assumption it would be something to do with web data.
  20. Hi there Are you implementing this search inside a funciton or in the admin? If either of those is the case, try wire('input') and wire('sanitizer'), wire('pages') etc. If you're writing the code inside a module you can also use $this->input and $this->sanitizer If neither of those is the case, could you post the full code that you've got for the search page please?
  21. For comments, this thread is useful: https://processwire.com/talk/topic/7145-is-it-possible-to-add-a-comment-programmatically/ Since you're importing pages AND comments for those pages you will probably have created the new page further up in your code and saved it already. You seem to have found all the relevant topics (well, now with the one I linked to) but if you don't know much PHP this may seem a daunting task - we're here if you have any questions though. The main things you need to learn are how your data is stored in Drupal - getting it out is probably the hardest part, putting it into ProcessWire will be easier I think and also will be an excellent learning experience in terms of the functionality in the API. My solution for managing articles is pretty similar to Ryan's. His is more suited to your needs though I think. Once you get your data imported, you'll know enough about the API that you can create custom admin pages such as dashboards showing articles pending approval etc - that sort of thing is really easy in ProcessWire so you're limited only by how fast you can learn and your imagination I'm not sure if anyone else has done a Drupal conversion recently who could help you further, but I could take a look later next week if you were willing to supply a copy of the site? It's hard to go into much more detail without seeing exactly how things are set up in the DB etc.
  22. Ratchet and Phonegap sound like they would play togther nicely. I always wanted a way to have the mobile web app look native and Ratchet looks ideal for that. All Phonegap adds is the ability to wrap it into an app and gives you access to some of the device APIs too (camera, contacts etc) whether iOS or Android, so I'm sure together they would be able to load the correct stylesheet for the correct device.
  23. You should be able to get users out and imported as ProcessWire Users (essentially pages themselves) and the comments - there's a PW comments module so I'm reasonably sure there would be a way to import those too. The big issue you will have is that most CMS' use different methods of encrypting their passwords, which is not a bad thing. What it does mean is that if you successfully convert your site you will probably need to get everyone to generate a new password somehow, or add a little extra code in the login routine to check the old database when someone logs in and, if it's a match, update it against the PW user (easier than it sounds, but a little coding required). That's all possible, but probably the least of your worries as well Is there any chance you can link to your current site? It would help to see visually what might pose a problem and suggest the best ways of going about certain things. Also if you could describe the current workflow for authors that would be helpful - presumably they can only create and edit their own articles, but does someone approve them or are they simply posted by the author live to the site?
  24. I don't know much about this area of development, but I will mention PhoneGap whilst I'm here. The very basic tinkering I've done with that felt great because it was essentially a case of developing in HTML and JS to achieve basic mobile apps. Almost certainly not as efficient as other methods, but it depends what you want to do. For me it was to try and capture mobile phone camera data and send it to a server (and if I ever get back to working with it, capturing barcode input from barcode-enabled Android devices for warehousing purposes) so PhoneGap was ideal for that sort of thing. It was also a massive pain in the ass to get installed and running which I really didn't enjoy though
  25. Hi there Is JSON definitely installed on your server? Also, have you tried again since yesterday (just in case of a connection issue a the time)?
×
×
  • Create New...