Leaderboard
Popular Content
Showing content with the highest reputation on 07/08/2017 in all areas
-
FieldtypeColor is on github Fieldtype stores a 32bit integer value reflecting a RGBA value. Input 5 types of Inputfields provided Html5 Inputfield of type='color' (if supported by browser) Inputfield type='text' expecting a 24bit hexcode string (RGB). Input format: '#4496dd'. The background color of the input field shows selected color Inputfield of type='text' expecting 32bit hexcode strings (RGB + alpha channel) Input format: '#fa4496dd' Inputfield with Spectrum Color Picker (Options modifiable) Inputfield type='text' with custom JavaScript and/or CSS (since version 1.0.3) Output Define output format under 'Details' tab in field settings. Select from the following 9 options string 6-digit hex color. Example: '#4496dd' string 8-digit hex color (limited browser support). Example: '#fa4496dd' string CSS color value RGB. Example: 'rgb(68, 100, 221)' string CSS color value RGB. Example: 'rgba(68, 100, 221, 0.98)' string CSS color value RGB. Example: 'hsl(227, 69.2%, 56.7%)' string CSS color value RGB. Example: 'hsla(227, 69.2%, 56.7%, 0.98)' string 32bit raw hex value. Example: 'fa4496dd'(unformatted output value) int 32bit. Example: '4198799069' (storage value) array() array( [0] => 0-255, // opacity [1],['r'] => 0-255, [2],['g'] => 0-255, [3],['b'] => 0-255, ['rx'] => 00-ff, ['gx'] => 00-ff, ['bx'] => 00-ff, ['ox'] => 00-ff, // opacity ['o'] => 0-1 // opacity ) The Fieldtype includes Spectrum Color Picker by Brian Grinstead SCREENSHOTS Input type=text with changing background and font color (for better contrast) Input type=color (in Firefox) Javascript based input (Spectrum Color Picker) Settings Output Settings Input3 points
-
Functional fields sound awesome! Seeing as both of these may be used as the first argument... __text('Subscribe') // intended to be some default text __text('subscribe') // intended to be the name previously given to some different text ...is it right that you would have to be careful when giving a name to text to make sure it is not a string that might be used as default text, now or in the future? Like, maybe you would want to prefix the name with something that is unlikely to be used as default text. And in the example above, would those two be identified as separate text items - i.e. is the name case-sensitive?3 points
-
I don't think it'll be an issue for this case because the words may be the same, but the case is different. But there's actually another function in the posted version called __value('name'), which is what you can use if you prefer it. It returns whatever bit of text has the given name, regardless of what kind it is. However, it's pretty easy to avoid these kinds of collisions even without the __value() function.2 points
-
I accidentally stumbled onto my own solution. It doesn't seem intuitive to me (that doesn't really mean that it doesn't make sense), but to switch templates, I had to assign "Create Pages" access to the role on the template. Once I did that, I was able to log in as the contributor and change templates. Hope this helps someone else in the future.2 points
-
you could do that quite easily using jquery datatables: https://datatables.net/extensions/scroller/examples/initialisation/large_js_source.html in the example they have 50.000 records without a problem. i'm working on a new datatables fieldtype right now. do you need it for the front or backend? maybe you can get some inspiration here, but be advised that i'm working on a new version (fieldtype similar to my handsontable fieldtype) and this module will change completely edit: of course server-side would be better and client-side depends on the clients machine. so if you have special requirements that could or could not be a good way to go...2 points
-
Hi everyone, I'm proud to share my first fieldtype module and I think it's a quite handy one It helps you to create all kinds of table/matrix inputs very quickly and easily. You have loads of options for customizing your field via plain javascript. See the handsontable docs for that Please consider this module ALPHA until i got some more time to test it. Any help would be highly appreciated Numbers are for example always tricky. Different locale settings, different types, rounding errors and so on... Download: https://gitlab.com/baumrock/FieldtypeHandsontable Result: Installation/Configuration: Just install the Fieldtype, add a field to your template and set the handsontable options in the fields details. If you have InputfieldAceExtended installed you will also have code highlighting for your code: Get data: If you retrieve the data from the API with outputformatting ON you have some helper methods available: getData() + getRows() get all data of the field getRow($row) get one special row, eg getRow(1) or getRow("2017") getCols() get all data but by columns not by rows getCol($col) get one special column, eg getCol(1) or getCol("mycolumnheader") You can also access rowHeaders and colHeaders directly (see examples) Simple Example: Caution: the examples below are outdated! see this post:1 point
-
Hej, A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated (Also pull requests are appreciated ? - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!) Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method: <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so: <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe What do you think? Any ideas, bugs, critique, requests? cheers Steffen1 point
-
Markup CKEditor (for Form Builder) An inputfield for displaying markup editable via CKEditor. The module is intended for use with the Form Builder module. Allows blocks of static text to be included within a form, which can be edited in the form settings using CKEditor. Screenshots Usage Install the Markup CKEditor module. In the Form Builder module settings, add "MarkupCKEditor" to "Inputfield types to use with FormBuilder". In your form settings, add a new field of type "Markup CKEditor". Enter the text you want to show in this field using "Markup Text" on the "Details" tab. Configuration In the module config you can set items for the CKEditor toolbar that will apply to all Markup CKEditor fields. If you want to insert images in your markup field then add "Image" to the toolbar items to enable the standard CKEditor image plugin. The ProcessWire image plugin is not usable because in a FormBuilder form there is no page to store images in. Advanced There is a InputfieldMarkupCKEditor::ckeReady hookable method for users who want to do advanced customisation of the CKEditor inputfield. It receives three arguments: The InputfieldCKEditor object The form as a FormBuilderForm object The field as a FormBuilderField object Example $wire->addHookAfter('InputfieldMarkupCKEditor::ckeReady', function(HookEvent $event) { /** @var InputfieldCKEditor $cke */ $cke = $event->arguments(0); /** @var FormBuilderForm */ $form = $event->arguments(1); /** @var FormBuilderField $field */ $field = $event->arguments(2); if($form->name === 'test_form' && $field->name === 'my_cke_markup_field') { $cke->contentsCss = '/site/templates/MarkupCKEditor/contents.css'; $cke->stylesSet = 'ckstyles:/site/templates/MarkupCKEditor/ckstyles.js'; } }); http://modules.processwire.com/modules/inputfield-markup-ckeditor/ https://github.com/Toutouwai/InputfieldMarkupCKEditor1 point
-
Hey, I've used ProcessWire for a while now but not made an appearance in the forum yet I just wanted to share the solution to a small problem I came across with Let's Encrypt (free SSL service). Let's Encrypt SSL certificates need to be renewed every few months to remain active. My web host does this automatically but needs access to a folder named ".well-known", which ProcessWire blocks by default because it starts with a dot. This results in a 403 error. To work around this, just add the following line to your .htaccess file, around line 150: RewriteCond %{REQUEST_URI} !^(/\.well-known) It should be the first condition in the section titled "Access Restrictions: Keep web users out of dirs that begin with a period". I also ran into another problem. Let's Encrypt accesses mail.example.com which is redirected to www.mail.example.com because I enabled the redirection in my .htaccess fie. So we need to exclude the mail sub domain from that rule using the following line as the second condition in the www-redirection section (around line 160): RewriteCond %{HTTP_HOST} !^mail\. [NC] I know it's quite a specific problem but maybe it'll help someone Googling the issue. I was curious, is there any way of redirecting to the www-version without having to exclude all your sub domains? The only way I can think of involves explicitly writing out your domain name in the .htaccess file and redirecting whenever the %{HTTP_HOST} starts with that name. But obviously that would lead to a loss of generality.1 point
-
datatables is free & open source: https://datatables.net/faqs/index#Licensing if you plan to use it you might be happy to hear that i'm working on a new fieldtype that works similar (but even better) than my handsontable fieldtype edit: sorry, seems you are only talking about the editor. i used datatables a lot with custom action icons opening pw-panels and regular pw-edit screens. works like a charm!1 point
-
Thanks! Re-installed it and everything works like a charm.1 point
-
hi kixe, thanks for sharing this would you mind adding some screenshots or a sample usecase to know when your module would be useful? maybe you could also point out the differences to somas colorpicker module? thanks!1 point
-
1 point
-
1 point
-
Sorry if I ruin your Saturday... I ran into a problem when I copy and pasted something from MS-Excel, where some fields contain line breaks. The frontend displays everything correctly. But in page-edit, I get a JS error, and the same msg again: "Please save this page to be able to change this content" When I inspect the offending line, it's the first occurance of a line break in var field = JSON.parse Do you have any idea what could cause this?1 point
-
hi robin, thanks for your words i've not yet found the time to make the field queryable via pw selectors. i'm not sure how that should (could) be implemented in the best way. as i've never built a queryable inputfield i would be happy to hear some thoughts about it from someone more experienced. ... or a PR where i can learn from1 point
-
@bernhard, this looks like a really useful module, thanks for making it. When using FieldtypeHandsontable values as part of a $pages->find() selector, is it possible to search for values in particular column or row, or in a specific column/row combination? Like in the "row headers" example in the first post, is it possible to match pages where "Juni 2018 = 60"?1 point
-
That looks awesome. I finally found some time to play around with it, and I'm quite impressed. I can already see some concrete usage scenarios - especially what you already mentioned re: when it's too tedious to go the "export CSV from Excel, import CSV to PW" route. I am somehow stuck though when trying to add i18n options to the datepicker. I took your example (Jan-Dec), added a few options, and everything worked fine in the back- and frontend, but now I don't see that handsontable anymore in "page edit" mode. I get a message saying "Please save this page to be able to change this content". I did that repeatedly, but it's always the same. Funnily enough, I don't see any errors in the PW error log, and the frontend works just fine (granted, it's only a print_r() so far, but at least it still fetches something from PW and spits it out correctly). Did you run into similar situations? Any idea what I did wrong? This is my JSON: var colheaders = ['Jan', 'Feb', 'März', 'Apr', 'Mai', 'Juni', 'Juli', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez', 'Datum']; hot.updateSettings({ colHeaders: colheaders, minCols: colheaders.length, maxCols: colheaders.length, rowHeaders: false, minRows: 1, copyPaste: true, autoWrapRowBoolean: true, autoWrapColBoolean: true, minSpareRows: 1, columns: [ {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, { type: 'date', dateFormat: 'DD.MM.YYYY', correctFormat: true, defaultDate: '01.07.2017', i18n: { previousMonth : 'Voriger Monat', nextMonth : 'Nächster Monat', months : ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'], weekdays : ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], weekdaysShort : ['So','Mo','Di','Mi','Do','Fr','Sa'] } datePickerConfig: { firstDay: 1, showWeekNumber: true, numberOfMonths: 3, disableDayFn: function(date) { return date.getDay() === 0 || date.getDay() === 6; } } } ] }); Edit: D'oh - I missed a comma after the i18n block... OK so the table is back, but although Saturdays + Sundays are deactivated, and Monday is set as the 1st day of the week, the days and months still display in english. Guess I have to dig into the original docs a bit further... Thanks for this great addition to PW!1 point
-
1 point
-
@Peter Knight Here is exactly what you need to do: Create a new file under templates: _translations.php. Inside add all your translatable words or phrases like this: $page->__product_drawing = __('Product Drawing'); $page->__buy_now = __('Buy Now'); $page->__read_more = __('Read more'); Then on your _init.php add this: include_once("./_translations.php"); Then on the templates you want to display for example the "Product Drawing" add this: $page->__product_drawing Now all you have to do is to go on your Languages under admin and then find the file _translations.php and start translating all the strings you have there.1 point
-
Functional Fields looks like it will be a great addition to the ProFields family. Thanks for making this tool available.1 point
-
Importing data into PW is certainly no big deal. I guess the actual challenge is to find out whether an update is necessary, or creating a new recordset (page). If your export from the other system (I guess a CRM) only allows to have ALL data exported, then it's going to be tricky. It would be ideal if you had three different exports: only completely new records (new customers, new sales reps) only updates to existing data (new customer address, new sales rep phone number) only removals from the system (or a flag like "inactive") You would probably need unique identifiers (perhaps an ID from your CRM that you store as a special field in your PW-template), to make sure you update the right page.1 point
-
1 point
-
@bernhard checkout VS Code, it's faster than atom (at least it was when I switched) and it's very similar to atom visually.1 point
-
Visual Page Selector version 003 (released (07/07/2017) Happy to announce that the latest release of Visual Page Selector is now available for Download/Purchase. Documentation is also complete! This is a major update. Visual Page Selector can now be used as a normal but enhanced page field! There are 2 views each for inputfield (page edit) and the page selector modal. These can be combined to suit your workflow as explained in the docs here. As a normal page field, you can opt to view the selected pages as a simple list and add pages to your page field using a ProcessWire Lister modal. This opens so many possibilities, including nuanced differentiation of pages to add to your page field, for example, making use of Lister columns and other page properties. For those that want to use Visual Page Selector as a 'one-page-per-image' solution, you can carry on as normal, with the added benefit of different view combinations In page edit, selectable pages are not loaded directly in the Inputfield allowing you to have hundreds of thousands, nay, unlimited numbers of selectable pages without experiencing any slowdowns (@note: What you see in the screenshot below is not AsmSelect or PageAutocomplete; just a custom list that blends in with the rest of ProcessWire). Please note that there were a few inevitable changes to the field settings. The Lister settings are now separated into individual settings. In addition, there was a typo in the 'vps-delete-page' permission. That should be 'vps-delete-pages'. Due to these, if upgrading from version < 3, please test thoroughly and fix any brokenness before using in production. If you need any help please let us know. Changelog Lister view for an enhanced page field experience. Combine different views as you wish. Faster Inputfield load times in page edit. UX changes. Lister and list view demo1 point
-
Hi @itsberni - looks like that is a new issue in recent versions of PW. I have committed a fix which seems to take care of things here - can you please test and let me know if it works for you?1 point
-
You'd be better off using Jumplinks as it is, as @eelkenet says, less problematic. However, if you really want to use mod_rewrite: # Place under RewriteEngine On RewriteRule ^oldpage.html$ /new-location/? [R=302,L] To make permanent, switch out 302 for 301.1 point
-
Hi. The documentation is still incomplete, sorry. That and similar options found in MarkupBlog.module should be passed to the respective methods. In this case, the method renderPosts(). Its third argument is $options. For instance: $blog = $modules->get('MarkupBlog'); $options = array('post_comments' => 1, 'post_author_text' => 'Authored by'); $posts = $pages->find('template=blog-post, limit=10r'); echo $blog->renderPosts($posts, false, $options); Please see the method MarkupBlog::getPostsOptions for all available options.1 point
-
Some more nice features copy&paste (eg from excel) that way the field could be used as an import-interface with live preview (much more userfriendly than CSV in my opinion) auto-add-rows (coulb be used as something like a repeater-replacement) hot.updateSettings({ colHeaders: ['Foods'], minCols: 1, maxCols: 1, rowHeaders: false, minRows: 1, minSpareRows: 1, }); auto-add-cols (like tagging) hot.updateSettings({ colHeaders: false, minCols: 1, minSpareCols: 1, rowHeaders: ['Foods'], minRows: 1, maxRows: 1, });1 point
-
hi @Juergen of course i can, there are a lot In general this field is useful whenever you need array- or matrix-like inputs. I use the field for my custom CRM to input the controlling values for my clients revenues. | jan | feb | mar ... ------------------------------------- goal 1 | 10.000 | 15.000 | 20.000 goal 2 | ... goal 3 It replaces lots of repeaters and not so userfriendly inputs. I didn't mention that you also have lots of possibilities of live-validating your data (you could for example make all cells with not properly formatted dates have a red background). You see the inputfields at the bottom of the screenshot? It was too complicated to build a table-like input for that values (month values). Pagetable is too bloated for that. Maybe the matrix inputfield would have been an option, but still i think the handsontable has a huge potential. So i ended up having a simple textfield input and telling my client to devide all values by commas... not the best way!! So whenever you have thought of a field telling your clients "one on each line" or "devided by comma..." this field could help you out.1 point
-
just for reference, i started to build a fieldtype module for handsontable:1 point
-
Well it is more a example of finding the right model to store things....if you would have 30 departments you would possible choose methode 2 or 3 for storing this kind of things...but the first model describes the most simpel way to store 1:1 connections - one member : one department.... Another thing that is here important this models are all show the usage of the pagetree in ProcessWire so a editor with a "small" company with "normal" amounth of departments could easy and fast manage his content....and we could fast get the data on frontend. On the Template side of life there you could read again on this from kongondo: These are just the basic examples for beginners - if you manage complex data and complex editing you could or better will use of ListerPro or even a own admin dashboard, hinding content from the pagetree that confuse the editors and make other strange but always possible things for managing complex content and at the same time give your users a good ui for editing this content. regards mr-fan1 point
-
Hi, As far as I know, since ProcessWire 3.0.29 we have RewriteRule "(^|/)\.(?!well-known)" - [F] there by default. See: https://processwire.com/blog/posts/pw-3.0.29/#summary-of-added-pull-requests1 point
-
This prints an ID of the page being referenced i.e. <h1>Index of all cars</h1> <?php $cars = $pages->find("template=car-entry"); foreach ($cars as $car): ?> <h2><?php echo $car->title; ?></h2> <p>MAKE: <?php echo $car->make; ?></p> <p>MODEL: <?php echo $car->model; ?></p> <p>YEAR: <?php echo $car->year; ?></p> <p>COLOUR: <?php echo $car->colour; ?></p> <p>SEATS: <?php echo $car->seats; ?></p> <p>TYPE: <?php echo $car->type; ?></p> <?php endforeach; ?> ...prints... Top of the range SUV MAKE: 1069 MODEL: 1078 YEAR: 1079 COLOUR: 1054 SEATS: 1057 TYPE: 1061 Instead... <h1>Index of all cars</h1> <?php $cars = $pages->find("template=car-entry"); foreach ($cars as $car): ?> <h2><?php echo $car->title; ?></h2> <p>MAKE: <?php echo $car->make->title; ?></p> <p>MODEL: <?php echo $car->model->title; ?></p> <p>YEAR: <?php echo $car->year->title; ?></p> <p>COLOUR: <?php echo $car->colour->title; ?></p> <p>SEATS: <?php echo $car->seats->title; ?></p> <p>TYPE: <?php echo $car->type->title; ?></p> <?php endforeach; ?> prints... Top of the range SUV MAKE: Land Rover MODEL: Range Rover YEAR: 2015 COLOUR: White SEATS: 5 TYPE: SUV Great guide @kongondo has been very helpful indeed this morning thanks.1 point