-
Posts
4,046 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Role to save only the fields with custom string in their name?
Pete replied to seddass's topic in General Support
I think a better way would be to write a module that hooks into the template itself and simply makes all the fields that aren't in their language hidden, then hide the surrounding DIV so the label and input fields don't show. Of course, I'm not sure how to do that -
This one's for ryan, but obviously open for discussion to all. Whilst porting a reasonably large site over to PW I noticed that the ampersand character (&) gets stripped out when a URL is automatically created from a page title. Is there any chance this could be automatically converted to the word "and" instead? Sure it's not amazingly important, but it allows for more legible URLs.
-
Wow. There's the majority of the need for Flash/Java uploaders gone for good On sites where I'd be creating forms for other admins to use on one of my sites I would probably speciify that they have to update their browsers to use the CMS. It will obviously be a few years before the majority of folks have updated to a HTML5-compatible browser however I'm looking forward to using some of these features down the line to make life easier. In fact, I'm sure I saw a jQuery-based upload script a few weeks back (before my laptop died ) that used HTML5, fell back to Flash if your browser didn't support it and fell back to doing things the old-fashioned way if you didn't have either. That one was just for uploads, but one that was just HTML5 that might be good for getting ideas from is mentioned previously here: http://processwire.com/talk/index.php/topic,351.0.html
-
Okay, I've updated the module in the first post to v1.0.1 - it now allows you to choose a page to redirect to. If you don't choose a page to redirect to, it defaults back to the login page. I'll likely make more changes over time however this makes it much more useful for now EDIT: Just a quick note - you can unselect a page to make it fall back to the login page, however you have to navigate to the page in the tree and click the "unselect" option - this seems to be the default way PageListSelect operates. ryan - is there any quick way for me to add an "unselect" link next to the "select" link at the top of the page tree? I'll also probably be trying to open the tree automatically to the right page if one is selected, but for now it's fine.
-
I've nearly finished a version with the last suggestion you listed - a choosable page. Will upload it soon! Other options will probably follow, however this is probably the more useful setting for now.
-
Awesome We don't have that beer in the UK (that I know of) hence I've not seen those ads before.
-
Maybe add it before render?
-
Cool. Like the fact you've branded up the beer bottles as well. What was this image originally from?
-
Nice work It would be good if they were collapsible too
-
Could just have a little (i) for Info icon when you click on a title and stick it at the end of the links, then have a jQuery hover thingy with those details in I guess. Just so it's there if you really want it. I would say that it should be a module though and not by default.
-
Ditto to everything Soma just said Let's put it this way, I'm even building a website with the wife now and she's happily been building page templates in PW and loving how easy it is. She's very IT-literate, but hasn't done too much with websites or web applications before, so it's still a testament to the the intuitiveness of the software that after only a 5 minute crash course on what things do from me she's picked it up already.
-
Cheers guys! Congrats on your release too apeisa - you'rs is a bit bigger, but who's measuring!
-
This is a little module that allows you to put your site into maintenance mode should you ever wish to. It basically checks to see if you're a superuser and if you're not then every page on the site which you try and load will send you to the login page with an appropriate maintenance message. The styles are hardcoded into the module at present, so changing the default style of the front-end EDIT button could well have a knock-on effect. Ideas for the future: I was also thinking about expanding this in future to allow chooseable roles in the configuration that can access the site whilst it's in maintenance mode, as well as adding the messages to the config so they can be translated. It might also be nice to specify another page to send the user to so that if you want to keep your admin login page hidden you can do. Thanks to adamkiss whose ListAfterSave module this was written over the top of Thanks to ryan for solving the last piece of the puzzle and helping me display the message in the top-left of every page. EDIT: And my particular usage scenario is that I'm building a site on a live server. It's a brand new site so nobody would really know the URL so I thought I'd build it in the root of the site rather than a subfolder and this module lets me do that without letting folks see it until it's finished. Other usage scenarios could include major template file updates or... whatever else you think it might be good for You can fined the module in the directory here: http://modules.processwire.com/modules/maintenance-mode/ v1.0.6 adds ability to bypass maintenance mode for certain user roles.
-
Thanks - that works now I'll upload the module once I've polished it up a bit. EDIT: Module uploaded: http://processwire.com/talk/index.php/topic,431.msg2929.html#new
-
Hmm, nope, that didn't work either unfortunately.
-
Hmm... can't seem to get it to work though. The rest of my module works except this bit with the message. Here's the line for that hook: $this->session->addHookAfter('Page::loaded', $this, 'maintenanceMessage'); And here's the function (stripped out any additional checking so it should display the message no matter what's going on elsewhere in the module): public function maintenanceMessage(HookEvent $event){ $out = $event->return; $code = '<p>Site in maintenance mode</p>'; $out = preg_replace('/(<body[^>]*>)/i', '$1' . $code, $out); }
-
Comes back empty, fortunately. Handy snippet of code though just for checking things like that
-
Thanks ryan - just two things: addPageAfter <- I didn't get that bit - do you mean addHookAfter? Also, I'm trying to display the message in both the admin and live side of things. My thinking was that sometimes if you're logged in as an admin and you're previewing changes to pages on your site there's the possibility you could forget it's in maintenance mode, so a message in both places would be good. For that reason I'd probably go with your first suggestion in this case as both the admin and page templates are likely to have <body> tags (though I realise I'll have to do some extra regexp in case anyone's modified the body tag in a template file).
-
I'm creating a "maintenance mode" module and the somewhat-basic version 1 is almost complete. What I'm trying to do now is display a message for logged-in superusers that the site is in maintenance mode and add it to the top of the page. This will appear on all pages in the admin and front-end. What I would like to know is if there is any way to add code just after the opening body tag? I would assume that since every template is different, what I would need to do is do some sort of regexp to find the opening body tag and slot my code in just after it. Any ideas how I can access the page output before it gets outputted? My module is hooking into Page::render like so: $this->session->addHookBefore('Page::render', $this, 'maintenanceCheck');
-
Cheers ryan, bizarrely it was still doing it this morning before using the updated code so my test server on my laptop had been restarted. Once I updated the code to the version you updated the issue went away. Very strange, but fixed now
-
Module: Languages (multi language content management)
Pete replied to Oliver's topic in Modules/Plugins
If I'm understanding you right, you could create a template called "language_root" and set it's "Allowed template(s) for parents" status to "Home" (or whatever the template of the homepage is on your particular site). That setting is under the Family tab when editing a template anyway. Whilst it doesn't prevent someone from reordering the pages at that level, I think that would lock those pages in place though I've not actually tested it. -
Hmm, that's weird as all I was doing was clicking on New from the admin homepage to create a new page. I'll try the updated code thus morning.
-
I just downloaded the very latest build as I hadn't done in a while and I'm getting an error message when adding new pages - it says "Unexpected input". I switched developer mode on and here's the full output: TemplateFile: Unexpected input #0 C:\xampp\htdocs\sc11\wire\modules\Process\ProcessPageAdd\ProcessPageAdd.module(80): ProcessPageAdd->processInput(Object(InputfieldForm)) #1 [internal function]: ProcessPageAdd->___execute() #2 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array) #3 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('execute', Array) #4 C:\xampp\htdocs\sc11\wire\core\ProcessController.php(194): Wire->__call('execute', Array) #5 C:\xampp\htdocs\sc11\wire\core\ProcessController.php(194): ProcessPageAdd->execute() #6 [internal function]: ProcessController->___execute() #7 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array) #8 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('execute', Array) #9 C:\xampp\htdocs\sc11\wire\core\admin.php(42): Wire->__call('execute', Array) #10 C:\xampp\htdocs\sc11\wire\core\admin.php(42): ProcessController->execute() #11 C:\xampp\htdocs\sc11\site\templates-admin\controller.php(13): require('C:\xampp\htdocs...') #12 C:\xampp\htdocs\sc11\site\templates\admin.php(13): require('C:\xampp\htdocs...') #13 C:\xampp\htdocs\sc11\wire\core\TemplateFile.php(88): require('C:\xampp\htdocs...') #14 [internal function]: TemplateFile->___render() #15 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array) #16 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('render', Array) #17 C:\xampp\htdocs\sc11\wire\modules\PageRender.module(194): Wire->__call('render', Array) #18 C:\xampp\htdocs\sc11\wire\modules\PageRender.module(194): TemplateFile->render() #19 [internal function]: PageRender->___renderPage(Object(HookEvent)) #20 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array) #21 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('renderPage', Array) #22 C:\xampp\htdocs\sc11\wire\core\Wire.php(289): Wire->__call('renderPage', Array) #23 C:\xampp\htdocs\sc11\wire\core\Wire.php(289): PageRender->renderPage(Object(HookEvent)) #24 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('render', Array) #25 C:\xampp\htdocs\sc11\wire\modules\Process\ProcessPageView.module(73): Wire->__call('render', Array) #26 C:\xampp\htdocs\sc11\wire\modules\Process\ProcessPageView.module(73): Page->render() #27 [internal function]: ProcessPageView->___execute() #28 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array) #29 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('execute', Array) #30 C:\xampp\htdocs\sc11\index.php(170): Wire->__call('execute', Array) #31 C:\xampp\htdocs\sc11\index.php(170): ProcessPageView->execute() #32 {main} Any ideas?