Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/08/2019 in all areas

  1. EDIT: all development and discussion of this module has been moved to Module FieldtypeImagePicker which now contains all features of this module and more. This module will not be maintained any further. The information below remains for pure historical reasons. I am happy to present my new fieldtype FieldtypeImageFromPage. It is made up of 2 modules: Fieldtype Image Reference From Another Page is a Fieldtype that stores a reference to a single image from another page. The image can be selected with the associated Inputfield. Inputfield Select Image From Page is an Inputfield to select a single image from images on a predefined page and it's children. And there also is a helper module that takes care of cleanup tasks. This module evolved out of a discussion about my other Module FieldtypeImagePicker. It caters for use cases where a set of images is being reused multiple times across a site. With this fieldtype these images can be administered through a chosen page. All images uploaded to that page will be available in the inputfield. When to use ? Let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site. Suited for images that are used on multiple pages throughout the site (e.g. icons). Other than the native ProcessWire images field, the images here are not stored per page. Only references to images on another page are stored. This has several advantages: one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Features Images can be manipulated like native ProcessWire images (resizing, cropping etc.) Image names are fully searchable through the API Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message to help you edit those pages and remove references there before you can finally delete the image. How to install and setup Download and install this module like any other modules in ProcessWire Create a page in the page tree that will hold your images. This page's template must have an images field Upload some images to the page you created in step 2 Create a new field. As type choose 'Image Reference From Another Page'. Save the field. In 'Details' Tab of the field choose the page you created in step 2 Click Save button Choose the images field name for the field that holds your images (on page template from step 2) Click Save button again Choose whether you want to include child pages of page from step 2 to supply images Add the field to any template You are now ready to use the field View of the inputfield on the page edit screen: View of the field settings The module can be installed from this github repo. Some more info in the README there, too. In my tests it was fairly stable. After receiving your valued feedback, I will eventually add it to the modules directory. My ideas for further improvement: - add ajax loading of thumbnails Happy to hear your feedback!
    7 points
  2. You can use a hook to ProcessPageEdit::execute to redirect users with those roles to the frontend page. Make a new file /site/ready.php and put this code inside: wire()->addHookBefore('ProcessPageEdit::execute', function (Hookevent $event) { $restrictedRoles = array('admin', 'frontendeditor'); // list your roles here foreach ($this->user->roles as $role) { if ($role->name !== 'guest' && in_array($role->name, $restrictedRoles)) { $this->session->redirect($this->config->urls->root); } } }); This will redirect users with given roles to the homepage of your site. Note that this will restrict them only from accessing page edit screen in the admin panel. If you like to restrict access to the whole admin area for those roles, you would need to hook into Page::render or Page::viewable and than check if the Page has template admin.
    4 points
  3. I did just that with the DEV version of the Duplicator module. It went super smooth. Install the module (dev version) change some settings create an export download installer and archive upload installer and archive done All you need is a new database and of course access to upload those files.
    3 points
  4. The procedure I use is: Old Server: Download the database export. Download the site folder (you can skip cache). New Server: Install Processwire (same version). Delete the site folder and Empty the database. Upload the site folder from the old host. Import the database from the old host. Empty cache and sessions. Update the config.php where necessary (database credentials, etc.). Creating a site profile is not necessary. [edit] Since all my machines are *nix based, I use rsync to maintain duplicates: rsync -azP host:source destination
    2 points
  5. Hi @wbmnfktr It seem that your are using the wrong version - try the 1.3.12-ATO version on the dev branch please, it work as expected.
    2 points
  6. We recently relaunched DOMiD, the Documentation center and Museum of Migration in Germany. Concept, design and implementation by schwarzdesign. Features Bilingual site with German and English A section-based design focusing on flexibility and ease-of-use for editors Multiple forms built with FormBuilder that can be placed on any page Separate feeds for news & press releases Lightning fast page loads with almost perfect ratings in Lighthouse Completely accessible and SEO-friendly Notable tech decisions Forms and form placement There are multiple forms for different services that DOMiD offers. Those are built with the FormBuilder. The editors don't have access to the FormBuilder itself, but we still wanted to allow them to control which form is displayed on what page. For this purpose, every page has a select field to select which form to include (if any). Additionally, the form placement has additional fields for a headline and a description, so a generic contact form can be reused in different contexts. Section-based design Most pages are built through Repeater Matrix sections. There are multiple section types available, for example: A generic text / image column with up to three columns of text and images An accordion (rendered as <details> elements). An image gallery Downloads (for files and images, displayed as a list of downloads) External Embed (e.g. YouTube) All sections have an optional headline and a selection of three different background colours. In addition, text columns may be rendered as a coloured block with some padding. This allows for interesting and diverse layouts. Testimonial database One of the available sections is for testimonials or statements (you can see one at the bottom of the homepage). Because one testimonial may be displayed on multiple pages and the client wanted to be able to switch the displayed testimonial on the fly, there's a separate content type for statements. The statement content type has fields for the statement text, author, and author image. The testimonial section only has a page reference field to select which statement to show. This way, the testimonial definition is separate from the placement on a page. Modules used Form Builder Pro Fields (Repeater Matrix in particular) Unique Image Variations ALIF - Admin Links in Frontend Sitemap Wire Mail SMTP Developer Tools: Tracy Debugger, Duplicator, ProcesWire Upgrade Migration museum As a sidenote for anyone living in Germany, this month the German Bundestag has approved funding for DOMiD's first Migration Museum ("Haus der Einwanderungsgesellschaft")! The museum will be build in Cologne and is scheduled to be finished by 2023. We're looking forward to it! Check out this page if you want to learn more, or find out what people are saying about it here.
    1 point
  7. No need to wait any longer ? Option for including child pages is added and live on github in the new master v0.0.2 . EDIT: It's the v0.0.3, getting late here
    1 point
  8. Also would be cool if it allowed you to choose multiple images from the page so you can create a gallery from the stored global images.
    1 point
  9. I got it working. It's cool. The only thing I noticed after installing, creating the default photo page, adding my photos and then creating the field and adding that field to a page. The first time you arrive on a page that uses the new field, I got this error. It went away once I attached an image from the photos page, but I assume it would be more user friendly if there wasn't an error on the initial load before a
    1 point
  10. Thank you @flydev. I somehow missed that road to 1.3.12-ATO but I just installed and tried it again. Backup and reinstall runs buttery smooth. Perfect!
    1 point
  11. @adrian @szabesz and everyone who followed this discussion. I opened a new thread for the Module FieldtypeImageFromPage which is the new module that evolves out of this one after the discussion. Had a happy weekend of module coding ?. Please try the new module and let me know what you think. Cheers.
    1 point
  12. And done ? 0.5.0 released
    1 point
  13. This is what I'm trying to accomplish. Also I want to add a new property to Pageimage that holds the svg markup for inlining. Even if I add my hook inside the formatValue() method, it is not executed. Still fiddling. Will find a solution, eventually...
    1 point
  14. Or maybe you are looking to hook into the image deletion process to prevent an image from being deleted if it is used by an ImagePicker field? If so, that sounds like a smart thing to have ?
    1 point
  15. I don't think it's possible. Two comments in the core code: "Fieldtype modules are not automatically loaded, they are only loaded when requested" "Inputfields are not loaded until requested" I think you might need to add a helper module for those hooks. I guess otherwise you would need to check for the presence of the pageimage from init(), rather than hooking which I think could also work fine.
    1 point
  16. Yes, I am using Pages and Pageimages to retrieve and list them. Everything is working fine so far. Doing some more fine tuning. Have to cater for cases where an image got deleted from the page that holds all images but is still referenced from my Fieldtype on a page. And things like that... Can I make a fieldtype module autoload so that I can attach hooks to Pageimage and Pageimages from init() within my fieldtype? I tried, but it doesn't work.
    1 point
  17. @gebeer - I am sure you have already thought of this, but if you're changing to only support selecting a page (and its children), you could make use of PW's API to load up the images in the picker field, rather than scanning the server folder directly. I don't think there is a reason not to change.
    1 point
  18. Hey @flydev just tried to backup an almost abandoned project of mine with your Duplicator module. Installation (recent version from the modules directory via PW), setup and initial backup (local folder, no FTP or cloud) worked fine and I was curious about how the installer.php would work and gave it a try. Then at some point it became weird. The installer looked for config.php in a folder that does not exist at that point and path. I repeated everything, moved the files around but there was no config.php anywhere in the backup. Neither the script created one. Am I missing something here or ... changed something somewhere else that doesn't work well with your module? I created a backup of an PW 3.0.132 instance. Both, remote and local, use PHP 7.2.x- This question isn't urgent or anything!
    1 point
  19. This week we’ve got version 3.0.147 out on the dev branch. Relative to version 3.0.146, most of the new commits (about 13 of them) are focused on resolving reports submitted at GitHub. I love refactoring existing code and adding optimizations and improvements to the core (and then writing about them in the blog). But right now I’m trying really hard not to! I’d like to have a new master version out before the new year, so the focus is on making sure the core is as absolutely stable as possible. Any time I refactor or add something new (or even sometimes when fixing something or another), there’s a chance of introducing new bugs, and it needs thorough testing on the dev branch, so right now the goal is that everything is thoroughly tested and stable before merging to the master branch. As a result, I’m trying to keep my hands off the core as much as possible, other than fixing obvious things that aren’t likely to introduce new code that needs testing. Please consider 3.0.147 release candidate 1 (RC1) for the next master. Thanks for all of your help and testing. Hopefully by (or before) 3.0.150, we’ll be ready for a merge to master. One way I try and take a break from modifying too much in the core before a master version release is to focus on other modules instead. That’s why last week I wrote about the new UserActivity module, and why next week I’ll be posting all the details for a new LoginRegisterPro module — one that I’ve been working on-and-off for more than a year, but have recently given it a lot of attention in getting it ready for release. I’ll save most of the details on LoginRegisterPro for next week, except to say that it provides an all-in-one solution for front-end login, account registration, profile editing and more. You might be wondering how that’s different from the LoginRegister module I built and released awhile back. That LoginRegister module was built for a very specific purpose and client, largely as a proof-of-concept. But there was a lot more interest in it than I ever expected, and several people suggested that there was a need that would be better served by the quality and support of a Pro module. The result is LoginRegisterPro, which is a full reimagining of that from the ground up. It does everything LoginRegister didn’t, in addition to everything it did. It goes much further in terms of security, reliability and customizability, and I look forward to telling you more about it. I may have it ready to release as soon as next week, but just wanted to make sure all the documentation was complete (and there is quite a lot of it so far). A couple other things I’m looking forward to working on here in the next month or so are the 2020 core roadmap and [finally] the new modules.processwire.com site. Thanks for reading and have a great weekend!
    1 point
  20. Hi @dadish the module is awesome. But i have some troubles with language support. Here is my query: { language(name: "default") airport(s: "limit=4, sort=title") { list { id title } } } Here is the response problem: { "errors": [ { "message": "Cannot query field \"language\" on type \"Query\".", "extensions": { "category": "graphql" }, "locations": [ { "line": 2, "column": 3 } ] }, { "message": "Cannot query field \"title\" on type \"AirportPage\".", "extensions": { "category": "graphql" }, "locations": [ { "line": 6, "column": 7 } ] } ] } title field has type - Page Title (Multi-Language), but as it mentioned above response is "Cannot query field \"title\" on type \"AirportPage\" Here is GraphQL module configuration screen. Where did I make a mistake?
    1 point
  21. Are you receiving any errors at mydomain.com/pwone etc etc ? What issues are you exactly running into? A bit more information would be helpful.
    1 point
  22. Please read this: https://processwire.com/blog/posts/pw-3.0.80/#pro-module-faqs then contact Ryan directly.
    1 point
  23. The database will be the bottleneck. Use InnoDB and transactions. Find all items with the text "transaction" on this page: https://processwire.com/api/ref/wire-database-p-d-o/ https://processwire.com/blog/posts/using-innodb-with-processwire/ For an example of how they are used, find "transaction" in this: https://github.com/adrianbj/BatchChildEditor/blob/master/BatchChildEditor.module.php (BCE includes the copied supportsTransaction function, so it will work with older PW versions as well)
    1 point
  24. From what I understand, you have to have the specific image prior to setting any property. $yourPage->of(false); // turn off output formatting $yourImage = $yourPage->yourImageField->last(); // get the last image // $yourImage = $yourPage->yourImageField->eq($index); // or, get specific image by array index $yourImage->yourCustomField = 'yourValue'; // Set value of custom field $yourPage->save(); // save the changes
    1 point
  25. Although the PW backend is really intuitive, ever so often my clients need some assistance. Be it they are not so tech savvy or they are not working in the backend often. For those cases it is nice to make some help videos available to editors. This is what this module does. ProcessHelpVideos Module A Process module to display help videos for the ProcessWire CMS. It can be used to make help videos (screencasts) available to content editors. This module adds a 'Help Videos" section to the ProcessWire backend. The help videos are accessible through an automatically created page in the Admin page tree. You can add your help videos as pages in the page tree. The module adds a hidden page to the page tree that acts as parent page for the help video pages. All necessary fields and templates will be installed automatically. If there are already a CKEditor field and/or a file field for mp4 files installed in the system, the module will use those. Otherwise it will create the necessary fields. Also the necessary templates for the parent help videos page and it's children are created on module install. The module installs a permission process-helpvideos. Every user role that should have access to the help video section, needs this permission. I use the help video approach on quite a few production sites. It is stable so far and well received by site owners/editors. Up until now I installed required fields, templates and pages manually and then added the module. Now I added all this logic to the install method of the module and it should be ready to share. The module and further description on how to use it is available on github: https://github.com/gebeer/ProcessHelpVideos If you like to give it a try, I am happy to receive your comments/suggestions here.
    1 point
  26. Go to the settings of your CKE field, TAB Details at the bottom are a few options. One of them is: Replace blank alt attributes with image description Check, and done!
    1 point
  27. The thing to remember is that this setting is called the "Formatted value", i.e. the value when output formatting is on. When output formatting is off the value of an image field is always a WireArray. And in your code, you specifically turn output formatting off before you work with the field (as you must). If you treat the image field value as an array I think it will work as expected. Something like: $page->of(false); $page->photo->removeAll(); $page->photo->add('https://example.com/img.jpg'); $page->save(); $image = $page->photo->last(); $image->textfield = 'Some text'; $page->save();
    1 point
  28. Try: https://processwire.com/api/ref/page/get-field/ $page->getField('Formattext01')->id
    1 point
  29. Just chucking this in here incase anyone else has this problem. Upgraded to the latest dev and it failed (I never get that!!!!!) I got the warning: Warning: require_once(/sites/domain name/wire/core/ProcessWire.php): failed to open stream: No such file or directory in /sites\domain name\index.php on line 32Fatal error: require_once(): Failed opening required '/sites/domain name/wire/core/ProcessWire.php' (include_path='\php\PEAR') in \sites\domain name\index.php on line 32 Turned out it hadn't renamed wire-3xx to wire This was locally using XAMMP. So, if you see this, check: Has it renamed the wire directory, And if everything extracted okay. (I have seen that on another post once, I think). Okay, back to what you were doing!
    1 point
  30. Since today, 31-01-2018, we have support for this in the PW Core. Therefore I updated this module to version 2.0.2 This version handles the detection of the core support and dismiss its installation then. If the core module is available but not installed, it get installed instead of this third party module. If you have this third party module already installed since a previous PW version and upgrade your wire folder, this module will detect the core module and install it. Its own hook isn't registered then and you get a notification about the changes.
    1 point
  31. The question about behavior is still actual, but for to change it i use this code in init.php $currentLang = $user->language; $pageLanguages = $page->getLanguages(); if(!$pageLanguages->has($currentLang)) { throw new Wire404Exception(); }
    1 point
  32. I'm currently working on a bigger project with migration files, like posted here: https://processwire.com/talk/topic/11382-migrating-modules/?p=106238. Currently there's no migration automation, but it keeps changes to the db manageable by source control. I just deploy by git pull and then run the new migrations manually.
    1 point
  33. I made this into a blank site profile. Download and instructions here. Tested on a new PW install and it is working fine. Maybe some of you want to test it in other environments and let me know if I need to amend the README. Thank you.
    1 point
×
×
  • Create New...