Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/20/2017 in all areas

  1. I really think that using frameworks for medium to complex projects can help a lot, reducing significantly the time required when dealing with browser issues. I can't see a REALLY good reason, from a technical and a business point-of-view, not to use one as nowadays as almost all of them have generally good documentation, are battle-tested in all major browser versions. I really don't want to remember you how it was like in the days of testing a site over and over again in Netscape and IE. When I'm planning a project I decide which framework to choose based on these questions: 1. Will the project have many different pages layouts? 2. The client's brand require a custom design? Meaning, will the developer spend a lot of time creating a layout that's specific for the project, or the project can have a more default layout (based on the framework's default styles/components) 3. How much time/budget do I have to work on the project? 4. In the future, will be other people maintaining the project of just me? And if so, are we going to be thankful as I used a framework with good docs or should I expect a desire to break my (own) knees with a baseball bat? The choices can be, for instance: Zurb Foundation – for projects that require a lot of different pages down the road and a lot of customization. And I always use the Foundation Stack to have maximum control of the settings. Foundation is, like they said, the most advanced framework out there. Twitter Bootstrap – If I'm creating something with Laravel and it's an internal project, tool, or just a prototype, as the Laravel community have a lot of things already done using Bootstrap that can help. UIKIT – If the project can benefit from its more opinionated designed elements, meaning: can I stick with the defaults and do just a little customization and call it a day? --- Unless your project really needs to have the smaller CSS/JS footprint possible, like if you are targeting some users with crappy 2G connections and/or old browsers, you can go with a framework like the above. I used a lot of Foundation's CSS components on ricardo-vargas.com and the CSS is less than 30kb gzipped. --- For personal projects, I usually search around and give smaller frameworks like Tachyons, Kube, Bulma a try as it's fun!
    5 points
  2. After todays events, I tend to agree with this. Last time I let the internet convince me about stuff I already know about
    3 points
  3. The search is over, thanks to @Juergen providing login to the site in question. I have modified the way the controls are added, now it happens when you hover on the admindatatable, this seems to be the most reliable way. See the modified file attached. BatchChildEditor.js
    3 points
  4. It's a neverending question, you should choose one (or not choose any) and stick with that, until you find more attractive one Personally I use a grid mixin and use custom CSS for everything. I can't say this is the best way, that always depends on the situation. For a larger project with multiple devs I would probably use a framework.
    3 points
  5. If you mean "per individual email" then it works like that for all WireMails $mail->header("Reply-To", $emailAddress);
    3 points
  6. Hi @Vikestart You should use all power of selectors for that. For example, if you want to output your list of post on home page, you can do $posts = $pages->get("/categories/)->children("sort=-data"); Read more about selectors in PW https://processwire.com/api/selectors/
    3 points
  7. u want.to set for.use serveors timezine no client not big prolem if.u set wrong
    2 points
  8. Interesting points @Sérgio. That website is very impressive too, thanks for sharing. I haven't gotten into anything as large scale as that yet so I'm guessing I don't see the need for a framework. With that said, I don't think this quest is fully over Don't! I just can't cope with it. Although it is slightly addicting in a weird way.
    2 points
  9. Thanks–fixed. The API reference is already showing all the docs available for each method, so linking to line numbers would focus in on the actual code/implementation behind the method, rather than the documentation. When it comes to docs, it's about the interface, not the implementation. The interfaces rarely change, whereas the implementations change all the time. Coding towards something other the method's interface could be problematic. That's why I think the code-behind-the-method probably shouldn't be part of the documentation, except maybe in cases where the docs suggest looking at the method directly. This refreshes once every 24 hours. This is not intended, I'll fix this–thanks. Btw the "c=" indicates number of changed fields when possible, but mainly c=0 means no changes, and c=1 means there were changes.
    2 points
  10. It is very difficult to choose a framework, that's why I never use one . I just use SASS with normalize.css, bourbon bitter and a grid system I've built. This requires more work at first, but you avoid the bloat.
    2 points
  11. Hi @Zeka Although this does the trick to prevent log out, I still would want to get the client's real IP address as stated. I found that this is not possible right now as the getIP method Processwire using do not have a place for setting to read new header. I added a feature request for this issue here: https://github.com/processwire/processwire-requests/issues/92 Edit: Sorry, I have made a mistake. Setting $config->sessionFingerprint do nothing to IP storing. The way to get the forawrded client's IP is using something like $sessoin->getIP(false, 2); instead of $sessoin->getIP(); The key is the second parameter. I got logged out even though I set $config->sessionFingerprint = 12; If I find out the reason I will report back here. I can confirm that my own IP address is fixed.
    2 points
  12. That's the key I have just pushed a new version which fixes the Position > Replace setting when there is a custom Children Tab label defined for the template (including multi-language labels). Could you please confirm that it fixes things at your end? I still don't know about the toggle all checkboxes - would really appreciate if you could do some debugging on this when you get a minute.
    2 points
  13. Site I'm (possibly) about to work on: $8,700 – $10,440 Whaaaaa? That's around £7000. I don't think the "That's a bit beyond our budget" answer would even come, they'd be lying stone cold dead on the floor from the shock.
    2 points
  14. Wild guess, maybe it's only finding the first blog post, and not the others. I'm not sure $blog_page->labels = $labelIDS; works, since it's assigning plain arrays to a PageArray (as all page fields --set to accept multiple pages-- are). Try this one. I replaced multiple calls to DB with $pages->findIds, which makes single call, so it's faster. I also replaced $blog_page->labels = $labelIDS; with PageArray::add($ids) method, which can take single id or array of ids (not documented but it works). As labels in your XML set as label1|label2, suitable as $pages selector, you dont need to split it. Uncomment echo statements to see what pages are the issue <row> <id>1041</id> <labels>lifestyle|savings</labels> </row> <?php foreach ($xml->row as $items) { //get page id to update and set output formatting to false $blog_page = $pages->get('id='.$items->id); if(! $blog_page->id) { // echo for debugging // echo "Cant find page with id $items->id <br/>"; continue; } // Get matching page ids at once, returns array of ids // https://processwire.com/api/ref/pages/find-i-ds/ $labelIDS = $pages->findIds("name=$items->labels"); if(! count($labelIDS)) { // echo for debugging // echo "Cant find labels $items->labels for page $items->id\n"; continue; } $blog_page->of(false); $blog_page->labels->add($labelIDS); $blog_page->save(); }
    2 points
  15. High Performance Browser Networking © Ilya Grigorik the complete book is online now for free reading: https://hpbn.co/
    1 point
  16. Been looking over some frameworks, wanted to try a few today but what an utter nightmare. I mean how hard does this need to be? A site only looks one way, the only CSS needed is the stuff that's used, to make it look that one way. Having 10 options for a simple card is great, but I'll only use one, and I guess the code for the other 9 is still there, slowing down my site for no reason. This article springs to mind when looking over these things: http://www.lifehack.org/articles/communication/are-you-suffering-from-the-curse-knowledge.html I reckon when a developer goes into a cafe and orders a cup of tea, they don't get a cup of tea. They get a cup of hot water, 4 types of teabag, 3 spoons, 2 types of sugar and 3 types of milk. Then they make a framework in order to put these things together. Maybe I need to look into a more minimal framework this one looks interesting: https://chalarangelo.github.io/mini.css/
    1 point
  17. Thanks, I also think yours is better. At the time I wrote the original Js I wasn't aware of .one(), I would use that too.
    1 point
  18. Thank you both for getting to the bottom of this! @tpr - I did tweak your changes slightly to use "one" and "mouseover": $(document).one('mouseover', bce_adminDataTableSelector, function () { instead of "on" and "hover": $(document).on('hover', bce_adminDataTableSelector, function () { so that it's triggered only once. I know you had another check in there to see if the controls were already added, but I still think this an improvement. Do you see any issues with this change?
    1 point
  19. Guys, if you have a lot of time to spare, you can kill some by checking out this list: https://github.com/neiesc/ListOfMinimalistFrameworks
    1 point
  20. Tinifying images is ONLY useful on the final variations. Tinifying an original source image is completly WRONG. This tinifying is often misunderstood. You can resize an image on upload to variuos varirations and also tinify them, if you exactly know which variations you will need around in your site. Here is an example how to hook into upload and process something with the image:
    1 point
  21. or write some CSS and don't rely on frameworks
    1 point
  22. The thumbnail generation does run when this code is executed and the file corresponding to the thumbnail does not exist at that time.
    1 point
  23. Yepp, the main goal would be to detect where it stops at your side Btw "variable length" in these cases are the number of items found in the DOM. So if it's 0 for "$(bce_adminDataTableSelector).length" it means the html tag is not found in the DOM. I guess you can't provide login details via PM, that would make things easier
    1 point
  24. What I have found out is the following. In the JS-file there is the part where the additional function will be created (approx. at line 218) function addBceColumnControls() { //this timeout is a bit of a hack that should be improved in the future setTimeout(function () { if (bce_isColumnControlsAdded) { return false; } if ($(bce_adminDataTableSelector).length === 0) { return false; } // do not add controls if there is no more than 1 row if ($(bce_adminDataTableSelector + ' tbody tr').length <= 1) { return false; } //$(bce_adminDataTableSelector + ' tbody').on('click', 'input[type="checkbox"], i.InputfieldChildTableRowDeleteLink', function () { $(bce_adminDataTableSelector + ' tbody').on('click', 'input[type="checkbox"]', function () { setColumnControlStates($(this)); }); // add new controls for (var i = 0; i < bce_allowedColumnControls.length; i++) { var currentControl = bce_allowedColumnControls[i]; // skip non-existing elements if (!$(currentControl).length) { continue; } // get index of first checkbox in the first row var index = $(bce_adminDataTableSelector + ' ' + currentControl + ':eq(0)').parent().index(); // do the add $(bce_adminDataTableSelector + ' th:eq(' + index + ')').prepend($(bce_toggleControl)); // set initial checkbox states setColumnControlStates($(bce_adminDataTableSelector + ' th:eq(' + index + ') input')); // add event addColumnControlEvent(bce_adminDataTableSelector, currentControl, index); } // disable thead break to multiline $(bce_adminDataTableSelector + ' thead').css('white-space', 'nowrap'); bce_isColumnControlsAdded = true; return true; }, 1000); } There are a lot of if-statements depending on the length of a variable. It is not possible to log the variables inside this function. Fe. if I want to check the variable length of the second if statement if ($(bce_adminDataTableSelector).length === 0) { return false; } with console.log(bce_adminDataTableSelector.length); or console.log($(bce_adminDataTableSelector).length); nothing will be returned, so maybe the if-statements doesnt work in this case.
    1 point
  25. mini.css at 7KB gzipped is not much different than Foundation framework at 12KB gzipped or Foundation at 19KB gzipped, both of which are a lot more feature packed. This one is much smaller at 2KB gzipped that you can just inject it into HTML and not worry about extra bloat. Great if you're building something small and dont want to override much. https://milligram.github.io/
    1 point
  26. Of course Here is what I have added: a = "test"; console.log(a,length); console.log(bce_fieldID,length); // add column controls (top, bottom and replace modes) $(document).on('loaded', '#' + bce_fieldID, function () { addBceColumnControls(); }); And this is what I got: As you can see the variable "bce_fieldsetID" consist of 23 letters (= ProcessPageEditChildren) So this variable of the if statement is there!!!
    1 point
  27. OK I have tried the following: I have added the following script to the admin.php file <script type="text/javascript"> a = "test"; console.log(a.length); obj = bce_toggleControl; console.log(obj.length); </script> The variable a with the content "test" is only to check if the console.log works. I got the following output: As you can see the variable "a" has a length of 4 - this is correct. But the variable "bce_toggleControl" which is responsible for the checkbox doesnt return anything. I have also tried it with bce_fieldID depending on this snippet // add column controls (top, bottom and replace modes) $(document).on('loaded', '#' + bce_fieldID, function () { addBceColumnControls(); }); Same result
    1 point
  28. Thanks - a script can fail even if there are no errors, eg. in this case probably the markup can't be added because the target element is not found in the DOM (maybe the selector used doesn't match anything). It's hard to tell anything else without seeing it. I would try using console.log(obj.length); where object is the target (jQuery) element. If it's 1 (shown in the console) then it's there, otherwise not.
    1 point
  29. Haven't seen those errors before. Did you check the content of the database itself? Like are the tables (i.e. "pages") really there? Also, you say you upgraded from 2.4 to 2.8 and then you exported the site profile? Why didn't you upgrade directly from 2.8 to 3.x replacing the /wire/, index.php and .htaccess? I've upgraded many sites, but haven't ever used the site profile export/import construction.
    1 point
  30. Now I have tested it with the browser console. As you can see, there are no JS-errors: In line 165 of the BatchChildEditor.js the checkbox markup will be declared: bce_toggleControl = '<input type="checkbox" class="' + bce_columnControlClass + '" style="position: relative; top: 2px; margin-right: 4px;" />', But this markup will not be added next to tableheader cells. I havent been working with the browser console so far. Maybe I am doing something wrong or I am in the wrong part of the console, but I cannot find an error.
    1 point
  31. I am following a similar approach, but I don't reduce objects to simpler states, I just pass them along to partial templates and use PW specific properties. Your approach is more portable with better separation, but unless you're thinking of migrating your code/template to other systems, where you'll be passing around arrays with same set of same keys, it doesn't make much difference. And not mapping objects to arrays presumably reduces process time/RAM usage as well. I think of my partial templates as components. Although much of hard work is abstracted away from them inside actual template files, components have specific functions available to them. Here's my navigation # Navigation is defined in YAML Blog: href: /blog/ class: highlight Labs: href: /labs/ Works: href: /works/ GitHub: href: https://github.com/abdusco target: _blank and here's its partial <?php namespace Processwire; /* @var $links WireArray */ $linkList = []; if (!function_exists('renderLinks')) { function renderLinks($links, $linkClass) { $out = []; foreach ($links as $name => $attrs) { if(page()->path === $attrs['href']) continue; $anchor = ''; // generate attributes string $attrs = $links[$name]; $class = $attrs['class'] ?? ''; $attrs['class'] = $class . $linkClass; foreach ($attrs as $attr => $val) $anchor .= " $attr='$val'"; $anchor = "<a $anchor>$name</a>"; $out[] = $anchor; } return $out; } } ?> <nav class="pad t--bold"> <?php foreach (renderLinks($links, 'footer-nav__link pad inline-block link link--b-no') as $link) echo $link; ?> </nav> Since I'll be passing the same YAML array, and not use renderLinks anywhere else, I keep them inside my partial. If I need to use this navigation elsewhere, I'd probably abstract link class (footer-nav__link) as a parameter I pass inside wireRenderFile, or refactor that class into a more general one.
    1 point
  32. Hi @xfroggy There is Mutisite Module https://github.com/somatonic/Multisite/tree/dev
    1 point
  33. Thanks @adrian, now the "double list" problem is gone. Your fix works
    1 point
  34. In the modules config screen you can set it under "sender_reply". Also a "sender_errors_to" is available. If you need to set it dynamically, you must go the workaround with modifying module config-settings via API. If so, you will find examples here in this thread or the forums in general. you can use this: $data = wire('modules')->getModuleConfigData("WireMailSmtp"); // or, regarding on scope, $data = $modules->getModuleConfigData("WireMailSmtp"); than modify the reply adress: $data["sender_reply"] = "you@example.com"; after modifying, you can write it back: wire('modules')->saveModuleConfigData("WireMailSmtp", $data); // or $modules->saveModuleConfigData("WireMailSmtp", $data);
    1 point
  35. Just used this module for adding a video link to images. There was a glitch that there was no indication on the thumbnails whether there is a link added or not, so I put together a small js/css combo to add an icon: Here is the corresponding code - dirty but works
    1 point
  36. @Peejay there are some more little improvements coming up but there are still a few annoyances. But there will be updates soon, sorry guys for the delays, but free time is sparse these days.
    1 point
  37. I'm in the opposite camp recently. I've been writing my own CSS for about a decade (I don't like using 'grid-4-is-4-columns' and all that in my HTML, I prefer class names that describe the contained content, then style them out in the CSS). However, this is becoming too time consuming for exactly the reasons you mention above, want some parallax, I have to go find a jquery library, then some custom css, the bootstrap guys are already having a tea break Maybe the grass isn't always greener, but I have to try at least one proper framework to make a fair decision! Currently looking at uikit and bootstrap 4 (yes, I know this means adding a bunch of dumb sounding classes all over my HTML).
    1 point
  38. Love this! Thanks @SiNNuT been waiting for css grid forever, ditched floats for flexbox on a recent site but it's really no substitute for a proper grid system (previously using bourbon/neat).
    1 point
  39. Dear @flydev! Just wanted to let you know that this module is eagerly awaited. Just in case you had a doubt)) Any news?
    1 point
  40. @ryanC, have you set field to accept single file, or with no limits? If you've set (or didn't change anything) Max files allowed as 0, then $match->result_pic is a WireArray, if it's 1, then it's a single Pagefile. Something like this should work. <?php foreach($matches as $match) { echo "<li><a href='$match->url'>$match->title</a>"; echo "<div class='summary'>$match->summary</div></li>"; // this should work no matter what // check if result_pic is a WireArray if($match->result_pic->count) { $url = $match->result_pic->first()->url; } else { // it's a Pageimage $url = $match->result_pic->url; } echo "<img src='$url'>"; If you know what type of image field this is, then you can remove checks with if statement, and use one or the other $url and echo directly. The reason it wasn't working is that PHP expects simple expressions inside double quoted string "" for string interpolation, so only $a, or $a->b works, the remaining parts are echoed as strings. This would mean echo "<img src='$match->result_pic->first()->url'>"; would only interpolate the first $match->result_pic part, and replace it (with presumably the id of the image). For more info http://php.net/manual/en/language.types.string.php#language.types.string.parsing
    1 point
  41. The easiest way to install modules is to install by Class Name. That will ensure the directory name is correct. If a module isn't in the modules directory, you should use the URL (to the zip), or the Upload option. The old manual unzip and move to site/modules doesn't make any sense anymore.
    1 point
  42. Here's how you might dynamically create it with ProcessWire without tinkering with .htaccess files. Create a new template, call it robots, and set its URLs > Should page URLs end with a slash setting to no, and Files > Content-Type to text/plain. You should tick disable Append file and Prepend file options as well. Optionally set its Family > May this page have children to no, and Family > Can this template be used for new pages to one. Family > Optionally Set allowed templates for parents to home only. Create a new page under homepage, set its template to robots, and name as robots.txt. Create a new template file at /site/templates/robots.php, inside it you type <?php namespace Processwire; // render different robots.txt depending on your own conditions. if ($config->debug) { // use PHP_EOL to create multiline strings echo <<<PHP_EOL User-agent: * Disallow: / PHP_EOL; } else { echo <<<PHP_EOL User-agent: * Disallow: PHP_EOL; } and done. You should be able to see robots.txt at the url /robots.txt.
    1 point
  43. Hi @Tyssen https://www.andrewversalle.com/blog/environment-specific-robotstxt-files
    1 point
  44. @GuruMeditation - turns out there was more to those space issues. I have alerted Ryan here:
    1 point
  45. Will it though? That's true for $pages>find() selectors but I think for a repeater field the whole PageArray is loaded to memory regardless. Or is there another efficiency?
    1 point
  46. If you have lots of repeater items, this will be more efficient: $pages->get("/testimonials/)->testimonials_repeater->find("limit=4, sort=random");
    1 point
  47. OH BTW, in terms of marketing and Design, i think Craft does an excellent job. We nearly went for this becaus it just "felt" so nice... the website and the backend looks amazing. PW to me seems to be the best option around there at the moment, it has a great community, awesome API, Simplicity also for admins, this could attract so many people when presented well...
    1 point
  48. Hi guys, after several months I finally released my most complex ProcessWire project so far: https://ricardo-vargas.com About the client: Ricardo Vargas is a specialist in project management and strategy implementation. He's an accredited professional and author of several books. Since 2007, he publishes a bilingual podcast about project management with millions of episodes listened. From 2012 to 2016, he worked for the United Nations Office for Project Services (UNOPS) in Copenhagen, Denmark. He currently lives in Portugal. The previous site was developed in 2009 using Wordpress by my team at the agency I was working for. In 2011, Ricardo invited me to work with him and I started to maintain the site ever since. The front-end side was good, performance-wise, but the backend started to become horrendous to work with so in 2012 I started my quest to find a better CMS and found PW. After developing small projects and messing around with it I convinced my client/boss last year to let me develop his new website with PW. I did all the stuff (design, frontend, backend, and server ops) so if you find something buggy or strange, let me know, please! I'll appreciate! The site is currently running on Digital Ocean droplet with 2GB of RAM. Nginx and Cloudflare (for SSL mostly). I'm using forge.laravel.com to manage it. Approx. 3,000 unique users per day doing 72,421 requests (Cloudflare stats). Key features: Pages are loaded with ajax using https://github.com/miguel-perez/smoothState.js so the podcast player (Soundmanager ) can continue to play the podcast episode as the user navigates other pages. Member area where the user can see the books his own (and download their files) and also see his bookmarks and reports. I imported and the users (+ 4k) from the WP database and decided to get rid of passwords (the future!) so after some research and tests, I chose Auth0 login system. I've mentioned the member area on this topic (there are a couple of screenshots there): Modules used AdminLinksInFrontend AdminOnSteroids AdminTemplateColumns Auth0Login (Custom made) BatchChildEditor ClearCacheAdmin FieldtypeRuntimeMarkup FlickrAPI (Custom made) FormBuilder InputfieldCKEditor MarkInPageTree MarkupLoadRSS PageReferencesTab PageViews (Custom made) PduReport (Custom made) PrevNextTabs ProCache ProDrafts ProcessDatabaseBackups ProcessJumplinks ProcessSendyAPI (Custom made) ProcessWireUpgrade ReaderAreaManager (Custom made) SlideshareAPI (Custom made) TemplateLatteReplace TextformatterAccordion TextformatterHannaCode TextformatterMarkExternalLinks TextformatterMultiValue TracyDebugger UserBookmarks (Custom made) WireMailMailgun importPagesCSV
    1 point
  49. I'm not sure, but it may doing something when trashing a page and save that page again so it ends up in trash. Very likely. Your solution is perfect to go. But maybe you can aslo just use the Pages::trashed instead as this would be just once after the page is trashed.
    1 point
  50. Try clearing the sessions and caches in assets folder. If theres no sessions folder, create one. Enable debug mode in config.php. Create new password like martijn explains.
    1 point
×
×
  • Create New...