Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/31/2019 in Posts

  1. This latest version of ProcessWire on the dev branch adds a new Inputfield module called “Toggle” that is an alternative to the existing Checkbox Inputfield. It also adds a nicer way to make column width adjustments to your fields when editing a template. This post covers all the details with screenshots and a short video: https://processwire.com/blog/posts/pw-3.0.139/
    7 points
  2. ? for the width adjustment, this is a really nice feature that makes setting up new templates and changing them much more convenient! Funnily, I just implemented a toggle inputfield myself and thought, oh bummer, I could have saved myself the work! Turns out, you weren't talking about a sliding toggle like I am working on, and the core toggle field type is a nice addition for cases where the choices need to be more verbose than a simple yes/no and on/off. It'll come in handy for some of the forms I have in the queue. I will have to rename my module, though ? It'll be CSS only. I still need to add color and size options, and it'll hopefully hit the module repo at the end of next week.
    7 points
  3. Worth mentioning this module here: https://modules.processwire.com/modules/template-field-widths/ GIF: https://user-images.githubusercontent.com/1538852/49207167-0cbef100-f419-11e8-965a-ca46b4f256d1.gif
    6 points
  4. Hello everyone, while building an app-interface for a page, I developed some changes and improvements to this module, which I made available as a pull request. But @thomasaull and I are not quite sure if it makes sense to transfer these basic changes into the main module as well. Therefore we would like to hear your opinion: What do you think of the new module version? Which features would be useful for you? I have developed several new features that allow the administration of Api accesses via the ProcessWire backend. I also revised the authentication and added a new Double-JWT option that works with long-lasting refresh and short-lived access-tokens. New Features: New menu item "Restapi" in the ProcessWire menu under "setup Management of Api accesses (applications) outsourced to the new menu item Apikeys now authorize api-access Creation of multiple applications with different auth types possible Double-JWT Authentication, renewable tokens token-sessions can be viewed and deleted in the backend Improved exception handling: Each endpoint can throw exceptions, which are then output with the appropriate HTTP status header and message.
    3 points
  5. I am back again with another crazy module that might help someone. This time I am using the native Tfa class to add FIDO/U2F support. this includes Yubikeys ? Sadly I cant seem to find a way to do multiple keys at once. and it seems you can only have one Tfa method at a time so not ideal but it was a fun challenge to code and maybe someone will a use for it Github: https://github.com/adamxp12/Processwire-TfaU2F ProcessWire Modules: https://modules.processwire.com/modules/tfa-u2-f/ The code is not the neatest and has limited comments but if you understand the Tfa class it should be quite easy to break apart. And here is a demo of signing in using the Yubikey as the 2nd factor
    1 point
  6. --- Please use RockFinder3 ---
    1 point
  7. I am using this module in all my install now (it's a modified version with Basic Auth implemented) and all these additions look super ! Looking into it this afternoon, I will give my opinion. Thanks guys for the hard work ?
    1 point
  8. After my post yesterday I realized that there is actually more I do. At first I thought I don't think that much about naming but then I looked into a recent project and found several patterns that seem to be part of my workflow for a while now but I never saw that as a naming convention to be honest. It's more my laziness. I hate searching around so I group templates and fields in some cases to make things easier for me - I guess. Templates for data that will never result in a viewable URL/page get the prefix data, for example: dataPerson dataWebsite dataProject dataProduct Then there are templates that result in real pages/URLs which get the prefix content, for example: contentPage contentPost contentEvent contentGallery Then there are templates for pages that result in real pages/URLs but don't contain real content on their own which get the prefix list, for example: listBlog listMovies listRecipes listTeams There are some more templates types but I'll skip them here as they are too much based on my workflow and projects - sometimes. "Yeah... but what do you do if a data template needs to be changed and a page should become viewable?" Well... I rename it, create or rename the .php file, do the things that are necessary to get the task done and I'm ready to go. While developing a project this can happen - but not that often actually. It's more often the case later on when the website owner decides to push more content into Google's index. As it is a client request I'm totally happy with it and can invoice my work. In terms of field names I go the way @teppo already mentioned but with a little twist at the end. I name the fields depending on their purpose. headline subline summary excerpt intro bodycopy images heroImage heroVideo videoYoutube videoVimeo urlFacebook urlTwitter urlLinkedin nameFirst nameLast nameFull You can see that I try to group fields by their name structure. Instead of firstName and lastName I reverse the order and these fields stay together in my list of fields. That makes life much easier in case I need to look up something or want to find out if there is already a field I can use. But... is this really a naming convention? I don't think so.
    1 point
  9. I have just run into – probably – the same issue, although I did not mixed up any children. I have a parent-child template relationship set up as usual, for the parent only the given children are allowed, for the child only a the given parent. When clicking on "new page" in the admin, two children are created at once, instead of one. I also added an unrelated template to the "Allowed template(s) for Children" of the parent template as you did to "solve" the issue, but I think it is just a workaround as this behavior looks like a bug to me.
    1 point
  10. I wrote an api-module a few years ago, where the module generated a custom template (e.g. "api-page"), which could be used to create one or more endpoint-pages. To handle calls to these pages I used ProcessPageView::pageNotFound like @bernhard did: $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'handleApiRequest'); public function handleApiRequest(HookEvent $e) { $page = $e->arguments[0]; if ($page->template === 'api-page') { // handle request here... $otherEvent = $e->arguments(0); // grab event provided to PageRender::renderPage $e->replace = true; // prevent PageRender::renderPage from being called } } It worked nice for me, but I cannot say if caching or multi-language works better in this hook. pageNotFound should be called later than execute, so there is a chance that it helps ?‍♂️
    1 point
  11. For the sake of marketing and brand recognition I'd recommend not going with a generic name such as pw + [some commerce related term]. Best known brand names tend to be unique, and they don't really have to have any connection with the company/product (although they can). Trader is a decent idea, but I still think that Padloper is better -- not to mention that it already has some brand value, and an awesome logo ? just my five cents.
    1 point
  12. As @LostKobrakai pointed out on the thread below: You can disable it though.
    1 point
  13. Default session lifetime is 86400 seconds. You can change this to any value you want. // config.php $config->sessionExpireSeconds = 86400; Allow/ disallow sessions (and the wire cookie) under conditions. Remind that you need this to have access to the backend admin. // config.php $config->sessionAllow = true; If you want to disable cookies only for the frontend /** * config.php * if we would use cookies only for the admin area * */ $config->sessionAllow = function($session) { // if URL is an admin URL, allow session if(strpos($_SERVER['REQUEST_URI'], $session->config->urls->admin) === 0) return true; // if there is a session cookie, a session is likely already in use so keep it going if($session->hasCookie()) return true; // otherwise disallow session return false; }; If you want to use cookies respecting EU Cookie law I recommend Cans Module MarkupCookieConsent in combination with this settings. /** * config.php * if we would use cookies only for the admin area * */ $config->sessionAllow = function($session) { // if URL is an admin URL, allow session if(strpos($_SERVER['REQUEST_URI'], $session->config->urls->admin) === 0) return true; // if there is a session cookie, a session is likely already in use so keep it going if($session->hasCookie()) return true; // user accepted cookies due to EU law (Module MarkupCookieConsent) if(!empty($_COOKIE['eu-cookie'])) return true; // otherwise disallow session return false; }; Use the core module SessionHandlerDB to store session vars in the database. Learn more about session setting options and sessions by reading the comments in the files /wire/config.php or /wire/core/Session.php of your processwire installation.
    1 point
×
×
  • Create New...