Leaderboard
Popular Content
Showing content with the highest reputation on 08/22/2017 in all areas
-
Hello, We have all our clients on ProcessWire. Even EIZO, a huge monitor manufacturer. Statistics won't make them switch, or any other thing. The only person that can make them switch is you. So what does the client really want? Just to update their website? That can be done faster and easier with ProcessWire. This is how I usually sell ProcessWire in.3 points
-
There are a couple of things that can shine out above all else. One of these things is cost-reduction. I've often said to my clients that using ProcessWire over WordPress is farmore cost efficient due to its simple flexibility. Naturally, this depends on the client and their needs, but, at the end of the day, putting together a site with PW is easier and far more straight-forward, and this needs to be communicated to the client. Unfortunately, I don't use WordPress at all, and so I don't have any statistics for you. What you really need to do is take all the known considerations and put them into context. Present it as a document, and you can win the client over. I'm surprised the WP=CMS mentality still exists...3 points
-
foreach($page->events as $event) { // empty tags in each iteration $tags = ''; // $event->options has multiple items (multi checkboxes)... // ...so, we loop through it foreach ($event->options as $o) { $tags .= $o->title . ' ';// join 'em up } // remove empty spaces $tags = trim($tags); echo "<div class='size1of2 {$tags}'>"; echo "<img src='{$event->image->url}'>"; echo "{$event->text_editor}"; echo "</div>"; } Could be made cleaner, shorter, etc... Is this a new WireArray method? I can't seem to find it3 points
-
@Mike Rockett Maybe you can convince @Mats to make it the default branch? https://github.com/madebymats/FieldtypeLeafletMapMarker/issues/103 points
-
$imgs = $page->images->getArray(); $chunks = array_chunk($imgs, 15); foreach($chunks as $chunk) { foreach($chunk as $img) { /* ... */ } } http://php.net/manual/en/function.array-chunk.php Unfortunately, there doesnt seem to be a chunk method available for WireArray class https://processwire.com/api/ref/wire-array/3 points
-
+1 If you happen to "echo" it with JavaScript (let's say you cannot use PHP to echo it into the search input box because that one has already been rendered) then you can do something like: <?php if ($q) : ?> <script type="text/javascript"> $('#my-search-query-input').val(htmlentities.decode('<?= $q ?>')); </script> <?php endif; ?> where htmlentities.decode is found in https://github.com/bb87/htmlentities $q must be already sanitized of course as @kongondo pointed out, my JS example is about turning htmlentities back into regular characters which does not happen when injecting $q using JS.3 points
-
What Adrian said. Just be sure to sanitise the values you echo back directly using htmlentities, for instance, like so: $results = $sanitizer->entities($q); echo "Search results for $results";3 points
-
Just echo $q where you want it: echo "Search results for $q";3 points
-
I use chocolatey to install packages on Windows. https://github.com/chocolatey/choco/wiki/Installation It's similar to apt on Debian or brew on Mac Here's the package for git https://chocolatey.org/packages/git.install2 points
-
Thanks for your help everyone! I have entered: $results = $sanitizer->entities($q); echo "Search results for $results"; in my template and everything is working perfectly.2 points
-
Hello @dragan, here is a tutorial by me about this topic: Regards, Andreas2 points
-
Issue will be fixed by Ryan in the next update https://github.com/processwire/processwire-issues/issues/344#issuecomment-3240612302 points
-
Hi, I do not think there are solid statistics to showcase but we have good blog posts you might use to pick the info you can use to persuade clients: https://processwire.com/blog/posts/building-canongate/ https://processwire.com/blog/posts/cms-critic-powered-by-processwire-again-case-study/ https://processwire.com/blog/posts/new-2.8-version-current-projects-and-pw-usage/ https://processwire.com/blog/posts/roadmap-2017/ etc... Also, you can find good case studies here: https://processwire.com/talk/forum/9-showcase/ https://processwire.com/talk/forum/16-case-studies/ https://weekly.pw/ (site of the week) Hope this helps.2 points
-
2 points
-
More than a year ago, with the last major Forum update because the current version does not support it anymore2 points
-
I meant explode() method, but wrote extract() instead https://processwire.com/api/ref/wire-array/explode/ And thankfully, that works @jploch. $tags = $page->options->explode('title'); $json = htmlspecialchars(json_encode($tags)); echo "<div data-category='$json'> ... </div>"; Thank you for the heads up @kongondo2 points
-
While the issue of opening an Edit page being very slow can be caused by repeaters, the save operation being very slow cannot. That leads me to suspect that this issue will not be solved by moving fields to an ajax loaded tab, correct me if I'm mistaken. Not free but if you really get stuck, this one can help: https://processwire.com/api/modules/profiler-pro/ especially since Ryan's person-to-person support comes with it as well: https://processwire.com/api/modules/profiler-pro/#here-to-help-you2 points
-
Since all these cards have "find out more" links, they appear to be linked to a page with more content. Start with creating a page field, say "servicePages" and add that to the template of the page that will show these cards. Then add a Textarea field to "service" template, say "serviceSummary", to store the summaries (or get it from another field instead). Then add the service pages that need to be shown in cards to servicePages field. You can then iterate over them and build your markup <?php foreach($page->servicePages as $sp): ?> <div class="service-card"> <img class="service-card__img" src="<?= $sp->images->first->size(300,200)->url ?>"/> <h2 class="service-card__title"><?= $sp->title ?></h2> <p class="service-card__summary"><?= $sp->serviceSummary ?></p> <a class="service-card__link" href="<?= $sp->url ?>">Mehr Erfahren</a> </div> <?php endforeach; ?>2 points
-
$q contains the search term: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/site-beginner/templates/search.php#L202 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
-
Sorting by published works for the last two years or so. (Not sure about before that or about PW 2.6 though) $pages->find('template=MyTemplate, limit=15, sort=-published') most certainly works.1 point
-
The first loop assigns each item in $page->related_products to $matrix_item, so you have one $matrix_item after the first loop. When you delete the first empty loop you will have no $matrix_item anymore in your if statement. When you delete the second one then you will have only one $matrix_item, from your first empty loop.1 point
-
hahaha! Yeah. Wow. I think bare wires touched in my head and I just typed out a version that I used for ages. MySQL version is 5.6.361 point
-
Hi, Isn't there a typo here? MySQL 5.0.11 is from about 2005.1 point
-
Hi @nickngqs and welcome to the forum It totally depends on your client and his needs and you are the only one that can know that if you want some stats: https://blog.sucuri.net/2017/01/hacked-website-report-2016q3.html but that may help you or may not...1 point
-
Well, considering the numbers, it's actually not a big surprise... bottom of https://wpisnotwp.com/ And like with most things, people who have never seen / used anything else, they can't even imagine that there's so many other options out there. Another reason is perhaps that those people in charge of choosing a CMS are hardly ever the people who have to use the system. The people who have to use a CMS on a daily basis are almost never asked about their opinion. Mostly, it's just a tiny part of their job, which they loathe. It's probably dull copy-and-paste-from-Word, 9 times out of 10.1 point
-
The most recent 0.8.0 exists on GH again: https://github.com/mikerockett/SimpleForms. Will bump to 0.9 soon after a few modifications have been made. With form building, I'm thinking of making use of the AbvFormBuilder method, but not sure yet. Still need to investigate how it all works.1 point
-
1 point
-
1 point
-
Many thanks @flydev , for digging deeper! I'm currently out of resources to code something like this. Was just searching for an already available solution to login via twitter. Registration should be done via PW only, where the PW username is set to the twitter username. (Frontend)-Login then should be done via Twitter only. So, if we would be able to retrieve the email address too, it would be more than I currently need.1 point
-
I assumed options field to return a type of WireArray, I've checked, it returns a SelectableOptionArray which extends WireArray, but I guess some methods are modified I tested this one and it works $tags = $page->options->getValues(); $tags = array_column($tags, 'title'); $json = htmlspecialchars(json_encode($tags)); echo "<div data-category='$json'> ... </div>"; In your JS, you can retrieve the array back like this let items = document.querySelectorAll('.item'); // filter items by category let xItems = items.filter(it => { let tags = JSON.parse(item.dataset.category); // tags is an array return tags.indexOf('category-x') > -1; })1 point
-
1 point
-
Wanted to continue developing this today, but it appears I've lost the latest source for it. After removing it from GH (can't remember why I did that), I kept a local copy and can't seem to locate it. Will continue looking and re-commit to GH. I don't want to call it RockettForms anymore (I know we voted). As the module is dev-centric, I'd like to use an apt name, like DevForms or something. Not keen on keeping it as SimpleForms due to possible confusion between Simple Contact Form. Will update you all when I find the source (it has to be somewhere, right? ?). Update: I appear to have found it! Will need to do some work on it before I commit a newer version.1 point
-
1 point
-
As an alternative to using classes to filter, you can convert categories into JSON and inject into HTML as data attributes. I haven't tried this, but it should work. $tags = $event->options->extract('title'); $json = htmlspecialchars(json_encode($tags)); echo "<div data-category='$json'> ... </div>"; https://stackoverflow.com/a/94304721 point
-
no need for a tutorial - it's too simple just add a fieldsettab to your page, save it, then you'll get a warning and a second field called yourfield_END. place your fields in between those fields and they will be presented in a tab. there is a little issue with ajax tabs though: https://github.com/processwire/processwire-issues/issues/332 are you using tracy debugger? are you using any hooks? any modules?1 point
-
Some more precisions : We can be able to code an adapter for Twitter application-only, and this is the list of what we can do with : Pull user timelines; Access friends and followers of any account; Access lists resources; Search in Tweets; Retrieve any user information; So I must assume we can get at least the email and/or the firstname/lastname or a nickname. @horst let me know if you will think to code something about that or I will give a try.1 point
-
1 point
-
The 3.x API reference pages are build from the docblocks in the core files. So it's already on github and updateable via PRs.1 point
-
Now, the "package manager"; From this window, you can create or delete a package, and also download a packages from the "server backups folder" to your computer. But the best feature is that you can "sync" packages stored on a third-party provider. This mean that the module will check for existing packages on GoogleDrive, Dropbox or whatever (it depend on how you configured Duplicator) and list them so you can delete or download them to your computer, and deploy your nice website in a minute! In the following example, I have packages on my Local Server, on GoogleDrive and Dropbox :1 point
-
My 2 cents on Quill.js--- use something else ---if you want to extend it's document model in any meaningful way you will get very stuck... there have been some really bad design and architectural decisions that have made upgrades virtually impossible, if you are considering using quill.js take note that it does not support blocks within blocks, and the delta format doesn't support nesting... a div within it's default p tag is not possible, so tables are not possible, a simple div is not possible even break handling is very difficult, br tags are wrapped in P tags which are blocks... The community is not great, the docs are woeful, they don't describe advanced functionality because advanced functionality is not possible-- there is bad blood because the developers systematically delete any issues related to the aforementioned issues, it's almost as if they're trying to make it look better to secure sponsorship..... you will find if you dig into the user extensions, they're all half baked because there are intractable issues with the framework...perhaps it'll sort itself out with a rewrite in version 2.0. ... for now I would recommend looking at slate.js or prosemirror because those have first class data models with nesting, they also have issues but I have more faith these issues can be resolved.1 point
-
Only as an information: I have opened a new github issue at https://github.com/processwire/processwire-issues/issues/3441 point
-
Welcome @fabjeck, Having different markup for different templates is what the markup regions feature is all about. First, make sure you are up-to-speed with markup regions by reading the related blog posts: https://processwire.com/blog/posts/processwire-3.0.49-introduces-a-new-template-file-strategy/ https://processwire.com/blog/posts/processwire-3.0.50-core-updates/ https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/ Regarding the #content markup in _main.php and your "normal" template file (let's say it is called "basic-page.php") there are two approaches - either is fine; it's just whatever you find easier to manage. Note that I am only showing a portion of _main.php below - this file needs to include complete HTML page markup: doctype, <head>, <body>, etc. Approach 1: put your normal #content markup in _main.php and leave basic-page.php empty of markup. _main.php <div id="content"> <!-- Your normal markup here --> <h1><?= $page->title ?></h1> <!-- etc --> </div> basic-page.php - no markup Approach 2: put an empty #content region in _main.php and put your normal markup in basic-page.php _main.php <div id="content"></div> basic-page.php <div id="content"> <!-- Your normal markup here --> <h1><?= $page->title ?></h1> <!-- etc --> </div> And in either approach, your home.php is the same: <div id="content"> <!-- Your home markup here --> <section> <div class="slider"> <!-- Find and output some news pages using a selector --> </div> </section> <section> <div class="news"> <!-- Find and output some news pages using a different selector --> </div> </section> </div>1 point
-
When using the jQuery datepicker in the backend for each Datetime field the following javascript might do the job. I have used this on front-end level, but it should work fine on back-end too. var setDate, todayDate = new Date(); $('input[name=schedule_date_end]').attr('disabled', 'disabled'); $('input[name=schedule_date_start]').change(function() { setDate = $(this).val(); if(setDate!='') { $('input[type=text][name=schedule_date_end]').datepicker( 'option', 'minDate', setDate ).removeAttr('disabled'); } else { $('input[type=text][name=schedule_date_end]').datepicker( 'option', 'minDate', todayDate ).val('').attr('disabled', 'disabled'); } }); $('input[name=schedule_date_end]').change(function() { setDate = $(this).val(); if(setDate!='') { $('input[type=text][name=schedule_date_start]').datepicker( 'option', 'maxDate', setDate ).removeAttr('disabled'); } else { $('input[type=text][name=schedule_date_start]').datepicker( 'option', 'maxDate', null ); } }); To be able to use custom javascript in the back-end you could use Martijn's "Admin Custom Files" module for that.1 point