Jump to content

chrizz

Members
  • Posts

    125
  • Joined

  • Last visited

Everything posted by chrizz

  1. damn... I totally missed this topic but it looks like as if nothing happened so far Any further plans for a meetup? Currently "regular" might be a tricky thing for me but let's have a beer anyways ...
  2. Hey everyone, I just entered the next stage of PW: multi language sites Thanks to all who contributed to make this so(!) easy(!) with PW. In many cases I found answers for every question so far, but one little piece is still missing: In a template I want to access all translations from the description of an image. Whichever way I looked at it I only get the current translation which is selected for the user. Turn off output formatting and trying to access this via $page->myimage->first()->description_english did not work... :/ I am pretty sure that someone will have an answer for this. I really appreciate this Thanks guys & cheers, Chris
  3. Hi Peter, thanks for reminding me Unfortunateley there are no updates at all... Since I am running Evolution sites this script is build for evo and not for revolution. I just looked at the script and I think it needs a total rework. It's more like a proof of concept than a useful script... :/
  4. maybe a dumb question, but: where do I find these 2 modules? Couldn't find them in the Modules section (ProcessWire 2.5.22 dev )
  5. I just moved another site to PW and I am currently in the process of testing it on a staging environment (in debug mode). The website is hosted on a shared webspace with limited access. This is why I get an error like this once I logged out: Warning: chmod() [function.chmod]: Operation not permitted in /www/htdocs/customersite/stage/wire/core/Functions.php on line 298 My questions about this: why PW tries to change permissions? Thanks and happy eastern everyone!
  6. is it possible that this is an encoding error? Which sitemap module do you use? This one? https://processwire.com/talk/topic/799-module-xml-sitemap/ What happens if you place a die('test'); in the renderSitemap method? Is a whitespace included as well? Anything in the error.log perhaps? My approach would be: Die() whereever you can and try to isolate the problem. good luck!
  7. Hello everyone, following setup I have in my old MODx backend: Folder1Page1 Page2 Page3 Folder2Page1 Page2 Page3 Folder3Page1 Page2 Page3 Folder1 is the defined home page which is reachable under www.domain.com/ Page1 to 3 in Folder1 have a URL like this www.domain.com/folder1/page1 www.domain.com/folder1/page2 www.domain.com/folder1/page3 The other folders & pages are reachable like this www.domain.com/folder2/page1 In PW folder2 and 3 will be children of "home" instead of being neighbors like in MODx. To keep my URL structure I'd like to know what the best approach will be... unfortunately at the moment I have no clue... :/ thanks a lot!
  8. I have had this issue long time ago with a XAMPP installation on Windows. I have no idea if this will help in your specific case, but perhaps you'll give it a try. Change in the config.php the following lines I figured out that resolving "localhost" on my Windows machine took about 2-3 seconds for each request. Don't know why, but using the IP instead fixed this issue.
  9. I just tried to get this on the road, but unfortunately it seems as if I am stil searching for the forrest. I have a process assinged to my customer manager page. This process uses the permission 'manage-events' as adrian mentioned before in the getModuleInfo I have a role (called editor) which has the manage-events right. If I login with a testuser (roles: guest, editor) I only see the "Pages" entry but not my custom page. Do I have to clear the caches anywhere? // EDIT Note to myself: You should not mix permission and permissions Btw: is there a way to reset the permissions without reinstalling a module?
  10. full ack! Adrian is an answer bot! Thanks for clarifying. Sometimes its hard to see the forrest for the trees Thanks!
  11. Hey Adrian, thanks four your reply. For sure I can share the migration script! I'm working on a project right now where I have to deal with much more files and images so I think sooner or later my script will take care of files and add them to the regular PW files folder. At the moment I am quite busy so that it'll be impossible for me to adapt my script for your Migrator module. But as soon as I am working on my migrator script again I definitivly will take a look at yours and I'll check if there's a way to connect both - or just improve mine If you want to I can share my status quo Cheers
  12. Hi everyone, I have searched a lot but unfortunately I didn't find anything on this use case: I have created a custom page within the admin section. The page's template is admin. Now I want to give access to editors to access this page - but this access is controlled by the admin template. What is the best approach to give access to a custom admin page without making the user a superuser/admin? Any help is appreciated!
  13. I just migrated three of my projects from MODx Evolution to Processwire. The sites itself are not that spectacular but I am a little bit proud that writing a migration script with PW is so damn easy! So I just wanted to share some thoughts how I realized it. Since the projects are very small and have only a few templates and fields it was very easy to set up templates and fields for these three in the PW admin interface (btw: I really like the possibility to export and import fields via the admin!). Template files were more or less a simple copy paste from the MODx backend to the PW templates files. After transforming the MODx placeholders and all that MODx related stuff in "PW language" and after setting up all fields I imported the MODx database tables into my PW database. From this point the migration script started it's work: Step 1: Map existing MODx templates to my newly created PW templates Step 2: Map all necessary fields from MODx to PW fields (based on the previously selected templates) - or just ignore fields I don't wan't to migrate Step 3: List all existing pages and select the pages that should not be migrated (e.g. old sitemap page). From this point on my migrator script did all the work. It created all pages (including the site structure with all its parents and children) and their fields. After importing I just had to copy the content from the old homepage (which was created as a seperate page below the root page) to the root page. That's it. Moving projects took about 1 hour. The most extensiv part in this process was to transform MODx templates to PW, build a new contact form and a menu function. All my projects were without users and permissions so it was quite low easy. At the moment I am working on the migration of a more complex website. This will take much longer but since the PW API is totally easy to understand it's not that hard at all. So thank you all for this great support and this framework! I really appreciate it! Long story short: Here are ex-MODx websites proudly powered by Processwire My own website with some stuff about me: http://brlnr.de And two more sites about events around sailing in Berlin http://www.ansegeln-berlin.de/ http://www.absegeln-berlin.de/
  14. hm... nevermind... perhaps some weird behaviour in my xampp development environment. Thanks anyway
  15. thanks Adrian for your suggestions. !$page->verein_datum works perfectly. I was just wondering why var_dump(empty($page->verein_datum)) returns true (= blank) and var_dump without empty returns the value as expected... perhaps it's better to stop thinking about it and enjoy coding with PW
  16. Hey everyone, I am struggeling a little bit with a datetime field for my pages. I want to check whether a datetime field is empty or not, but with my first assumtion this is not as easy as it seems to be... :/ var_dump(empty($page->verein_datum)); var_dump($page->verein_datum); returns bool(true) int(1397253600) I am not sure if this behaviour is wanted but I try to figure out which way is the best to check if the date is set or not. Any suggestions? Thanks!
  17. perhaps this is the wrong subforum, perhaps there are better waays to do this, but I wanted to share some thoughts regarding multi sites together with multiple robots.txt If you are running multiple sites with one PW setup you can't place multiple robots.txt files into your root. As long as all robots.txt files are identical there is no problem with it. You can stop reading right here. In my robots.txt I wanted to include a link to the current sitemap, e.g. Sitemap: http://www.domain.com/sitemap.xml I put each robots.txt into the "site-" directories. Search engines expect the robots.txt file directly in the root so I added some lines to my htaccess file (for each domain you have to do this) # domain 1 RewriteCond %{REQUEST_URI} /robots\.txt RewriteCond %{HTTP_HOST} www\.domain\. [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /site-domain/robots.txt [L] # domain 2 RewriteCond %{REQUEST_URI} /robots\.txt RewriteCond %{HTTP_HOST} www\.domain\-2\. [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /site-domain-2/robots.txt [L] Another possible approach: create a PW page within each site
  18. Same here in Berlin/Germany: +3 °C and the last snow is melting away in the rain :/ But anyway: Happy New Year to all of you!
  19. hm I am not sure if hooking is appropriate here. I saw a lot of questions around an upload form via API, so I though it would be a good way to realize a page within the admin section which does all that stuff instead of the regular /page/add/ plus hooks Nevertheless: I just found a workaround for my problem. If I use $obj_field = $this->modules->get('InputfieldFile'); instead of $obj_field = $this->modules->get('InputfieldImage'); it'll work. I am sure that this is not the best solution so far, but I'm giving it up finding another solution. I have read a lot about custom upload forms via the API but they are all older than the last update of PW. I think here is an issue when calling the image info. If I am using "InputfieldImage" a Pagefile object is passed to "InputfieldImage.module" to this method protected function ___fileAdded(Pagefile $pagefile) { This seems correct so far, but although it is an image it has no width property var_dump($pagefile->width); returns NULL Thanks anyway to Adrian for the support!
  20. echo $pagefile->url prints the following /site/assets/files/1046/nach-oben-1265-20.jpg The directory exists but there is no image in it since it is uploaded to the temporary directory (where the image is available). The page with ID 1046 is my custom upload "add gallerypage" which is within the admin section. It seems as if PW tries to upload the picture into the wrong directory or even checks it in the wrong directory and ignores the given destination path. $obj_field->destinationPath = $this->config->paths->galleryTemp; The custom upload does a lot I hope I can explain it in a few words: After uploading and creating a new temporary page the page gets automatically renamed to the uploaded image title via its ITPC meta data. The uploaded image also gets transformed. This means that the script precaches different sizes of the image, copies the original image into a separate directory, creates an htaccess file in the /site/assets/files/#id#/ folder to refer to the original image (rel=canonical). Afterwards some fields of the gallery page were filled with ITPC data as well (e.g. creation date, description, ...). Actually it was my first site I created with PW and I think that there are a lot of different approaches but I have tried to save as many time as I can when I upload images with ITPC data. I don't have to enter a page name, and this kind of data - it just uploading an image and my custom form do the rest. I only have to publish it afterwards.
  21. thanks for the hint. It seems as if getImageInfo() never gets called. Even a "die()" never gets executed. Here is the code I am currently using: buildForm() { $obj_form = $this->modules->get("InputfieldForm");$obj_form->method = 'post'; $obj_form->action = './'; [...] $obj_field = $this->modules->get('InputfieldImage'); $obj_field->label = 'Upload Image (JPEG)'; $obj_field->attr('id+name','ImageUploadJPEG'); $obj_field->required = 1; $obj_field->destinationPath = $this->config->paths->galleryTemp; $obj_field->maxFiles = 1; $obj_field->extensions = 'JPG JPEG'; $obj_form->append($obj_field); [...] return $obj_form; } if the form is send, this method is called: processInput(Inputfield $obj_form) { $obj_form->processInput($this->input->post); [...] } in the processInput method of the form object ___fileAdded() is called somewhere and that's where the exception came from (see Github link above). Perhaps the image is accidentally treated as a file instead of an image? But why a method in the InputfieldImage.module is called then?
  22. hi folks! I just upgraded my DEV environment to PW 2.5.3 and tested if everything will work. Unfortunately my custom image upload in the admin interface is broken. It keeps telling me that the image is invalid. As far as it worked with 2.4 I think it is a problem with the new version unless I haven't changed any code. following situation / workflow 1) Upload an image to a temporary destination (because the image has to be modified before finally added to a page) 2) Process inputform with the "regular" processInput method. Here the error is thrown 3) Make some custom stuff (e.g. image transformation, changing page title) 4) add image from temporary path directly to the page I checked what has changed in the InputfieldImage.module and I found these lines (see at Github: https://github.com/ryancramerdesign/ProcessWire/commit/aa58e7b6d8e6c78d76a2efff4bd9e020682d8115) if(!$pagefile->width) { $pagefile->unlink(); throw new WireException($this->_('Invalid image')); } If I dump the pagefile object I see that it contains data about the uploaded image (e.g. basename) but no width. Unfortunately I have no idea why the pageimage does not contain the width at all. I can't even find where the width is set... I hope someone has an idea. Thanks in advance! // EDIT if I comment out the above mentioned lines it works perfectly as expected. But I am still searching for the best approach
  23. hey ya! thanks for sharing the code! After some testing here are some intermediate results: 1. Resizing with PageImageManipulator gives better results than the build-in resizing 2. Exporting (like mentioned in Workflow 2) causes bigger PNGs than the original 3. I'll test much more with the PageImageManipulator. Seems this could be very(!) useful Thanks for sharing! @Joss: LR does not include PNG export. This has to be done with a plugin called MagicExport. With PIM it looks like I can export the good ol' JPG from LR and put it online directly without PS Cheers!
  24. Thanks for these two workflows. I'll give it a try as soon as possible. My last trial was this workflow: - Export from Lightroom as PSD - Save for Web via Photoshop as PNG - Upload PNG (as described above 300 KB)) - Resize image via PW (570 KB) The quality of all images is quite nice when using PNG, but the size isn't. As soon as I have some more results I'll let you know.
×
×
  • Create New...