Leaderboard
Popular Content
Showing content with the highest reputation on 08/30/2018 in all areas
-
OK, so as promised, for a use-case with Functional Fields, here's a simple code example and a screenshot how it might look like in the backend: __fieldset('plain,textarea,rich,hello', 'jsStrings', 'Javascript Strings'); // $pages->get(1044)->functional->plain // how you would get it from anywhere in your templates and pages echo "<p>" . __text('your plain text', 'plain', 'Label Text for Plain Text String') . "</p>"; // $pages->get(1044)->functional->textarea // how you would get it from anywhere in your templates and pages echo "<p>" . nl2br(__textarea('your textarea text', 'textarea', 'Label Text for Textarea')) . "</p>"; // $pages->get(1044)->functional->rich // how you would get it from anywhere in your templates and pages echo "<div>" . __richtext('<p>your richtext</p>', 'rich', 'Label for WYSIWYG') . "</div>"; echo "<div>" . __richtext('<p>Hello Wörld!!!</p>', 'hello', 'Label for Hello World') . "</div>"; This is how it looks like in the backend. The big advantage imho is that you have the familiar user interface you're used to when you are also in charge of creating or editing PW-pages. It all seems familiar, and if you have a multi-lang setup, you can edit it all without page-reloads and navigating to another language.4 points
-
Hi Ivan, I think you can try to instantiate two parallel vars by calling the extention class names. At least you should give it a quick testing, if that works. I never have done this. $smtp = new WireMailSmtp(); $mgun = new WireMailMailGun(); You need to check if those initiated objects need to be passed any config data to work. EDIT: yep, and leave the predefined instance wire('mail') alone.3 points
-
Make the user page have a page reference field that lets you create new lists. This would let you either creat all lists in the website under a central page, or with a little hook work have each list of lists living under the user. Let the page reference field include this pages through the selector that return the selectable pages. My first though would be to use another page that relates each list-game with the extra info, you could probably add a hook that automatically adds a page somwhere which holds all this extra fields. Could be something like: - User -- Lists --- List 1 (holds a page reference field to all games) ---- Game 1 (for each game in the list parent field, a page here exists, holding extra fields that can be custom for this particular user) ---- Game 2 All possible with selectors and i think the owner selectro could help here: http://processwire.com/blog/posts/processwire-3.0.95-core-updates/ Doable out of the box with the page reference fields. This are just my first thoughts, maybe someone has a more elaborate solution or sees an error in my conception.3 points
-
Hi, this is one of examples how can be used ConfigurationForm module. 1. Create field "translate", fieldtype ConfigurationForm Fieldtype 2. In field setup create desired fields what would store translations (eg. textLanguage fields: readmore and submit, and textareaLanguage fields error and success) Please note how to setup these fields: There is no image for success field setup, but it is the same like for the "error note" (textarea, type: textareaLanguage, name: success). 3. In Actions tab, add "translate" field to desired template (eg. Home). 4. Press ProcessWire Save button (ignore blue Save button). 5. After, on Homepage, you will get this: 6. Write desired translations, please note to language switcher on inputfields right side. Press page Save button. How to render translations? 1. call field->subfield and echo it (subfield name). <?php // get main field (container where are all translations) // our translations are on Homepage $translate = $pages->get(1)->translate; //Submit echo $translate->submit; // Read more echo $translate->readmore // etc... ?> With this you can get elegant solution to store all needed translations, easy to add new and easy to administrate. Also if someone forget to write some translation, output would be default translation content. Regards.2 points
-
There‘ll certainly be a shift in what tools like google analytics need to be able to do in terms of preserving user privacy (and they already do), but I don‘t see anyone wanting to seriously build page counters in php again. Matomo (piwik) already exists and there are even new alternatives like fathom, which are already enough for simple needs.2 points
-
2 points
-
I found (trough smashing magazine) these two cool links with a good overview with all properties about grid and flexbox: http://grid.malven.co http://flexbox.malven.co2 points
-
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
-
In the last blog post I told you about how two-factor authentication was coming to the core and what our plans were. This week it’s ready to use in ProcessWire 3.0.109, so we’ll take a closer look at all the details and how to use it: https://processwire.com/blog/posts/processwire-3.0.109-adds-two-factor-authentication/1 point
-
This profile can be used as a business card or very simple blog. Requires the latest version processwire 3.0.101 !!! Milligram Site Profile For Processwire 3x with include functions like: MarkupRegions FunctionsAPI wireIncludeFile | wireRenderFile Essentially, this structure uses minimalist CSS framework Milligram and the Flexbox Grid System Gridlex Live Example CAN DOWNLOAD FROM THIS LINK ( Basic Version and simple Blog Version ) https://github.com/rafaoski/site-milligram https://github.com/rafaoski/site-milligram-blog Screenshot: If you want to use Laravel Mix you must first ensure that Node.js and NPM are installed on your machine. Basic example to Debian and Ubuntu based Linux distributions: Node.js curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs See more installation options LINK npm is installed with Node.js just check in linux terminal like below: node -v npm -v Set BrowserSync inside folder /templates/webpack.mix.js and change your dev url proxy: 'http://localhost/mix/', to your installation processwire folder like: proxy: 'http://localhost/your-processwire-installation-folder/', Next install npm packages in your templates folder with command npm install Now, boot up the dev server npm run watch, and you're all set go! On completion, use the command npm run production to build styles and scripts in the dist folder Simple Usage ( Basic Command ) Run npm install Watch npm run watch Build npm run production All files to Webpack build steps is inside file ( webpack.mix.js ) Folder With all SCSS files is inside templates/src/scss All build styles and scripts is inside the ( dist ) folder References: Milligram Gridlex Laravel Mix Feather Icons Web Font Loader Verlok Lazy Load Cookie Consent Particles.js1 point
-
I would like to just show my appreciation to ProcessWire and all the guys that have put work in to make it what it is now. I have use many, many CMS's in my time. Statamic, Drupal, WordPress, ConcreteCMS, CraftCMS etc... And they all have their strengths and weaknesses. But I can honestly say, ProcessWire is by FAR the best Content Management System I've ever, EVER used. I can honestly say the only weakness ProcessWire is the lack on eCommerce. But, that isn't even a weakness of ProcessWire. The tools are there for us to create an eCommerce system. I'm a front-end developer but with ProcessWire it empowers me to realise anything. Honestly, when one of the designers asks "Can we do this?" it feels so great to say YES! I, with very little backend experience built a real-estate system that completely runs on ProcessWire pulling in from an external feed (Vebra) and I did it with ease! I just wanted to say thank you, thank you for creating a framework in which, people like myself, who love front-end but find back-end daunting can pick it up and literally do anything with EASE. ProcessWire gives me so much confidence and makes me feel so good about myself. I've recently been working on an WooCommerce website, and I can't tell you how much I've been missing ProcessWire. Thank you @ryan for making a system that is so simple, even simpletons like myself can dream big. Lots of love, Tom Edit: Interestingly I feel like it would be easier to build an eCommerce system using ProcessWire than it would trying to completely reskin WooCommerce, like seriously, WooCommerce stop injecting markup and putting them in core functions.1 point
-
1 point
-
I think it should work everywhere. I just tested a bootstrapped page: <?php require './index.php'; $mail = \ProcessWire\wireMail(); $mail->to('test@gmail.com', 'Test User'); $mail->from = 'me@gmail.com'; $mail->subject('Test'); $mail->body('Blah blah'); $numSent = $mail->send(); and Tracy captured it just fine: The one key thing I would do is ensure that Mail Interceptor is enabled in the config settings, rather than via Sticky in the Panel Selector so that it can't be disabled accidentally. I would also check the "Force Guest users into Development mode on localhost" option so that even if you're not logged in, Tracy will be active and intercepting an emails. Also, for your own peace of mind, I would suggest checking everything with your email address as the only TO/CC/BCC until you are convinced that Tracy is working as expected. I find it invaluable when testing all sorts of emails.1 point
-
Thanks - now I understand all the rationale here. My approach is to simply permanently turn on the Mail Interceptor panel in Tracy - it logs calls to send emails rather than sending them. And when you want to test send to yourself instead of the actual recipients, it can handle that as well. Just another option if you think it would be ok in your workflow.1 point
-
If you want the customer to easily update the fields you can create a translate and translate_string templates. You will be able to easily create translations using pages ... Next, create function inside the _translate file to show translateable field title as in the movie, for example: <?php namespace ProcessWire; function trStr($page, $str) { $tr_page = pages()->get("/translate/$page/")->title; if($tr_page) { return $tr_page; } else { return $str; } } // Translate Strings page()->ts = [ 'your_awesome_string' => trStr('your-awesome-string', __('Your Awesome Strings')), ]; And display on the site: <h1><?=page()->ts['your_awesome_string']?></h1> You can download this profile from here:1 point
-
I'm afraid you do ? What you do, is define all the strings in one template. Then create a page with said template, and you'll see that for each string PW creates input fields. The name "Functional Fields" is perhaps a bit misleading. PW doesn't create a field for each string. I'll post some screenshots / code examples a bit later...1 point
-
Thanks for your reply @rafaoski – much appreciated. I guess if I wanted the client to update this the only way would be CMS fields, right? EDIT: I had a look at Functional Fields (and this is what I remembered reading about) but I cannot see the benefit of just creating a normal text field, especially if you have to create a field anyway? Probably missing the point entirely.1 point
-
You don't need to track an IP unless you are requiring information unique to a user. Just the timestamp in a mysql table is sufficient to give you a hit counter by date. There are quite a few apache log analyzers out there, but I haven't used them since google provides the information for me. I prefer to not make things more complicated than need be.1 point
-
Howdy @mr-fan! This is just my $.02. While PW can certainly handle such a simple task, to me, it is overkill. And I don't want 100K+ pages in my tree. In one project, I use a simple mysql table to store the unix timestamp as a simple counter. In another project, I use PW's features to track more complex data for affiliates. Regardless of the method you use, google analytics gives you the visitor data you used to get with dedicated visitor tracking scripts. Even if you store visitor IP with the timestamp, you can use php's dns lookup to gather information on a desired ip address, although I don't recommend using that function on every ip entry. I haven't noticed any performance degradation with either method. But I'm looking at only a few hundred to a few thousands hit per day on those domains. Your milage may vary. ? Hope this helps.1 point
-
Also I wouldn't use "$files" as that is a PW template variable. https://processwire.com/api/ref/files/1 point
-
That replacement needs to be inside the foreach. You probably also want to replace with " " instead of ""1 point
-
1 point
-
@Krlos If I'm not mistaken to get pagefileSecure working you should restrict guest access to the template where your PDFs are stored.1 point
-
Just tried out 2-factor auth for the first time - works like a charm! (both with email and with Google Authenticator).1 point
-
Anyone interested in the module with added region option and with added o:deliverytime option can use my fork at https://github.com/gebeer/WireMailMailgun1 point
-
I'm so glad I wanted to share that with you today. Since November 2017, all of the company's infrastructure is built on ProcessWire. Whether it is the showcase website or the millions of transactions recorded in the database as pages or all the custom modules to interact with the company's data. Just to say that I feel lucky to work all the day with what I love, and when I remember that I was demoralized thinking I had to learn Wordpress or I don't know what, because before ProcessWire I never worked with a CMS and it was becoming vital. Then I stumbled on ProcessWire (hooray!). And now, a new step for me appeared yesterday. I have a trainee for a month. And my task is to teach him how to work with ProcessWire! This make me really proud ! Have a nice day everyone and again, thanks to this community and this software! ?1 point
-
Ok, this was a very weird problem. It turns out that when submitting a form with JS, value of the submit button isn't posted with the form, that's why if ($input->post->submitForm) wasn't working as it would normally. We've solved the problem by checking for another field, `stripeToken`, to ensure that the form has been posted properly before processing the credit card. https://stackoverflow.com/questions/1709301/javascript-submit-does-not-include-submit-button-value Another way to solve this problem would be listening to submit button click instead of form submit, then preventing default action, validating the form with Stripe, and actually triggering click on the button.1 point
-
Here's the simplified version of your JS. One thing you should look out for is that inside your form submit handler, you were preventing default submit action, but then submitting again without removing the handler, which caused the same routine to run repeatedly (submit? can't -> validate -> submit -> can't ,,, repeat). When the form validates and you're ready to submit, remove the handler (that prevents the default action), so that the form can submit properly. // Stripe API var stripe = Stripe('pk_test_*****************'); var elements = stripe.elements(); // DOM Elements var form = document.getElementById('payment-form'); var displayError = document.getElementById('card-errors'); // Card style var style = { base: { fontSize: '16px', lineHeight: '24px' } }; // Create an instance of the card Element // Add an instance of the card Element into the `card-element` <div> var card = elements.create('card', {style: style}); card.mount('#card-number'); card.addEventListener('change', function (event) { if (event.error) showError(event.error.message); else showError(); // remove previous error }); form.addEventListener('submit', handleSubmit); function handleSubmit(event) { event.preventDefault(); stripe.createToken(card).then(function (result) { if (result.error) { return showError(result.error.message); } // remove previous errors showError(); // Send the token to your server injectToken(result.token.id); // prevent infinite loop form.removeEventListener('submit', handleSubmit); // send the form form.submit(); }); } function injectToken(tokenId) { // Insert the token ID into the form so it gets submitted to the server var tokenInput = document.createElement('input'); tokenInput.type = 'hidden'; tokenInput.name = 'stripeToken'; tokenInput.value = tokenId; form.appendChild(tokenInput); } function showError(errorMessage) { // if error is not given, remove previous error errorMessage = errorMessage || ''; displayError.textContent = errorMessage; }1 point
-
Hi Peter, You can easily limit the images like this: foreach($i->Images->find("limit=5") as $image) {1 point