Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/30/2018 in all areas

  1. In some ways yes, but I think the key thing is: GitHub is a commercial company built around an open protocol. The problem with GitHub is monoculture, just like the problem with Gmail having too much of an influence on how we use and consume email these days. Slack is completely proprietary all the way down to the protocol level. Let's not forget that Slack used to be able to talk to IRC and XMPP, but suddenly removed support in March 2018. When a company like Slack changes something, users just have to deal with it. When it goes bankrupt, a whole galaxy of stuff built around it goes down the drain. This sort of scenario is playing over and over again while IRC and email are still with us after decades of service.
    8 points
  2. Just an FYI on this front - $urls is linked to from the API Variables section of the Tracy PW Info panel. It is always up to date because it makes use of: $this->wire('all') to get all available variables.
    3 points
  3. You can iterate over the fieldgroup property of the page's template. Edit: perhaps starting with a copy of the general page and emptying/setting a few fields that need to be different might also be an option.
    2 points
  4. or that one But I had so search a bit as well.
    2 points
  5. Surely this is the simplest approach, or maybe I am misunderstanding? foreach($page->fields as $f) { echo $page->$f; }
    1 point
  6. hi @kongondo sorry for being unclear. I played around a little and came up with this solution: I think that's a quite good solution. It's easy to type, easy to read and it is efficient, multi-instance ready and supports code completion (and is always in sync with your current pw version)... What do you think? // php.json "Import PW Module": { "prefix": "mod", "body": [ "$$1 = \\$this->wire->modules('$2'); /** @var $2 $$1 */", "$$1$0" ], "description": "Import PW Module" }, "Get Wire Instance": { "prefix": "wire", "body": "$$this->wire->$0", "description": "Get Wire Instance" },
    1 point
  7. Does this work with FormBuilder?
    1 point
  8. I've had similar experiences on a project of mine, which was quite a bit smaller, but also quite a bit less spec'ed in terms of server resources. What I noticed was the big hit of loading all the templates/fields upfront for each request, which added quite a hefty ms count to requests for somethings that hardly ever changed and it needs to be done before any actual work related to the request can be started. About a year ago we decided to go for a rewrite though, but that might be a place to look into for optimization. Also as with any other project using sql you want to look out for n+1 queries, which are actually quite easy to create with processwire as fields are loaded magically on demand. You can use autojoin manually as option for $pages->find() if needed to mitigate those. I'd also care more about the number of sql requests and less about how many joins they use. Joins can be a performance hit and sometimes 2 queries might be quicker than one with a join, but 1000 queries for a single page request sound unnecessarily many.
    1 point
  9. Thank you for the input! @AndZyk that module is amazing. I fiddled around with it for a bit - the number of tweaks is unlimited! I have to save this for other projects. It seems a bit of an overkill for my needs now. The other approach is exactly what i was looking for! Thank you tons @kongondo - this works like a charm. Cheers Stephan
    1 point
  10. https://processwire.com/api/ref/pagefile/description/ See the last example on how to get the description in a specific language.
    1 point
  11. Welcome to the forums @mjut You need to use $config->scripts->add() for JS and $config->styles->add() for CSS .These need to be added before the controller.php $config->scripts->add($config->urls->templates . "scripts/admin.js"); $config->styles->add($config->urls->templates . "styles/admin.css"); // this comes last require($config->paths->adminTemplates . 'controller.php');
    1 point
  12. Except base64 doesn't do that at all, as it's not encryption, but encoding. It's like changing a .doc file to a .docx file (same content, but vastly different representation in how it's stored) and not like putting it e.g. into some encryted folder (same content, but it's stored in a secure manner).
    1 point
  13. Sounds like you just need a form. OK, even a 'financial stuff shop' is just forms. I am assuming you are not taking payment with the orders (hence the without the financial stuff). On the frontend, at its simplest, depending on the number of products you have, you create a dropdown list (like an asm select) of products. The label is the product name/title, the value is the product (page) ID. A user selects a product, and it is added to a list or table below the dropdown using JavaScript (like jQuery). To get a bit fancy, you then disable that item in the dropdown list. Assuming you were using a table, each row is a unique product, The table can have several columns, one for title, one for a product description, one with an input for quantity, and one with a delete button/x plus a hidden input for product ID, etc. If an item is removed from the table (JavaScript), you delete the row and re-enable its selection in the dropdown. I am assuming you will at least be collecting the customer's email, so create an input for that. Create a submit button as well. When the submit button is pressed, we use JavaScript (simple using jQuery), to process the form. If there are no products selected, just return an error. If there are products, at the very least we want to send the product ID, its matching quantity and the customer's email. We use JavaScript to serialise these and submit the form. Server-side, you validate and sanitize the data. Product ID and quantities are just integers. You then do what you need to do....thank yous, create a record of the order, redirect, etc.
    1 point
  14. It's not a cache. I checked css file, no other site css file is loaded, just from wire and from the module itself. For the Core tab, it's .WireTabs top position in main-classic.css, and for the link it's div#links top position in ProcessAdminActions.css. I'm testing in Chrome. It's looking good in uikit and reno theme.
    1 point
  15. Hi Adrian, I just noticed a bit odd layout of core tab and actions list link:
    1 point
  16. Apparently I have a compulsion for new keyboard shortcuts ? Just added these: SHFT + Enter Expand to fit all code and add new line (saves position) SHFT + Backspace Contract to fit all code and remove line (saves position) I have also modified the drag resizing to automatically snap to row heights.
    1 point
  17. Besides the multi-instance thing, Ryan brought to my attention recently another reason to prefer $this->wire('config') or $this->wire()->config over $this->config... If you are doing this inside a class (e.g. a module) then it's less efficient to do $this->config because PW has to first check to see if you have a property or method in the class named config, and only after that go to the $config API variable. With $this->wire('config') or $this->wire()->config there is no uncertainty. Personally I prefer $this->wire()->config over $this->wire('config'), only because it's easier to paste it in or do a find/replace when updating older code, and easier to assign a shortcut to $this->wire()-> in my IDE and have my cursor end up in the right place after I've typed the API variable name. ?
    1 point
  18. For module development you should actually use: $this->wire('config')->scripts->add($this->wire('config')->urls->$this Take a look at Ryan's Github repo (https://github.com/ryancramerdesign/) for his most recent modules and you'll see that is the approach he takes. @LostKobrakai has an excellent post on when it's ok use: $config vs $this->config vs $this->wire('config') but I can't find it right now.
    1 point
  19. I did some more testing and got one step further. You might also be interested in this thread regarding intellisense: I can now answer my question of the day before yesterday: The correct syntax is this: /** @var InputfieldButton $button */ This way you get proper code completion even for your very own variables. @kongondo do you think you could do (or guide me how to do it) a snippet that adds the IDE variable type hints automatically? This could improve the workflow and code completion even more. For example here I define a RockGrid as variable $f and with the /** @var ... */ comment I get the suggestion of "setData()" method for my grid:
    1 point
  20. Absolutely, I just meant that it should not be the first thing to think about. In other words: Just build your module and think about the name when it's finished ?
    1 point
  21. A descriptive name sometimes helps when searching the modules directory, me thinks... :-).
    1 point
  22. No, that would not be duplicate content. Search engines (or Google as far as I know) are smart and see websites like humans. If there is some content invisible, they ignore it. Google uses for their search engine an older version of Chrome, so it can interpret JavaScript and media queries: Hiding/Showing content for different viewports with media queries is a common practice. For example take the Microsoft website: They use two navigations with the same content. One for desktop and one for mobile. You should do that, because as mentioned on the article I linked before: ?
    1 point
  23. I guess that a chat channel would simply mean too much distraction. imho, there's nothing wrong with using a forum as the main place of communication, even in 2018. The general expectation with chat is that there's always someone around within 3 seconds with a useful reply / solution / answer. IRL it doesn't always work like that, if you have a day-job and have to focus on your daily work at hand. This may sound like I'm all against having a PW Slack channel - I'm not. But I'm simply afraid that infos / tips would be even more fragmented that way. (just my 2 cents)
    1 point
×
×
  • Create New...