Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/04/2016 in all areas

  1. I'm subscribed to Carl Alexander's newsletter, a developer how knows quite a lot about WordPress development. Today's topic is pretty interesting, quote: Wow! That's quite an invention No more comment. Should anybody be interested in the details: https://carlalexander.ca/designing-class-simple-wordpress-queries/
    4 points
  2. I try to load internal urls using ... <a href='/path/to/page/'>path to modal</a> ... instead of ... <a href='http://domain.com/path/to/page/'>path to modal</a> so either way the content is loaded depending on how the request is made. If you really want to force https you can set it in the template settings: Do you have a link we can see how the url is populated?
    4 points
  3. I'm not sure what exactly you're building there, but maybe you could use something like flysystem's dropbox adapter to let people upload such big files to dropbox, which is far less error prone, and import from there. Tech. php can handle those files, but some hick-up in your connection (on mobile) or anything will corrupt any upload and you need to start over again. Edit: Also this is probably not a ProcessWire specific issue, until the file is uploaded 100% it's not even touched by processwire.
    4 points
  4. @tpr https://github.com/CanRau/MarkupCookieConsent/commit/3f7b71a659759693ae5dcdeb7436887a5a2c97f4
    3 points
  5. Thanks arjen, this did the trick, turned out couple of templates were set to http only, after I changed that tot http or https, problem was gone, so thanks again! cstevensjr, thanks for your thoughts, I had already tried that, should have said so, but all works now, thanks!
    3 points
  6. You can also make a change in your .htaccess file From To
    3 points
  7. Make the file /site/config.php temporarily writeable and add this line: $config->httpHost = 'domainname.com'; You can also add a "Whitelist" with the variants you want to allow in this way: $config->httpHosts = array('yourdomain.com', 'www.yourdomain.com');
    3 points
  8. Try this: <title><?php echo $page->get("seo_title|title") . " | " . $config->httpHost; ?> See https://processwire.com/api/variables/config/
    3 points
  9. @all: Was kind of out of business for a while. Will come back and check everything in September! Also some new ideas for this module ;-)
    2 points
  10. Thanks @Juergen (or z-index-man :)) Version 0.3.6 is uploaded which should fix it. The problem is that the leaflet field sets a z-index of 1000 so I decided to use much larger values. @szabesz is also covered with the new "Set narrow pagelist items" to reduce row height for the main pagelist. It's Reno theme only so it can be found under the RenoTweaks submodule. This update contains the "Pagelist thumbnails" feature. I'm sure this will have some iterations but I really like the "fieldname: selector" syntax to add thumbs, it's really flexible.
    2 points
  11. https://github.com/ryancramerdesign/pw28
    2 points
  12. Why no prefix? I would rather use the Pager with a blank PageArray and trick it a little. Configure your prefix to use something unique like "toreplaceprefix". Set your template to allow page numbers AND url segments. Then do something like this: $limit = 2; $start = $input->urlSegment1 ? ($input->urlSegment1 - 1) * $limit : 0; $pageNum = $input->urlSegment1 ? : 1; // page number for pager $pa = $pages->find("template=basic-page, start=$start, limit=$limit"); foreach($pa as $p){ $content .= "<p>$p->title</p>"; } $pagination = new PageArray(); $pagination->setTotal($pa->getTotal()); $pagination->setLimit($limit); $pagination->setStart($pageNum); $pagerHTML = $pagination->renderPager(array( "baseUrl" => $page->url, )); $pagerHTML = str_replace("toreplaceprefix", "", $pagerHTML); $content .= $pagerHTML;
    2 points
  13. 2 points
  14. @netcarver Now works well with the standard setup here. Does not work with the HERE map series (I think to remember the v100rc2 beta does).
    2 points
  15. I have skim-read it. Best sentence I found somewhere in the middle: Keeping things simple for now Very good resolution.
    2 points
  16. Hi Kekko, Welcome to the PW forums! In PW, image and file fields effectively store the images/files for the page they are on. Currently there is no fieldtype module released in the modules directory that acts a reference to images/files stored on another page. There have been a number of questions and requests about such a feature (for example here, here, here and here) and you could throw your support behind the item in the wishlist subforum here. I for one would love to see an image reference field for PW and it's on my list to have a go at developing some time but I fear it will be beyond my skill level. The only alternative to an image reference field that I'm aware of is to follow a page-per-image approach (i.e. each image is uploaded to a separate page, and then you use a Page fieldtype to reference the image in other pages). I haven't tried them, but there are some modules that can help if you want to use this approach: AutoImagePages ImagesManager FieldtypeImagesSelect ...and two commercial modules from @kongondo... Media Manager Visual Page Selector
    2 points
  17. @Juergen If you pull the latest version of my master branch you'll be able to exclude the FontAwesome css file by doing the following: <?php echo $map->getLeafletMapHeaderLines(false); ?> Edited to add: Actually, you can just replace your copy of MarkupLeafletMap.module with the new one from the repository.
    2 points
  18. @Mats @gebeer Thanks to a job I just finished for @dab I have been actively taking your work forward. I have a fork of the project here that... Simplifies getting the needed files used by MarkupLeafletMap into a template's header Integrates the Leaflet.AwesomeMarkers project and the latest FontAwesome icons into the module Adds a callback function for customising the content's of a marker's popup box Adds a callback function for customising the visual appearance of any marker Updates the readme file significantly Provides an example template file to help get folks underway with this module in their projects I based my work on gebeer's extension of your repo Mats, so I have issued a pull request to gebeer - but I'd like to get these changes into your repo if possible as then we can revert to your repo as the master codebase and, hopefully, have the latest goodies straight from the PW module directory. It's now very easy to add fields to the marker pages that let you customise their appearance. Below I have added an Options field, a FieldtypeFontIconPicker and a Text field to control the marker visuals via the added callback. If anyone want's to try it out, here is the link to the zip file.
    2 points
  19. Dynamic Selects Released 27 July 2016 Dynamic Selects is a commercial module that enables the creation of dynamically related/dependent ajax-driven chained dropdown lists (aka cascading selects) for display and storage of multiple types of data. The module can be used both in the front- (display only) and backend (display and storage of data). Setting up Dynamic Selects is very easy. With minimal effort, site developers can set up simple or complex chained selects. By making a selection in a trigger dropdown, via ajax, values are fetched and dynamically populate options in the dependent select. In turn, making a selection in the now populated select triggers the same action further down in a dependent select. The module only uses/stores ID references to selected options in the selects meaning the most current/up-to-date data will always be displayed in the selects. Currently only ProcessWire managed data are supported. If there is enough demand, we may incorporate external data sources (typically JSON). The module consists of 4 modules ProcessDynamicSelects MarkupDynamicSelects FieldtypeDynamicSelects InputfieldDynamicSelects Video Demo: https://youtu.be/wkhx8xQ5ue4 Documentation: http://dynamicselects.kongondo.com/ Shop: https://processwireshop.pw/plugins/dynamic-selects/ Requires: ProcessWire 2.5 or newer and jQuery if using the frontend module (MarkupDynamicSelects) Features Easily create powerful ajax-driven cascading/chained selects/dropdowns Unlimited number of select dropdowns per field Data-mapping made easy thanks to multiple possible combinations of data relationships, triggers and sources Mutlipe data relationships to chose from ID-based data referencing ensures your data values always stay fresh Remote and local caching to speed up data access and reduce ajax-requests to server User-friendly, intuitive and easy to set up IMPORTANT Before using this module in the frontend, you will need to thoroughly read the security section in the documentation.
    1 point
  20. I've been working on an experimental module set that adds 2-factor authentication to ProcessWire with the help of Steve Gibson's PPP one-time-pad system. This is split into two modules; a CryptoPPP library that implements the otp system and a 2-factor authentication module that uses it to add 2-factor authentication to ProcessWire. The 2-factor module adds an additional "Login Token" field to the login page into which the authenticating user will need to enter the next unused token from their one-time-pad. Pages from their pad can either be printed out in advance in a credit-card sized format (with codes being crossed out as they are used as shown here) or the required token can be sent to their registered email address so they don't need to print anything out. This second option requires a good email address be present in the user's account in order for them to be sent the token. Email Delivery To set up email delivery go to the 2-factor module's config page and choose "token delivery via email" and save the settings. Next, make sure that every user who will use the system has a valid email address set up in their account. Upon the first failed user login attempt, the required token will be emailed to the user’s email address and they should then be able to log in. Printing Pages From The Pad If you prefer to print the tokens in a handy credit-card sized format then… Go to your profile screen Expand the “PPP Initialisation Vector” field Hit the “Show Token Cards” button to open a new browser window with the next 3 useful cards Use your browser’s print option to print these out Trim them to size and store ...but make sure you print these out before you enable 2-factor authentication on your account. If you cross out your used codes, you will always know which code to use when logging back in -- and if you forget, the first login attempt will fail and the token field will then prompt you with the location of the correct code to use. Why would I ever want to use 2-factor authentication? If your site is only for you or for people you know use good passwords then you probably never will need a 2-factor authentication system. But it has been shown that many users use passwords that are, well, rubbish not very good and having a second factor can be useful in mitigating poor passwords. As the second factor in this system comes out of a one-time-pad system (meaning it will not be reused) then having the user's password leaked or guessed should not compromise their account nor will having someone spy out the token they are using to log-in as tokens are not re-used (well, not for a very long time.) Known Problems You need to hit the save button after you install the 2-factor module to get it to remember the initial settings. (I guess I'm not setting the defaults correctly at present but pressing the button will allow you to move forward for now) Uninstall of the 2-factor module leads to a lot of warnings. Attachments
    1 point
  21. Thank you to everyone who has responded - good to know that I haven't overlooked an option and rather it is because it is not officially supported! @clsource: I'm guessing the first line of your code wouldn't work out of the box, if the URL to start with has the prefix "page" (or whatever I configured it to)? Or do I have to artificially create the URL such that it only says "/2/" (where 2 can be any page number)? @Soma: Thank you for the code snippet - seems to work like a charm! The reason for no prefix is merely a cosmetic one rather than a functional one, so it's nice to know that it can be worked around even though it is not officially supported at the moment.
    1 point
  22. You should never rely on client side validation on its own. Server side is a must! Not to say you shouldn't use client-side, but it should only be for a faster/nicer UX, not the ultimate check.
    1 point
  23. Why would do that? This code doesn't make sense. User is already logged in and $session->login() requires a user and password. So your code always returns "NULL" thus does not a redirect. // after login redirect user to another page if($session->login($user)) { // login successful $session->redirect("/"); } I also would expect a success message after saving. Also a validation of password length and requirement would be needed. With this code I could have a passwort like "abc". Such code examples are dangerous...
    1 point
  24. Maybe you can create your own pagination $pageNumber = $sanitizer->selectorValue($input->urlSegment(2)); // wil get 2 from example.com/foo/2/ if(empty($pageNumber) || !is_numeric($pageNumber) || $pageNumber < 0) { $pageNumber = 0; } $limit = 10; $base = "template=post"; $query = $base . ", start=" . (($pageNumber > 0) ? $pageNumber + $limit : $pageNumber); $query = $query . ", limit=$limit"; // template=post, start=0, limit=10 $results = $pages->find($query); $total = $pages->count($base); $current = $pageNumber; $next = $pageNumber++; if($next > $total){ $next = $total; } $prev = $pageNumber--; if($prev < 0) { $prev = ''; }
    1 point
  25. You could just add your own option in config.php $config->prefix_sitename = 'my site name'; $config->prefix_title_separator = ' - '; And use like this: <title><?php echo $page->title . $config->prefix_title_separator . $config->prefix_sitename ?></title>
    1 point
  26. @OllieMackJames Are you looking for something like these? <?php echo parse_url($page->httpURL,PHP_URL_HOST); ?> or <?php echo $config->httpHost ?> @ottogal was faster than me
    1 point
  27. Assuming you want this in the current template and you want the root domain , your code should be : <title><?php echo $page->get("seo_title|title") . " | " . $pages->get('/')->httpUrl; ?>
    1 point
  28. I have discovered an z-index issue with the Leaflet module. It concerns the breadcrumbs and headline div. As you can see the magnifying glass on the right and and the size changer on the left side overlap. Adding the following z-index to the breadcrumbs and headline div solves the problem: #breadcrumbs {z-index:11} #headline {z-index:11} A lower index than 11 will not work. Best regards
    1 point
  29. I've made a module that should swicth protocols (http/https) based on domain name. Don't now if it still works but you could try it: https://github.com/Da-Fecto/SwitchProtocol
    1 point
  30. No idea, but it's shorter so leaves more space in my head for others
    1 point
  31. @tpr sure would work, too. Maybe faster? Otherwise shouldn't matter?!
    1 point
  32. Checking for wire('languages') wouldn't work? I use this and seem to do the trick.
    1 point
  33. good catch @flydev never considered this as most of my projects are multi lang tested and pushed your fix, should work now @csaeum Please let me now if it works for you, too EDIT: Just bumped version so you should be able to just update the module using ProcessWireUpgrade module (if installed)
    1 point
  34. @csaeumIf you install ProcessWire multi-language support, it should work @Can maybe this small check could help, on line 78/79 if($this->wire('modules')->isInstalled('ProcessLanguage')) { $userLanguage = $this->wire('user')->language; $lang = $userLanguage->isDefault() ? '' : "__$userLanguage->id"; } else { $lang = ''; }
    1 point
  35. Is working here on a massive setup for blockbuilding....no affect so far.
    1 point
  36. 1 point
  37. I'm afraid I'm lost somewhere in between I was talking about the existing page list but prepending a small thumbnails to the items, not a thumbnail-only page list (there's a module for that as I know). I don't plan to add the latter because that would require much modifications and it's not the purpose of AOS. To make this pagelist compact with the thumbnails, I will see how usable it is with smaller thumbs but I'm not sure that would make much sense (thumbs were too small).
    1 point
  38. 1 point
  39. I haven't tested the new matrix field for now. PTE renders the selected templates/blocks for the editor. So the dev could create a simple visual blockeditor with drag and drop the blocks and prerender them like it looks on frontend or in a other way that fits in the backend like teammembers, slideimages and so on. Some things to mention: - Care for the used templates to render in SEO things - access the single parts are possible if you don't handle this (for example you have all PTE elements under a hidden parent the elements are accessable on frontend, too) - The CSS for prerendering is sometimes a little tricky since it could be that it crashes with the admin styles (only some special classes and maybe fontsizes and so on) you could use .renderedLayout Class on such elements in your special CSS file for PTE. I'm running PTE for pretty much every repeating element that is more complex like contentblocks, sliderimages with text and settings, teammembers, grouping documents and so on...all things that elements in summary are under a rage from 10 to maximum 40. If i need more elements like events or something i'll stick to pages. best regards mr-fan
    1 point
  40. I have two of my own sites (weekly.pw and streetworkoutpori.fi) running on 3.x and so far everything has been pretty smooth. When I initially updated ProcessWire Weekly from 2.7 to 3.x I had to go through some hoops and a few modules were not working as expected, but most of those were related to early issues in File Compiler. Now that these issues have been fixed, I would say that 3.x is relatively stable. The sites I've built from scratch using 3.x never had any issues. Since 3.x is a development branch, you might want to wait a few days after Ryan's "friday updates" before updating your site, especially if it's already live, though. That way you can make sure that no new issues were introduced
    1 point
  41. There's also this by Pierre-Luc: https://processwire.com/talk/topic/10517-frontend-password-reset/
    1 point
  42. What is possible is to use a concat field to "save" the count of the images field and then use that for the visible dependency selector. Create a concat field "imagescount" and enter "images.count" as the value. Add that field to the template. And enter "imagescount>0" in the textfield's dependency. This works after only after you uploaded images and saved the page.
    1 point
  43. Hi, i made quick test and redirecting outside PW working good. For quick test put this code at begining of your home template. $url = "http://www.google.com"; $session->redirect($url);
    1 point
  44. Hi pwired, I like what you said: Here's what I learned over the last 9 years of making money online, allow me to use the analogy of a sport I love: sailing. If there is no wind, no use putting your sailing boat out on the water... If there is wind, anybody who puts a boat out on the water will be able to move, and the better sailers just go faster up and downwind. No matter how good a sailor you are, if there is no wind, you are just as lost as anybody else. So what do I mean with this? There are lots of markets out there, but you need to find a market where people are spending money everyday, this is the wind. Once you found a spot like that, all you need to do is get your boat out on the water and catch some of that wind. OK, so you want to make money with pw and internet, here's a business example from the wordpress world: www.clickbump.com Scott Blanchard, the clever brain behind it, focuses on a number of things that make wordpress sites driven by his stuff, very fast and do well in the serps. Even though I sort of hate wordpress, and refuse to use it for my important sites, I have bought his stuff and a number of his templates on top, just to figure out what works well and to be able to port that stuff to my sites. So if I would want a business model like this I would focus on making nice ready made sites or modules that would work great and help people get results in the serps. The only trouble of course with this business model is that the current wind is mainly on the wordpress lake, but if you can make things easy enough for people, you would catch some of that wind, there's strategies to do that. OK, let me think along in another direction. How about you check the google adwords tool for certain keywords, you want keywords that have a lot of traffic and relatively high cost per click in google adwords. Once you find that, you know this is a market where money is spent, simply because these advertisers would not keep spending if they would not make money with it. Next you do a search on google for the very same keyword and you check the top 3 adwords advertisers - check out their sites and see what is lacking there. On page seo wise, or on site engagement wise,etc. etc. Next you could do two things (at least of course): 1 - build a site around the niche and get it to the top of google search results, then contact the advertisers and offer them the site for rent (once you are in the top 3 of organic results you will get nice traffic and be able to show your numbers and rent the site out for a percentage of the traffic x cpc. 2 - contact the site owners and tell them you can help them with redesign of their site so it gets more visitors and/or get more action out of current visitors. Now a third option: - build kick ass modules for pw and charge for them. I would already have some ideas for at least one kick ass module that I just bought today from the wordpress world that would really benefit anybody with a site out there that is currently driven by pw. As you see I am not so much focused on what you are good at, but how to apply what you want to do at where people are currently spending money. Of course you need to be good or get good at coding and stuff, but a guy with a focus on existing needs that can be met, in my book always beats the guy who focuses on what he wants to do. Hope this helps, may the winds favor your business sails!
    1 point
  45. ProcessWire is a content management framework, which is still a "framework", but more focused on a particular thing. Whereas the framework scope of CakePHP, Laraval, CodeIgniter, etc., is more broad and cover more territory. ProcessWire isn't meant as a replacement for one of those frameworks, but I think there are probably many instances where its focus might make it preferable. And an equal number of instances where the opposite is true as well. There's also something to be said for bringing the two together in some instances. Another big area of difference is that traditional frameworks enforce a particular approach to build on top of, whereas ProcessWire aims to be a lot more transparent, like jQuery. Frameworks set you up with a place to put your models, views and controllers, whereas ProcessWire puts in you in a plain PHP file (template file) that is given a location context ($page) and lets you take over from there. We think MVC is a good approach to take with ProcessWire template files, but don't enforce anything, as it's up to the developer. For better or worse, the possibilities are wide open in the same way they are with a PHP file on its own… though with a full CMF API at your disposal.
    1 point
  46. Hello Everyone, Thanks Soma! My reason for asking is because, except for a handful of actions, I have been able to replicate everything I was doing with CodeIgniter/Laravel here in ProcessWire. Actually, on the Laravel forums there are two related discussions about this. If you haven't seen them already, go here: http://forums.larave...id=21881#p21881 http://forums.larave...?pid=4627#p4627 There is also this: https://twitter.com/...018610362232832 I find this significant for a couple of reasons. First, because there have always been three branches of Web development for me: 1. Pure and Naked PHP 2. Fully-Baked CMS 3. PHP Framework I'm being a bit colorful, but I think you all know what I mean by "pure and naked" and "fully-baked." Of course, there are CMSs built with frameworks, but I had never found one that maintained the total freedom of the framework while also providing the crucial "engine" of a CMS without making too many assumptions. I know a few that come close. ProcessWire is the only one I have found (and I have tested a very long list of CMSs and framework-based CMSs). The "fully-baked" CMSs are not worth comparing really. If people in the Laravel community are recognizing that ProcessWire does the framework-based stuff really well, and also gives you those CMS functions every project needs, it's a big story. Thanks, Matthew
    1 point
  47. ProcessWire core is a framework. And on top of that built a CMS I think it goes this far /wire/core - is the framework /wire/modules /wire/admin-templates - is the admin/cms built on top of the core /site/ - your site with possibilities to extend admin and cms functionality You could start now and build your own CMS basing on core.
    1 point
  48. Marc, when you are developing a site it's good to turn debug mode on. This will ensure that errors are sent to the screen, exceptions reported, etc. This can be found in /site/config.php. By default, it is false. You'll want to change it to true: $config->debug = true; Obviously you don't want this enabled for production sites, so remember to change it back to false for live/production sites. I don't see any problem with using var_dump, var_export, print_r, etc. so long as you are directing that output to where you can see it. Also avoid running these functions on PW objects as you may get into an infinite loop. Sometimes it can be difficult to track the output of these functions because PW performs a redirect after most POSTs. But if you use PW's built-in reporting functions, they will get queued between requests until they are output. Here are the relevant functions bellow. They will produce the messages that you see at the top of your screen in PW admin: $this->message("status message"); $this->message("status message that only appears in debug mode", Notice::debug); $this->error("error message"); $this->error("error message that only appears in debug mode", Notice::debug); If you are outside of a Wire derived object, you can call upon any API var to handle the notice for you. For example: wire('session')->message('status message'); wire('pages')->error('error message'); Note that these reporting functions above are for the admin (and related modules), and they don't do anything on the front-end of your site. How you choose to debug or report errors on the front-end is at your discretion. Personally, I keep debug mode on in development, and this puts PHP into E_ALL | E_STRICT error reporting mode... it reports everything possible. If I need to examine the value of something on the front-end, I'll do it the old fashioned way with just PHP. Though others may prefer to go further with their debugging tools. If you want to keep your own error log, here's how (anywhere in PW): $log = new FileLog($config->paths->logs . 'my-log.txt'); $log->save('whatever message you want'); You can direct it to store logs wherever you want, but I suggest using the PW logs dir as shown in the example above. This will make the log appear in /site/assets/logs/, and this directory is not web accessible for security.
    1 point
  49. Yes Dictator was a bad name. But it had good intentions. It was the name of one of Thomas Edison's inventions for some machine that assisted with outputting content. It was supposed to be that kind of Dictator, not the kind that tells others what to do or an evil ruler or anything like that.
    1 point
  50. Usually if I have hundreds of page references (categories) to create I use the API to create them (like from a CSV or text file) rather than doing it manually -- let me know if I can give an example of how to do that. If you are doing something with free tagging, then I would use url segments. Lets say you've got a free tagging field called "tags", and it's just a textarea with one or more tags. You might setup a template called "tags" and on a page called "/tags/". Accessing /tags/something/ in your browser should list all pages that match the tag "something". To do that, first turn on URL segments in your template (Admin > Setup > Templates > Advanced > URL Segments). Then, in your template, your code might look something like this: <?php if($tag = $sanitizer->selectorValue($input->urlSegment1)) { $matches = $pages->find("tags*=$tag"); echo $matches->render(); // or loop through and print on your own } For pre-defined categories using page referencs, I think that asmSelect is a good input field to use for selection. However, if you need to be able to select pages in a hierarchy (like category or subcategory with the same field) then I think the "page list select multiple" is a good solution, because it enables you to select pages in a hierarchy rather than in one level. You could also use any of the other multi select input fields and use the template as the base for selection rather than the parent. ProcessWire is a couple months old, and Drupal has been around since 2001, so we're not going to have the same level of features in some areas. But if you think Drupal is better at this than PW2, describe further, and more specifically, so that I can make sure we get PW2 one step ahead. When it comes to working with these kind of data relationships, I believe PW2 is better than Drupal on the back-end, so I want to make sure I provide enough front-end simplicity to provide and prove that. thanks, Ryan
    1 point
×
×
  • Create New...