Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/12/2018 in all areas

  1. ... unlimited possibilities with a hook ... Code // ready.php $wire->addHookAfter('ProcessPageListRender::getPageLabel', function($e) { $listedPage = $e->arguments[0]; // ... $e->return = '...'; });
    6 points
  2. Just wanted to explain @kixe's excellent answer a little for those who might be wondering why that hook isn't listed in the Tracy Captain Hook panel or on the Captain Hook page: https://processwire.com/api/hooks/captain-hook/ What is going on is that ProcessPageEdit extends Process and Process has a ___headline() hookable method. If you're used the Tracy Captain Hook panel, it always pays to check the class that the current class extends: Now we're looking at the hooks for the Process class and we can see that headline is available. Hope that helps! The other useful tip is the to click the "Toggle All" button at the top and CTRL/CMD +F and look for "headline"
    5 points
  3. Hello Marco, Not really a direct answer, but you can find some information in this thread To add custom fields, you have to add your custom fields to the user system template. After that, Go to the LoginRegister module settings and add the fields to the profile options. Your users will be able to edit their profile with the new customs fields :
    5 points
  4. You need to add pagefileSecure-setting to your /site/config.php file, and set it to "true": $config->pagefileSecure = true; More details here.
    5 points
  5. Hi @elabx I did not know this property, I will make an option available for that. I plan to add new features and test the module in the next 10 days, sorry I miss time ?
    4 points
  6. GDPR itself is mandatory, but there was a confusion about storing personal data in an encrypted way only as it was supposed to be necessary to comply. Being a European developer, I will spend a considerable amount of time to help my clients out with GDPR and I'm still learning the details... However, this encryption issue seemed to be a huge technical problem if it is mandatory. Since it is not, now I can concentrate on the other issues GDPR generates. I think this confusion about encryption was the biggest issue so I though I would post some links to show that is in a non-issue after all. There are good resources about GDPR about there, but here is a brief introduction to check out first: http://ec.europa.eu/justice/smedataprotect/index_en.htm Also note that: "Where does GDPR apply? If you sell any products to customers based in the EU, or have EU visitors to your site, you’ll need to make sure your site complies with GDPR. It applies to all 28 EU member states and to entities and organisations outside the EU when processing the data of citizens within it. IMPORTANT to note: Google Analytics and others ARE personal data collectors too! Eg: Statistics apps like cPanel apps, similar CMS plugins, custom solutions like Piwik", etc. And this means not European websites should also consider complying to avoid yet to be seen possible legal issues. The good thing is that the silly automatic cookie consent does not seem to apply anymore, as setting cookies is not data collection in itself. In GDPR there is only one sentence where cookies are mentioned: https://gdpr-info.eu/recitals/no-30/ And it is just about listing a few technical possibilities of possible personal profile building. However, if there is no profile building – meaning there is no data collection this way – then cookies are non-issues. I still need to read up on this one, but this is my current understanding. Of course, if cookies are used for profiling then it is a different story and they must be considered when dealing with GDPR. There is a lot to consider regarding GDPR. As you can imagine, complying is a time consuming process, a real PITA
    4 points
  7. Also note that in PW3 wireRenderFile() and wireIncludeFile() are $files->render() and $files->include() respectively (those earlier functions now just call the $files methods internally).
    4 points
  8. Of course ... /** * modify headline in page edit interface */ $wire->addHookAfter('ProcessPageEdit::headline', function($e) { // get id of page beeing edited $pid = (int) $this->input->get('id'); if (!$pid) return; $pageBeeingEdited = $this->wire('pages')->get($pid); if (!$pageBeeingEdited->id) return; $headline = "My ID is $pageBeeingEdited->id"; $this->wire('processHeadline', $headline); // no need to modify the return value ($e->return) });
    3 points
  9. @OllieMackJames, your setup makes sense to me. But you cannot clone the Home page because there can only be a single page at the top of the page hierarchy. Instead you need to move the Home page contents to another page... Add a new template with the same fields as your home template (use the "Duplicate fields used by another template" option when adding it). Create a new page using this template. Now check out @adrian's Admin Actions module which has two built-in actions that you'll find useful to move the content from the existing Home page to this new page: 1. Copy Repeater Items to Other Page 2. Copy Field Content to Other Page Another tip: If when setting up a site you know that you will later want to turn the Home page into an internal page you can make it easier by using an internal page to hold your Home page content. Let's say this internal page has the ID 1234. Don't publish this page (so it won't be accessible on the front-end). At the top of home.php (your home template file) you put... $page = $pages(1234); ...and now wherever you do $page->title etc in home.php you will get the content from page 1234. Later when you are ready to switch the Home page you can populate your home page with content (or repeat the steps above for a different unpublished internal page), remove/change the $page assignment in home.php, and publish page 1234.
    3 points
  10. I just wanted to follow-up for anybody reading in a similar situation. After spending more time with the admin and understanding things I can say using it as opposed to recreating an admin at the 'frontend' is 100% the way to go, will be saving a ton of time, so glad I got a good steer from you all.
    2 points
  11. $firstItem = $feature->issue->first(); echo "<p class='iss uk-text-tiny bold caps'><a href='$firstItem->url'>$firstItem->title</a></p>";
    2 points
  12. Not necessary since he's using get(), which assumes these things already . http://processwire.com/api/selectors/#access_control
    2 points
  13. One tweak that I think is worth making is to use: $e->object->getPage() rather than $this->input->get('id') to get the page being edited. /** * modify headline in page edit interface */ $wire->addHookAfter('ProcessPageEdit::headline', function($e) { $pageBeeingEdited = $e->object->getPage(); if (!$pageBeeingEdited->id) return; $headline = "My ID is $pageBeeingEdited->id"; $this->wire('processHeadline', $headline); // no need to modify the return value ($e->return) });
    2 points
  14. $mostRecentlyCreatedPageByUser = $pages->get("created_users_id=$user->id,sort=-created");
    2 points
  15. You can only modify the markup/styles with hooks, CSS and JS - you can find some examples in the post I linked earlier - and I advice you to not modify the module himself in case update happen ? More info there : https://github.com/ryancramerdesign/LoginRegister#customization
    2 points
  16. @ryan just commited my fix with a little type checking added, so the latest dev version from GitHub will behave nicely and clone _END fields to.
    2 points
  17. This is probably because cookie handling is supposed to be regulared by the eprivacy law, which will be obliged at the same time as the gdpr, but is a separate regulation. Sadly this one still doesn't seem to be finalized and it's getting far less attention.
    2 points
  18. For such a site it must be taken seriously as GDPR tries to differentiate the "level of security measures and the fine to pay in the absence of proper compliance" – so to speak –, meaning that security measures applied to data collection and handling must align with the amount of data and its sensitivity. I guess your client will need a "GDPR professional" to make it right. The websites I deal with require less work to comply but it is sill something what will add up to lots of ours of work on my end.
    2 points
  19. Hi there. Not a complete answer, but first of all I'd suggest taking a closer look at this post, which has a link to an article hopefully resolving some worries regarding encryption of data: Other than what you've described above I don't have a rock-solid solution for you. I would assume that, as long as you're taking care of other parts of the regulation – such as breach reporting, removal of data on request, and so on – and you encrypt all traffic targeted at personal data (HTTPS), you should be safe. But then again: IANAL, so please don't take my word for it. I'm just assuming some common sense, really. With current technology it would be next to impossible to encrypt all personal data, while still collecting all the necessary data in the first place. Think of things like server log files etc.
    2 points
  20. @Robin S, very big thanks! I installed the Admin Actions, but see it does not work with the repeater matrix, only repeaters, otherwise that would be a good option. I like your second suggestion and will go and try that. I'll add a home page template with just one visible page select field that then allows me to select the underlying page that will be used for the homepage per your code above, that sounds like it wold jus do what I want to do. Gotta love this amazing thing called Processwire! Combined with an awesome group of people around it helping each other getting things done. So once again, @dragan thanks for your input and @Robin S you for putting me in the direction of a solution I will use!
    2 points
  21. This week we’re back with a new dev branch version that adds a new feature we think you’ll like: focus point image cropping. That’s also the “focus” of this blog post. This version also includes resolutions to numerous issue reports and more. https://processwire.com/blog/posts/pw-3.0.89/
    1 point
  22. @Peter Knight Yes, you have to add 'sort = -created' otherwise you will get 'sort=id' by default. In contrast to find(), get() returns only a single page (the first page from the PageArray to which your selector applies). If you get nothing, the user has not yet created a page or the user is the guest user (not loggedin), or the page have the status hidden or unpublished. You can add selectors like include=hidden|unpublished|all.
    1 point
  23. @Zeka, maybe you can use the filename, prependFilename or appendFilename properties of the TemplateFile to limit where your hook applies. E.g. $wire->addHookAfter('TemplateFile::render', function(HookEvent $event) { $template_file = $event->object; $proceed = false; foreach($template_file->appendFilename as $filename) { if(substr($filename, -9) === '_main.php') $proceed = true; } if(!$proceed) return; // Your code... }); I'm curious - what's your reason for hooking after TemplateFile::render? If you are targeting non-admin template files inside your /site/ why wouldn't you include whatever logic you need inside the template files rather than via a hook?
    1 point
  24. @theo You can use html, but you'll need to create a new admin theme to accomplish this ... If the AdminTheme you are using extends the AdminThemeFramework class (UI-kit) or contains the AdminThemeDefaultHelper class, all tags are entity-encoded. https://github.com/processwire/processwire/blob/e73ec872da5f9db2960524dbb984287bfe4b7b4e/wire/core/AdminThemeFramework.php#L156
    1 point
  25. Great module. Thanks @matjaz! Looks like https://resmush.it/ is down. Anyone know if the service is still running? I'm thinking it would be good to swap out resmush.it for ShortPixel or TinyPNG as the external service. I'll fork and submit a pull request if I end up tackling that. Anyone else working on image optimization modules like this?
    1 point
  26. For storage, no, for reference, yes. Matrix stores a page ID for Row, a page ID for Column and a varchar for the value of the matrix (i.e. row-column = value). Using the page IDs of Row and Column, you can use PW API to get the page and hence, any field on that page. Maybe not what you are after but thought to clarify anyway.
    1 point
  27. Developing a mobile app is a lot of pain, trust me, so for the new version of my client's app, we decided to trash our bespoke version (made using Appcelerator Titanium) and sign up for a service that takes this pain away. After comparing features and pricing, the client decided for using GoodBarber.com and is pretty happy (currently paying $48/month). The app is pretty simple but met our objectives. GoodBarber enables push notifications but we not using though, as it doesn't work for our main content: podcasts episodes that came from Soundcloud feed. The app in questions is this one: https://itunes.apple.com/br/app/project-management-connector-with-ricardo-vargas/id385663838?mt=8 https://play.google.com/store/apps/details?id=com.goodbarber.pmconnector
    1 point
  28. Ok, thanks for InputfieldFileSorting this out ☺️
    1 point
  29. Thanks @szabesz clear as mud I'm based in Oz and working on a site that will have a UK clientele as well as Aussies, and possibly EU clients as well. The site needs to collect lots of personal & medical info and want to get this GDPR stuff right from the word go.
    1 point
  30. @tpr seems he is already using it
    1 point
  31. I think @WebMaster is looking for a way to sort (order) items and not to filter them. There is a solution by @bernhard that is not merged into aos, you can find it somewhere in this topic too.
    1 point
  32. "GDPR: Encryption is NOT Mandatory!" https://www.linkedin.com/pulse/gdpr-encryption-mandatory-gary-hibberd "Although under the GDPR encryption is not mandatory,..." AND "Before doing so let’s be clear: GDPR compliance, as we wrote before is a business strategy challenge and encrypting personal data STRICTLY SPEAKING is not mandatory." : https://www.i-scoop.eu/gdpr-encryption/
    1 point
  33. Wow, RockDataTables would be perfect for an upcoming project, and for where I'm working in general (dashboards collating info from diverse sources via external APIs). Please keep us updated, I would definitely pay a reasonable fee for a Pro module!
    1 point
  34. Here is a new created version to track changes which works without any problems and you dont have to take care about the deletion of input values if the page was not saved successfully (like in the version before) Put this little piece of code inside your ready.php. //Compare before and after values and output a warning message $pages->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments('page'); $page->of(false); //configuration: change it to your needs $templates = ['event_businessvacations', 'event_dates', 'event_events', 'event_specialbusinesshours']; //array of templates where this hook should run $fields = ['summary', 'body']; //array of fields which should be checked //configuration end if(in_array($page->template->name, $templates)){ $changedfields = []; foreach($fields as $fieldname){ if ($page->isChanged($fieldname)) { // Page as it is in the DB $oldPage = wire('pages')->getById($page->id, array( 'cache' => false, // don't let it write to cache 'getFromCache' => false, // don't let it read from cache 'getOne' => true, // return a Page instead of a PageArray )); $changedfields[] = $oldPage->fields->$fieldname->label; } } $changedfields = implode(", ", $changedfields); if(!empty($changedfields)){ $this->warning(__("The following fields have been changed: {$changedfields}")); } } }); Change the configuration block to your needs (template names, field names). This little code snippet outputs only a warning message which fields have been changed - not more or less, but you can also run some other logics - its up to you. Note: Works also with repeaterfields, but you can only check the repeaterfields for changes in general. It is not possible to check for specific fields inside the repeater.
    1 point
  35. Autojoin is a flag, like system, global, etc: $field->flags = Field::flagAutojoin; $field->save();
    1 point
  36. Go to "edit template", select tab "advanced" and you'll see a settings section that looks like this:
    1 point
  37. I'm not sure I understand your setup. Cloning your home page would mean cloning every single child page as well. Are you sure you want that? You could try the following: go to the home template settings, open the family tab, and check "can this template be used for new pages" -> yes (default is no). I would really strongly advise against doing that, but it could be (technically) possible. I would re-think your whole setup in the first place. If you manage to clone your homepage, then quickly change the template of your cloned page, and reset the family settings of the home-template, and after you have deleted all the child clones you don't need anymore, and everything still works as expected... OK. But really, that's not "PW-like" / recommended way to build a site.
    1 point
  38. Hi, it look like you are looking for that: https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions
    1 point
  39. best site in 2018 so far, nice design
    1 point
  40. Another issue report: Right after installing and accessing Duplicator's Package Manager, when no package has ever been created: 2x PHP Warning: filesize(): stat failed for .../site/assets/logs/duplicator.txt in .../wire/core/FileLog.php:225 1× PHP Warning: filesize(): stat failed for .../site/assets/logs/duplicator.txt in .../wire/core/FileLog.php:237 1× PHP Warning: file(.../site/assets/logs/duplicator.txt): failed to open stream: No such file or directory in .../wire/core/FileLog.php:238
    1 point
  41. Hi y'all! Long time no see. Here's a little module aiming to help you build accessible websites ProcessWire Accessibility Tools Download: http://modules.processwire.com/modules/pwat/ Github: https://github.com/marcus-herrmann/PWAT A small, but hopefully growing toolkit for creating accessible ProcessWire sites. Right now it consists of the following little helpers: tota11y visualization toolkit by Khan Academy A toggle button to see view site in grayscale. The w3c recommends checking your page without colours to see if your design still works (accompanied by a colours contrast check, which is part of tota11y) A link to test your webpage with WAVE, webaim's Web Accessibility eValuation Tool. By the nature of this tool, the website under test must be available online, local hosts won't work. Installation Once you have downloaded PWAT, go to your module Install page and click "Check for new modules". Find "ProcessWire Accessibility Tools" and click "Install". During installation, PWAT creates a new role 'pwat_user'. To use the Accessibility Tools, you have to grant user this role. Following, you can start configuring the module. Usage PWAT starts with only the tota11y script activated. On the configuration page you can decide whether PWAT is visible on admin pages if tota11y is active if the grayscale toggle is active if the link to WAVE will be visible Credits The amazing tota11y visualization tool by Khan Academy Inspiration: Paul J. Adam's bookmarklets Inspiration: WordPress wa11y Plugin Best, marcus
    1 point
  42. I found this very useful when dealing with my dev and live configurations. Paste and configure in /site/config.php $base_url = $_SERVER['SERVER_NAME']; switch ($base_url) { case "samplewebsite.dev": // LOCAL CONFIG $config->dbHost = 'localhostdb'; $config->dbName = 'processwire'; $config->dbUser = 'root'; $config->dbPass = 'PaSsWoRd'; $config->dbPort = '3306'; $config->httpHosts = array('samplewebsite.dev', 'www.samplewebsite.dev'); $config->debug = true; break; case "samplewebsite.com": // LIVE CONFIG $config->dbHost = 'livedb'; $config->dbName = 'processwire'; $config->dbUser = 'username'; $config->dbPass = 'pAsSwOrD'; $config->dbPort = '3306'; $config->httpHosts = array('samplewebsite.com', 'www.samplewebsite.com'); $config->debug = false; break; }
    1 point
  43. My development workflow / deployment process is git- and beastalkapp-based, and heavily inspired by this video by Chris Coyer from css-tricks.com: http://css-tricks.com/video-screencasts/109-getting-off-ftp-and-onto-git-deployment-with-beanstalk/ Meaning: Working locally but having a staging server, more or less like the one einsteinsboi has described above and having a production server, the clients webspace Beanstalk handles the deployments which tend to be automatically on staging (just the master branch) and - always - manually on production.
    1 point
×
×
  • Create New...