Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by heldercervantes

  1. I usually go by @rafaoski's approach. I first go to http://www.favicomatic.com/, upload a 500x500 image to generate a full icon pack. Then I place the icons in their own folder inside the templates folder. Usually /site/templates/img/favicon/ Favicomatic gives you a rather large HTML snippet. Slap that on your template, and on each line that points to a file, you'll have to fix the url, like so: <link rel="icon" type="image/x-icon" href="<?= $config->urls->templates ?>img/favicon/favicon.ico">
  2. Maybe invert the IFs and put the errors on top. I mean: ... if (!$v->validate()) { $session->flashMessage = 'Recaptcha must be complete.'; } else { ... } ... This may make it more readable. Also some comments along the way can't hurt. In terms of performance, 4 nested ifs start to sound like too much, but in this case I wouldn't worry about it because it's a form submit. If it was something that triggered every time a page was loaded, maybe I'd look into ensuring the best performance possible, but I don't think this would justify 2 extra hours of your time. Think how much your time costs, how many milliseconds you could shave off it, and ask yourself if it's worth it.
  3. Agree. This sounds like a great candidate for a module. I was surprised seeing this barely mentioned in the forum. Unfortunately I myself have very little experience with ad management and wouldn't be the best guy for outlining less obvious features for such a thing.
  4. Just snooping around for a project, seeing what I can do on a shoestring budget. The client wants something like a directory site, and needs banners. Ideally, impressions, something to control what banners show where, and the option to use own or Google banners. But honestly a well built banners solution alone would blow the budget. I'll probably end up having to skip this one.
  5. Does anyone happen to have a banner ads management module laying around?
  6. Since I started working with PW I never needed something like this, but in my pre-PW life I have worked on projects that needed it. Any project that includes some kind of documentation archive solution is a good candidate for a feature like this. The most obvious example I can remember was the media regulation office here in Portugal. They have weekly meetings where they discuss media incidents, public complaints and things like that. Those reports are publicly available. At one point my (previous) company provided a solution for searching directly in those documents (PDFs). My role was creative only back then so I don't know the details, but basically what our platform was doing then was indexing the text as the file was uploaded. I'm working to grab a project this year that could potentially make use of something like this.
  7. Just like @3fingers found. Impressive how you've managed to find that on the compressed JS I don't actually name my vars a, b, c, but the scripts are all minified in the end and the names change. I have a script that listens to scrolling and when you go further than X pixels (don't remember the exact number) the "menu-collapsed" class is added to the document. That class will affect the menu, logo, and back to top button. The social sharing buttons are a plugin: http://tolgaergin.com/files/social/
  8. Hi guys. It's not necessarily PW related, but I do feature a project made in PW in this article. It's a short read challenging companies to think about their websites more like tools: https://supertiny.agency/en/blog/make-a-site-for-existing-customers/ Enjoy.
  9. I've made a few migrations, not from WP, but the same method applies. First I copied the assets. Layout images, CSS, fonts, etc. Then I went to the site's homepage, copied the source, pasted on home.php and started cleaning up. With the code clean, I move the header and footer into separate includable files. You'll have to replace the menu links with a loop to grab those from the admin, change the path to the assets and so on. Then do the same for the next page. Copy from the source's frontend, paste on the template file, replace header and footer for the includes we've prepared when doing the homepage, and proceed cleaning up and replacing the hard-coded content with calls to the page's fields. It takes some time, but it's straightforward. As @lokomotivan pointed out, best is to start from an HTML template. Processwire is geared towards custom-made solutions, where as Wordpress, specially when using templates, is more about allowing the admin to customise the layout from within the CMS. There is no way of directly or automatically replicating the same features of a WP template in PW. But if you take an HTML template, trim it to your needs, then setup PW to have just the fields you need for what you're building, you'll get a much cleaner and easier to use CMS. You can do it in one or two days after you get the hang of it, depending of the site of course.
  10. Good to know it was of use to you. I'll check out your boilerplate as well starting a new project in the future. Maybe webpack would be a good next step for my workflow.
  11. Personally I'm not using package managers. Mainly because I tend to avoid third-party packages in my projects. I'm a bit scared of updating one and breaking stuff. That said, I can show you my boilerplate: https://github.com/heldercervantes/PWBoilerplate This isn't perfect, and I'll certainly tweak it as time goes by, but it's simple and I love simple. Basically it lets me do version control for my templates and leave the PW installation itself out of GIT. Should I need to build a custom module on a project, that's easy enough to change. I'm also doing SCSS, and compile all my JS into a single file. The JS part works well for simpler projects, but i.e. in my own site, I have JS I want to load only on the homepage (3d thingy, a bit bulky if a user lands directly in a blog post where it's not needed), so I had to work around that. If it's any use, I'll be glad.
  12. Great tip @horst , that will come in handy someday
  13. Hey. What would be a clever way of detecting if the page being rendered is the first viewed in a session? Think landing page. In fact, think blog article. I want to put a CTA there that would appear only if the user just landed directly in that page. But if the user came from, i.e., the homepage, I want it to behave differently. Any ideas? Thanks, H
  14. Too many copywriters out of a job? I have a hard time getting clients to write 300 chars on the whole page, let alone the meta description.
  15. Exactly. If any vulnerabilites show up, there will be listings of it, either on Secunia or somewhere else. Certainly here in this forum, at least. And I do state that none of the listed vulnerabilities on the other platforms are scandalously dangerous. Of course PW benefits from freshness. I used a similar argument when I defended a proprietary CMS. But in the end, excuses aside, the fact is a compromised PW site is something unheard of in a 10 years old CMS. That's time enough for something to show up. Whereas if you own a Wordpress site which is "way more mature", you should check for updates every two weeks, just in case, and you risk breaking your site when you update. Basically the point here was to raise awareness that vulnerabilities do exist and pop up regularly. PW comes out ahead? Great! Hey, 2 alerts a month on WP on average? Come on!
  16. Hey guys, some light reading: https://supertiny.agency/en/blog/how-secure-is-your-website/ This discussion pops up from time to time, and this is something I usually point out every time I show PW to a new client, so I thought it would be nice to write a permanent post on the subject. Enjoy.
  17. Hey there! https://magenta.pt/en/ This is my latest release. A company that does digital textile printing. In this one I went way beyond just designing and building the site. I designed the logo and illustrations, shot the video in the homepage and the samples in the gallery as well. I have some tweaks planned after having tested the site with real people, such as adding a visual cue to scroll down on some pages. These will come in later, after gathering all input and planning the update. Technically this follows my usual recipe. Repeaters for building pages in a modular way (see the slideshows in the middle of the text in the services page), AIOM, MarkupSEO, Sitemap... The gallery is hand-built with a custom zooming engine that lets users drag with a finger on touch devices, or reacts to the mouse's position on desktops. Could be smarter loading the images, but for now there are only a handful, so I didn't bother for now and will revise on the 1.1 update. There's also a blog section that is currently hidden until they have enough content to launch it. Hope you like it. EDIT: Here's the case-study on my portfolio: https://supertiny.agency/en/folio/magenta/
  18. What about this one? https://sonarwhal.com/scanner Microsoft just launched their own flavour of web inquisition. I ran my site, had a good laugh.
  19. Hey guys. Can anyone point me to the PW logo (I mean the mark) in SVG, or at least a high-res-ish PNG? I need it for an article I'm writing.
  20. Not critical but somewhat important, at least from a marketing perspective. The other day I was out of the office and detected a problem in one of my sites. I had to use my phone to fix it and found out that on my phone I can't select text from a textarea that's powered by CKE. Can't select, means can't copy/paste, and if what you need is to do is moving a bunch of text around you're screwed. Of course CKE is now PW, but being the standard rich text editor for PW, I'd say we should look into making it more usable on phones.
  • Create New...