Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/27/2021 in all areas

  1. Thanks Bernard! The mobile preview bit is from the first pw module I am preparing to release into the wild, very shortly, FaviconMagic. Been using it for many months now, but wanted to make it shinier and stress test it before offering it up. Was complicated a little by the background admin styling, which is from another module I plan to release into the wild shortly ...have been using and tweaking it for around 2 years now, since we discussed admin theme tweaking strategies. Just tweaking FaviconMagic now, adding features and trying to break it so I can make it better. Planning to throw it up on Github soon - probably within the week - depending on how much stuff I keep adding ? FaviconMagic is kinda like realfavicongenerator, but I am aiming to take that up a notch (or two) for the processwire community. I have learned much and the processwire community have always been very gracious with their time and advice. Adds support for svg favicons (cutting out unnecessary downloads), autogenerates a maskable favicon, generates webmanifest and browserconfig etc. Basically a shortcut to full PWA requirements, minus the service Worker stuff. You can generate new favicons and play around with a whole heap of stuff without leaving pw admin. Also uses "smarter" options. For example, short_name is apple app name, unless you choose to over-ride it. Theme color is similar, you don't need to cut and paste the same stuff multiple times, but advanced config is always available if you desire it. Apart from a one-off include in the head of the target doc, there is no copy/paste of markup. Always up to date with your latest tweaks. No unzipping either. Generation of all png variations from svg resizing for crispy goodness. More than happy to give you a yell when the beta is up on Github if you'd like, I would love to hear what you think.
    3 points
  2. Could you do a search through your codebase to find if somewhere you might be assigning that property to the page (a typo)?? At east it happens to me sometimes that I swap a variable's words like that lol Came for the title, stayed for the issue ? Like, wow what's FieldtypePhantom
    2 points
  3. There should be examples of fieldsets defined in the samples folder, but using PHP. I don't think you can do fieldsets fro JSON defined settings, but the tabs fieldsets example shows "Advanced Settings" which are each in a fieldset.
    2 points
  4. Hello all, sharing my new module FieldtypeImageReference. It provides a configurable input field for choosing any type of image from selectable sources. Sources can be: a predefined folder in site/templates/ and/or a page (and optionally its children) and/or the page being edited and/or any page on the site CAUTION: this module is under development and not quite yet in a production-ready state. So please test it carefully. UPDATE: the new version v2.0.0 introduces a breaking change due to renaming the module. If you have an older version already installed, you need to uninstall it and install the latest master version. Module and full description can be found on github https://github.com/gebeer/FieldtypeImageReference Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip Read on for features and use cases. Features Images can be loaded from a folder inside site/templates/ or site/assets Images in that folder can be uploaded and deleted from within the inputfield Images can be loaded from other pages defined in the field settings Images can be organized into categories. Child pages of the main 'image source page' serve as categories mages can be loaded from any page on the site From the API side, images can be manipulated like native ProcessWire images (resizing, cropping etc.), even the images from a folder Image thumbnails are loaded into inputfield by ajax on demand Source images on other pages can be edited from within this field. Markup of SVG images can be rendered inline with `echo $image->svgcontent` Image names are fully searchable through the API $pages->find('fieldname.filename=xyz.png'); $pages->find('fieldname.filename%=xy.png'); 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 with links to help you edit those pages and remove references there before you can finally delete the image. This field type can be used with marcrura's Settings Factory module to store images on settings pages, which was not possible with other image field types When to use ? If you want to 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 (e.g. icons, but not limited to that). Other than the native ProcessWire images field, the images here are not stored per page. Only references to images that live on other pages or inside a folder 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) Installation and setup instructions can be found on github. Here's how the input field looks like in the page editor: If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip Eventually this will go in the module directory, too. But it needs some more testing before I submit it. So I'd really appreciate your assistance. Thanks to all who contributed their feedback and suggestions which made this module what it is now.
    1 point
  5. Hello, I would like to present you a new module which aim to facilitate the productivity of your editors/publishers when working on ProcessWire. The idea begun when my co-worker told me that when typing in ProcessWire CkEditor field he was feeling "loosing motivation" when writing big wall of text and/or inspiration. So he opened his web-browser and show me a site looking to Wordpress - feel free to put your preferred emoji here - then he opened Gutenberg... typed some text and moving some "blocks". I understood immediately why he got this feeling with CkEditor. If you or your client feel like this guy, then you will love this module ! What is currently supported ? Features Auto-save Medias upload support HannaCode support Blocks Implemented Heading Image Paragraph Embed Quote Code Link Table (beta) Block Delimiter Raw HTML Note (custom block markup) Feature Request Frontend Edition And there you go for the preview - sorry I am to lazy and bad at typing text so I had a copy/pasta moment : Module featured in the ProcessWire Weekly #317 - Thanks @teppo
    1 point
  6. ..... now it's working. I think your response scared the bogey away, @elabx
    1 point
  7. In the procache forum I posted about my hanna code solution to show the current date on a page. Posting here so others can use it if needed. Before I used a document.write solution, but google pagespeed gave warnings with that. I use this on salespages where I want the visitor to see the current date. Works great, I use the html below as [[date]] hanna code <p id="date"></p> <script> days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; months = ["Januari","Februari","March","April","May","June","Juli","August","September","October","November","December"]; d = new Date(); datum = '' + days[d.getDay()] +', '+ months[d.getMonth()] + d.getDate() + ', '+ d.getFullYear() + ''; document.getElementById("date").innerHTML = datum; </script>
    1 point
  8. Edit: Belated memory that iframe sandbox exists, so there is a simple way to provide page preview as guest. <iframe sandbox="allow-same-origin" src="..."> Prevents get/set of cookies and scripts by default, so simple workaround. Drawback is that little things like your js dark mode etc won't be active either, but for simple preview needs bit easier than the other things I unsuccessfully tried. Page preview as guest from within admin... is there an easy strategy? If any wise heads have any ideas for how I can "log out" only from the iframed link or if there is a query I can pass with the iframe url, I would be very grateful. Can access the iframed url via js to change things, like successfully getting rid of scrollbars etc, but before I delve further along that route was wondering if there is an easier way. Making a little mobile preview for favicon generator/webmanifest thing I'm working on. Not really important (or necessary) - pretty much editor bling to provide instant feedback in a non-new, mid-range android. Working pretty well, with lots of irrelevant silliness like swapping colors of mobile top icons based on contrast. Frivolous but kinda fun. Homescreen / clickable app icon and short_name based on generated favicons and values. Click homescreen icon to start screen with theme color, app start icon and long name. Figured I'd throw in iframe of the site to round things out preview-wise. No problems there, but session remains as admin, so not really a "guest preview" with front-end editing styling, Tracy and various admin stuff.
    1 point
  9. Nice! I've done a similar thing (but very basic and only PNG) lately. The webmanifest is generated on page save and simply exposed via url hook ? Looking forward to seeing what you came up with. That will get a lot easier with the next dev release of PW ?
    1 point
  10. Thank you @Macrura for your pointing me to the PHP sample.
    1 point
  11. this tool looks interesting! what are you building here? a pw module? or an online service?
    1 point
  12. Thanks for your continued development on this. I still need to have a look at it.
    1 point
  13. Some unusual stuff happening on Freenode since the change in ownership (https://lwn.net/Articles/857252/). I got banned from freenode as a spammer just because I mentioned the word 'libera' in a room. Libera (https://libera.chat/) seems to be the place where the Freenode staff channels are are moving to & I've opened up a channel there. Please join!
    1 point
  14. You might want to give $sanitizer->purify() a try.
    1 point
  15. After building the ProcessMentions module and another autocomplete module for images, I found that I am going to need even more of these, but things were going to get repetitive. So I refactored the whole thing into a basic autocompletion module and individual "actions". The result is Autocomplete for CKEditor (GitHub). To try out, Install the module and actions Enable actions in the settings of any CKEditor field Edit a page with this field, type "@" and some characters for the and enjoy There are still a few things I need to implement. ATM, it only supports single characters as triggers for the autocomplete. I'd like to change that to combinations so I don't run out of special characters at some point. I also have to add a few more configuration options (like search only at the beginning or also in the middle of the searched string). The documentation for custom styling also needs some work. I have tried to keep things generic. Implementing your own actions should be quite straight forward. The README at GitHub illustrates the main steps and the supplied action classes have inline documentation. I would love to get some feedback or even see some third party InlineCompleteAction implementations.
    1 point
  16. v0.0.14 is now available This is quite a significant enhancement in hookability so that now (for example) scripts can be run automatically after installing a migration. See the help file for full details. Brief outline is below. Available hooks Many of the ProcessDbMigrate methods are hookable: ___execute() – Display the Database Migrations setup page ___executeNewPage() – Create new migration ___executeGetMigrations() – refreshes all migration pages ___exportData($migrationPage) – creates the .json files for a migration ___removeFiles($migrationPage) – removes the .json files for a migration ___installMigration($migrationPage) – installs a migration in the target ___uninstallMigration ($migrationPage) - uninstalls a migration in the target ___lockMigration($migrationPage, $migrationFolder) – locks a migration (in the source) ___unlockMigration($migrationPage, $migrationFolder) – unlocks a migration (in the source) ___previewDiffs($migrationPage, $comparisonType) – previews migration changes where $comparisonType is one of: export, install, uninstall, review Placement You can place your hooks in site/ready.php. In this case you will need to check the name of the migration page before running – e.g. wire()->addHookAfter('ProcessDbMigrate::installMigration', function ($event) { $migrationPage = $event->arguments(0); if ($migrationPage->name == 'my-migration') { ///code to run } }); and then you use $migrationPage to further reference the migration page. This approach keeps all your hooks together and you have to remember to sync the site/ready.php as well as your migration files. Alternatively (the recommended approach), you can place a file called ready.php in the site/template/DbMigrate/migrations/my-migration/ directory, in which case your script would be $this->addHookAfter('ProcessDbMigrate::installMigration', function ($event) { // code to run }); and you can use $this to reference the migration page. This approach keeps all your migration-related data & code together and you only have to sync the migration folder. It also means that your migration-specific ready.php code will be displayed at the bottom of the migration page. Also, if you ‘remove migration files’ it will remove your custom code as well (usually you will only be doing this as preparation to delete the migration, so that is what you want). With the first approach, your hook will remain in site/ready.php. Usage Of the available hooks, installMigration and uninstallMigration are likely to be the most useful. For example, a hook after ProcessDbMigrate::installMigration could be used to carry out database-wide changes following the amendment of the structure. Say you have changed an address field to split out the post code into a separate field. The migration definition will specify the new field and the changed template. The hook (after ProcessDbMigrate::installMigration) will then include the code to extract postcodes and place them in the new field. You could place code to undo this as a hook before ProcessDbMigrate::uninstallMigration, so that executing the uninstall exactly reverses the install. --------------- UPDATING - NOTE If you are updating the module (as opposed to installing for the first time), after a 'modules refresh' you will need to go to the bootstrap migration page and install it in order to pick up the new field which displays the migration-specific ready.php file.
    1 point
  17. Great work @kongondo. This looks fantastically feature-filled. You've obviously made a massive investment in this module, especially from a behind the scenes technical point of view. It is a shame in one sense it isn't built out if processwire pages, but it's obviously more powerful or efficient to have escaped the limitations of that setup. My only concern personally is the UI. I do prefer it over the standard UIkit setup of Processwire but I think myself and my clients would prefer they were closer visually to make it more of a seamless experience. I like the siderbar though, I can't think of a PW paradigm you could have used for that. Could you explain the difference between order notes and order comments though? Great works, thumbs up. Tell me where to send the money.
    1 point
  18. Shut up and take my money. I also thought a long time about making a fieldtype with editor.js, because it is just awesome to store contents as structured data. Prosemirror is an alternative, which works similar and is used in Statamic for its Bard field (which is also awesome). Is there any release date yet?
    1 point
  19. ok thanks - i think it can be done no problem, but i think the api should be cleaner where you don't need to deal with setting array values; i'll have to post back once i have a working prototype.
    1 point
  20. @bernhard, many thanks for trying out the module, and for your suggestions and feedback! I will see about implementing the suggestions, especially linking to the Github and Forum topics for anyone who installs it, so that it is easier to grasp how to use it. I'm also hoping to test out the ImageReference field within this and then post example screenshots showing an even more kitchen sink setup, with images etc. Not directly related to your post, but responding more to the general consensus on where and how to create settings pages: I found this module to be most useful in the past couple of years for things like: - Site Schema for a person or business (the fields basically follow the schema.org items; See screenshots below) - Settings for various custom implementations - e.g. api keys, urls, enable/disable features, etc. -- on one site we use this to enable the site manager to choose which comment system to use (Disqus, Facebook etc), and then put in various settings if using Disqus (user id etc) - Theme settings, like you might find on a WordPress theme, stuff like colors, what type of global footer to use, logo selections (using page refs), site title, slogan. It is also a good way to have settings for any custom code you are doing without having to write a module...
    1 point
  21. @adrian @szabesz I am already working on implementing with child pages.
    1 point
  22. ok thanks @Zeka and @adrian, the module has been updated.
    1 point
  23. 1 point
  24. Hi. Test this $module_id = wire('modules')->getModuleInfo('ProcessSettingsFactory')['id']; $adminPages = $this->wire('pages')->find("template=admin, process=$module_id");
    1 point
  25. the input form is all native PW; so you just supply your array of field definitions using the correct keys for that inputfield type; no graphical ui would be possible, but there is a kitchen sink file where you just grab the type of inputfield you want, paste it in to your fields array, change the settings and bob's your uncle.
    1 point
×
×
  • Create New...