Jump to content

Pete

Administrators
  • Posts

    4,054
  • Joined

  • Last visited

  • Days Won

    67

Everything posted by Pete

  1. ryan's inbox? Probably daily
  2. Cheers all! My code now looks like this and works perfectly: $template = $templates->get('your-details'); foreach ($template->fields as $field) { echo "<label for='$field->name'>" . $template->fieldgroup->getField($field, true)->label . "</label>"; ... EDIT: Which I see is the same as what Adrian posted above - it's nice when you come to the same conclusion separately sometimes though as you know it's definitely correct that way
  3. @Martijn - there is no page. I'm just getting a blank template and echoing fields for a frontend form so the form doesn't relate to a page. The form fields do relate to the template they came from though so it looks like it should work. @kongondo - none of that seems to apply in this situation. I did try a few things from that page but they didn't work. Part of the problem is probably that the page I'm outputting this on doesn't have the same template as the fields I'm outputting in my code, but it looks like it should work anyway. Keep the suggestions coming though
  4. Hi folks I'm just playing with a form in a frontend template that pulls fields from a backend template and outputs them as form fields on the frontend (all will become clear soon ). Unfortunately, the template-specific versions of the field labels won't display - it just reverts to the default. Any ideas? This is what I'm doing in my frontend template: foreach ($templates->get('your-details')->fields as $field) { echo "<label for='$field->name'>$field->label</label>"; $inputfield = $field->getInputfield($page); echo $inputfield->render(); } The default label for the field "fullname" is "Full Name" and on this specific template in the admin it's "Your Name", but using the code above it outputs "Full Name" despite the template-specific label. I also tried doing this before the code above: $newpage = new Page(); $newpage->template = 'your-details'; ... $inputfield = $field->getInputfield($newpage); but that didn't work either. I suspect the answer is something simple as usual
  5. Ha, yes, but when it was a case of copying it to template/admin-template or wherever int eh old days it was easy to just go about changing colours. Now I feel like I just want to add another colour scheme to the new admin theme but I'm confused as to how I would go about it.
  6. Now the new default admin theme is a module, how would I go about creating another colour scheme for it? Is there a way to extend it and if so how would I do that?
  7. Actually, scratch that. Since what I'm doing can have multiple software tagged to it (it's a knowledgebase system where some articles can overlap different packages) there is no quick and easy way to achieve this anyway. Not to worry - new versions don't come out very often anyway.
  8. I've got a Pages field that I've set to allow new entries whilst editing a page. What I want to do is intercept the page save for the added content if possible and set another field on that page based on something in the main page. So to make that clearer (yes please) I have a page with fields for: Software name Software category Software version Software version is my Page field and I want the ability to add new ones on-the-fly, so I set this field to Pages and allow new pages to be added. The software version template itself has a Page field that links it to software name, so when the page above is saved, I want to intercept the software version page creation and link it back to software name. Any ideas? I know it will be possible somehow, but I've not heard of anyone trying this before.
  9. I've merged the pull request - thanks
  10. The problem was the more I thought about it from a technical point of view trying to get everything as a single page, the more headaches it gave me. Plus I'd likely prefer having the text box be a minimal CKEditor as well
  11. For use cases I'm thinking of right now, I think images, text and videos would be enough for now. If you have a module that allows you to tie these to fields in a specific template, then when you create a new page replace the normal editor with Sir Trevor, you could have it use the native fields and store the parsed content in a hidden body field. So your images go in a multiple images field, your video URLs in a custom field (repeaters don't scale infinitely) and text some other way and the whole thing is parsed into a body field ready to render.
  12. I forgot to mention as I saw it asked earlier in this thread, I've had bad experience with DROBO (so bad I can't remember what went wrong now!). QNAP is a fairly good solution - problem is it has fallen over when I've used one at the point it got full. No warning, just RAID failure. The flavour of the year for me in NAS backup is Synology - lovely interface, easy to set up. You can run a webserver on it so you could have a script on your sites perform backups to compressed files then have this box just go and fetch the files via FTP in a PHP script. Leave it in a cupboard and you're sorted You could of course do the same thing via your PC/Mac I imagine after they boot every day, but there's something nice about being able to set something like this up and just leave it going. They power down the disks when not in use so are reasonably power-efficient, and if you get a 2-bay model in RAID you're covered from data loss. Put one in your house or a relative's house as well and you're doubly covered.
  13. Try if(!$input->post->{$feature->name})
  14. I'm on a custom built PC that I just set to automatic overclocking to see what it did. It boots up into Windows 8.1 in about 6-7 seconds from a cold start which is nice Core i7 processor @ 3.5ghz (boosts up to 4ghz on occasion), 16GB RAM, 250GB SSD, ASUS GTX 660 OC graphics card (for games, in case the spec wasn't already spelling that out!) and a REALLY quiet Fractal Design R3 case (it's really heavy as it's lined with what appears to be dense, 5mm rubbery material that absorbs the sound you usually get from a base unit). I like it because it's fast and quiet and cost me ~£1,000 (even less nowadays if I stuck to the same spec). Strangely, I spend less on monitors. I see expensive monitors in use all the time but since I don't get any eye strain on my 24" Samsung that was pretty entry-level a few years back I don't see the need in upgrading. I spend more on keyboards and mice though. I find these really comfortable to use and with the amount of time I spend using them I don't mind spending the extra on them: http://www.logitech.com/en-gb/product/illuminated-keyboard-k740?crid=26 http://www.logitech.com/en-gb/product/performance-mouse-mx?crid=7 I suspect ryan would dislike this keyboard as it's a bit too modern
  15. Adrian - I had the same thing when scrolling too fast one one of the entries in Firefox on Windows - it decided to slide back to the start for some reason. Other than that, great site and unique look - certainly not straining my eyes reading it
  16. 16 minutes - you were 1 minute over my guess as to how long it would take you to save the day Thanks Soma!
  17. Hi guys I'm sure I'm missing something really simple, but I'm trying to write a module that intercepts the page being edited and works out the template and other information for that page. I hook it in the module like this: $this->pages->addHookBefore('ProcessPageEdit::execute', $this, 'something); But then I'm not sure how to access what the page's template is. If I do the following then it gives me information about the ProcessPageEdit form and not the page being edited: $page = $event->object; I'm sure I've run into this before and resolved it before but I just can't find or remember the code.
  18. I did the same thing at the weekend
  19. I like warm. Feels all... warm Could just be an easy installation choice I think.
  20. You mean you're literally not clicking anything - as in it's automatic whether you touch your keyboard and mouse or not? Or is it just when you click to another page? Have you upgraded your installation or installed any modules on the site between the time it was working fine to now? I'm just trying to rule out a few things.
  21. No, that's normal. Read ryan's post about it here: http://processwire.com/talk/topic/2387-the-structure-of-fields-and-templates/?p=22762 Basically, since any field can be used in multiple templates, you can't simply have a table for each template with the PW fields as mySQL table fields. Plus, several of the more advanced ProcessWire fields have multiple fields of their own in their table in phpMyAdmin (in fact I think most/all have more than one). Therefore any other way of storing them in the database simply wouldn't work as well and would presumably be a nightmare to program for.
  22. Or that Soma, yes
  23. If your admin is located at /processwire/ it looks like the easiest thing to do is edit your .htaccess file and add this solution to it after RewriteEngine On: http://stackoverflow.com/questions/9642877/redirect-only-one-folder-to-https-all-others-to-http Remember to leave the RewriteEngine On line off the example (don't want it in the .htaccess file twice) and change secure to processwire from the example. Should work but I've not tested it.
  24. Does it have to just be the backend? I don't think there's any harm in setting the whole site to SSL if you want to be on the safe side.
×
×
  • Create New...