Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. /** * Admin template just loads the admin application controller, * and admin is just an application built on top of ProcessWire. * * This demonstrates how you can use ProcessWire as a front-end to another application. * * Leave this file as-is, do not remove. * */ require($config->paths->adminTemplates . 'controller.php'); This is in site/templates/admin.php Do not remove, doesn't mean you can add code there. It's a easy way to add admin only auto hooks without creating a autoload module.
  2. No need to use blank profile, the default profile hasn't anything that much you couldn't use and it's a perfect start. A 500 server error could be anything from .htaccess to I don't know
  3. There's no html in the blank profile obviously https://github.com/somatonic/ProcesswireBlankInstall/tree/master/templates
  4. Yes right, of course the Pageimages is a WireArray, and it looks like you can import Pageimage (but I'd rather say add()), and considering we're dealing with Pageimage here already taken from pages it would work as the page context is already present. But I still think you need also a page you associate the Pageimages() as with Pagefiles() requires a Page in the construct, so maybe adding a empty page would work on the fly. But yeah ImagesManager is better.
  5. If you take it now. You'll get two stock free images and a T-Shirt for free!
  6. Edit. Pageimages also doesnt support pagination.. only pagearrays.
  7. It could work but Pageimages requires a page context. Also with this technic you load all images on every request just to display a couple which doesnt scale so nice. Using ImagesManager would solve those issues and give more flexibility. /advertising
  8. Im not sure you can import images to pagearray just saying.
  9. You could use my ImagesManager module which is made for use cases like a photo portfolio. Every image is created as a page and each gallery would be a category. It would be a childs play to setup pagination and searching. Plus you can have as much meta data added as you like and all is searchable same as with using pages.
  10. Soma

    Hanna Code

    Not sure what you mean with highlighting. In TinyMCE code? There's already CodeMirror included just not installed for TinyMCE by default so you have to enable it. https://github.com/ryancramerdesign/ProcessWire/tree/master/wire/modules/Inputfield/InputfieldTinyMCE/tinymce-3.5.8/plugins/codemagic
  11. Did you use Profile Exporter? Because I thought it was once it won't export or create session folder. Also it doesn't export users. So to transfer a site I always use simple DB->DB dumb and files over FTP and done, and I recommend not use Profile exporter. Profile exporter is more for creating profiles to install with a new install, originally built explicit for upgrade from 2.1 to 2.2.
  12. Lol kongondo, of course it works! Don't worry it happend a lot for myself. Since then I just try to double check and test throughout first before posting and you'll get better at time goes on.
  13. The modules directory on modules.processwire.com also has a PW compatible version info added. Since this is an official directory, I urge every modules developer to update their modules with that info (and first test your module in 2.2 2.3 etc.) Since there's a new option added for each PW version, this has to be done by the module developer. There's people browsing this directory and don't know that this info is not up to date for most modules and think it's not compatible with 2.3! Thanks for your time! Soma
  14. Soma

    Hit 1000+ likes

    I've hit the 2000 mark! Thanks guys!
  15. Ok, weird. Since this was an older 2.3 install, I had to change my password. It looks like after that update, the session modules weren't listed anymore... hmm I then did a "Check for new Modules", and it logged me out. After loggin in again it was all there suddenly. It seems it was the modules cache, since "Check for new Modules" clears cache. Pitty.
  16. I'm maybe going crazy, but on a install I'm working on since long time I have updated to latest dev. Now I have an empty "Session" on the setup menu. Missing process... Wasn't there a core module once for sessions? I can't find any Session modules. Also I'm looking for the Login Throttle module and can't find it anymore. What happened?
  17. Maybe the example just isn't a very good one, as you don't know ahead if the repeater have any unchecked checkbox. $pa = $pages->find("template=basic-page, slides.count>0, slides.disable_slides=0"); foreach ($pa as $p) { foreach($p->slides->find('disable_slides=0') as $r) { echo "<p>$r->title</p>"; } } Should also work, not to loop pages that have no repeater that meet the criteria for nothing.
  18. The term "selector" is the string you define to search, like in CSS or jQuery .someclass{} or $('.someclass') and not the result or the method "find()". I've read in some threads and now here (kongondo) (other than nesting the first selector inside the first foreach) and it can be confusing. Ok, find is your friend! Approaching it this way, with finding all pages with the repeaters, then loop all is all correct and required in this case, but seems like not so efficient to loop all repeaters just to find the not checked ones? Why not just use the wonderful search functions to get the repeaters not checked and then loop them? $pa = $pages->find("template=basic-page, slides.count>0"); foreach ($pa as $p) { foreach($p->slides->find('disable_slides=0') as $r) { echo "<p>$r->title</p>"; } }
  19. This works as with your example, there's nothing wrong with it except that you need to add include=all: search and return all repeaters "slides" pages (internally have template "repeater_slides") with disable_slide not checked $slides = $pages->find("template=repeater_slides, disable_slide=0, include=all"); And it returns a PageArray So you can loop them out or whatever. foreach($slides as $slide) echo $slide->title; If you want to only get the repeaters from the page you're on this is almost same: $slides = $page->slides->find("disable_slide=0");
  20. I just made another update to replace the fields settings with a AsmMultipleSelect for convenience. If you update, you want to select the textarea fields you want to use IM on. You also have to save the module setting at least once to make it work. And maybe reinstall the module to get rid of unnused settings, but not necessary.
  21. It is working fine, make sure you updated the module with all its files correctly. The setting in the ModulesManager you talk about is now called: Textarea fields you want to use the ImagesManager. A button will appear above those fields. Add one or more fields separated by a pipe body|sidebar.
  22. $pages->find('created<=yesterday')->first()-> parent()
  23. I'm not sure the best way to check for multiple, it depends a lot on the fieldtype. It may differs from type to type. In case of a page field. You could try checking for the settings derefAsPage if($inputfield->derefAsPage == 0) { //... multiple } Or maybe... if($inputfield->value instanceof PageArray) { // .. multiple } Or simply by checking if the post value is an array. I'm not sure what the "PW way" means here. There's not so much the PW way, if it works... I personally would say yes, but being picky I wouldn't do it that way to begin with. But if it works out for you. To populate the fields again after submit, you just would add the value from the post to the inputfield before rendering. $field = $fields->get("$field_name"); $field->attr("value", $input->post->$field_name); echo $field->render(); // will have the value set Or you could use the processInput() of the inputfields to process and populate it. This is what PW uses to process fields. It doesn't matter what field type. $field = $fields->get("$field_name"); $field->processInput($input->post); // process field echo $field->render(); // will have the value set
  24. If you can give me access to the installation, I can take a look.
  25. Thanks enibas94 for the feedback and using my module. There's a permission for the module "images-manager". You can create a new permission with that name and give it to roles that should see ImagesManager page. There's currently no permission or access handling for the button added to all textarea fields. The "Textfields used for searching images on pages" is originally meant for the module to search for if there's images in the text. But kinda would be the same fields as where to add the ImagesManager button. So while already there, I changed the config to say "Textarea fields you want to use the ImagesManager on." So it is now used to define what textarea fields you want to use ImagesManager. This is now working for editor users. As for your error. Error message: Class 'PageImage' not found (line 526 of /../site/modules/ImagesManager/ImagesManager.module) Not sure but since the class name is "Pageimage" I guess it has to do with PHP version, because it works for me, but maybe the capital "I" in PageImage is making it not find the class on your environment. I changed it to "Pageimage" and committed an update. Can you let us know if it's working for you now?
×
×
  • Create New...