Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by heldercervantes

  1. Hey friends. I'm wrapping up a project that's being hosted on an IIS server (2016). There were problems with rewrites and /processwire/ wasn't working. Snooping around I found this post and on an first glance it seemed to work well. But checking again today I see that /processwire/ kinda works, I can even login, but all page assets (css, js files) fail with a 404 so everythings inlined and in Times New Roman. I don't know the first thing about IIS. Can anyone help? @nikola, you around? Thanks, H
  2. Hey guys. Another noob question about modules. I'm making a module that, when a page is saved, generates a json file that will be read from an outside app to get the latest news. I'm almost there, got the module working and generating the json file nicely, but I'm still struggling with images. Basically I want to output something like `$page->image->size(300,300)->url`, but that doesn't work saying size isn't available in this context. So I tried passing it without the size, but then the url only outputs the image's assets directory, not the file itself. Couldn't find anything in the docs ?
  3. That is a good idea. Maybe I'll suggest that as an upgrade when we do a performance review. That and a search box. Initially this was very simplified, summarised in a single page with only a paragraph of text for each specialty. Very visual, but very little content and a bit hard to scan, as you had to scroll through a huge page to find the specialty you're looking for. But considering they'll start investing in SEM, that needed to change and have dedicated pages where users land from a campaign. Looking at how it's turned out now, a dropdown menu of sorts would certainly make it quicker to navigate. Good point.
  4. I just realised I never showcased this site here, and it's a pretty one. https://clinicatrust.pt/ Clínica Trust is a health clinic in downtown Porto offering services on multiple medical fields. The website is a collaboration between Supertiny and Go Design (whose site is also PW, by the way). Go designed it, we built it. This was made some two years ago, and I just came back to it as we're back to working with this clinic on SEO, social media and marketing. Since we're starting a marketing effort for this client, recently we've refactored the specialties structure. Where initially we had a single page listing all specialties with a paragraph of text for each one, we now have dedicated pages for each one and profiles for each specialist. This will allow campaigns and posts to point directly to a specialty and create the necessary means for better ads and greater conversion. The scheduling form was also tweaked for better conversion tracking and improved UX, as now a user can request an appointment straight from a specialty/specialist page and have that info automatically carried over to the request.
  5. Right now it's broken ? hopefully I'll have it fixed real soon. My initial approach is this: https://heldercervantes.com/tiny-cookie-consent/ On PW's side, I just have a field where you enter the analytics and other scripts. But when this is rendered on the page, some replacements occur that make sure the scripts don't run. It's a matter of replacing stuff like `type="javascript"` to `type="text/plain"`, or renaming the src attribute to data-src. Then I have a JS on the consent popup that when the user clicks the accept button the `type="text/plain"` is reverted and the block is added to the page again, starting the script. When it starts, my script also checks if a `cookieConsent` cookie is set to 1 (this is set when you accept cookies). If it is, the scripts are activated automatically on page load and the popup doesn't show again. But anyhow, there's a flaw in this approach for sites that run ads. If there are ads campaigns pointing to the site, not firing the scripts at all means no stats and no conversion tracking. This is unacceptable if you're running ads, so right now I'm rebuilding this as I move to GA4 and consent mode. I'm experimenting on myself before implementing this on clients.
  6. That's weird, shouldn't happen. Maybe you skipped on a specific point of the animation where the interrupt script fails. It's tricky to manage, as there are a lot of timouts, intervals, and even animejs timelines that need to be stopped when you skip. I spent way more time than I like to admit trying to get that to work nicely, but I didn't build the animation with skipping in mind and later paid for that mistake ?
  7. You can get a bunch of problems by not having the correct URL in $config->httpHosts. Basically anything that generates an absolute URL will fall back to the first one on that list.
  8. Thank you all for your contributions. In the end I think I'm gonna go with a mix of Google Analytics (great find) and search logs for the unsuccessful searches. It looks to me that this combo would give the best results for what I'm making. It's not an actual search, but a POC that's based on search. Fingers crossed. If this works, it will be a really cool case study.
  9. How would you implement statistics for a PW search system? I want to A) develop something that in the future allows me to understand the trends of what users are searching for in the site, and B) understand if good answers have been given. This second one is might sound trickier, but maybe it's actually easier. I can add a "Not what you're looking for?" button that, while providing the user some path to follow (even if it's opening the search box again), could also save the search term in a log of unfulfilled searches. Storing logs for searches is what's bugging me more. The volume might become too great, and I have no idea how to do it in a way that lets me later discover the most and least popular search terms.
  10. I have to get a good grasp of what people might search for there. It's a quite specific service, so you either want to report, submit, or request stuff. Shouldn't be too hard to come up with a list of synonyms and associate that with actions. Then do the same for the various things you can report, submit or request. When a user doesn't find it, log what they searched and review that log from time to time to help fine-tune the keywords and conversation scripts. Of course, knowing my fellow coutrypeople, I can expect instead of "I want to {request} the {document_x}, please", someone will write "My son is going to college and in the registration process he needs a document that says I don't owe the state anything".
  11. Hey people. Has any of you ever implemented a conversational interface on a website? Any pointers? I'm evaluating a project for a public service office and was asked to consider a chatbot. Plenty about chatbots leave me somewhat aprehensive, especially relying on an external service that would have to point users to pages in the site. I'm thinking maybe it's not that hard to whip up a tool that asks a user what they want to do and provide answers, using PW's search and creating "stories" as pages. I want to...? Report a pothole Request document X Update my address ... Finding keywords and pointing to solutions that link to the correct page or phone number for a given story seems pretty simple. Or am I oversimplifying this and risking building a useless tool?
  12. Hello, my Processwire family. Just minutes ago I flipped on the switch for my agency's new website. Check it out here: https://supertiny.agency/ This is a year of changes. I've finished my collab with a major studio, focused back on Supertiny, Liliana joined me for marketing, campaigns and strategy services, and over the last few months I've been working on the agency's website overhaul. Curiosities: Threejs based intro: After learning a few new tricks from the Awwwards winner Bruno Simon and his incredible course, I went oldschool and made an intro for this website. The intro runs once, the session remembers it's been played and turns to a discreet mode if users return to the homepage, allowing a replay. Using my Tiny Cookie Consent as a web component, I made an approach that I'll probably use a lot going forward. I have a text field in the CMS for all the scripts, and with some PHP find/replace that's undone on the client side, trackers and stats are being turned on only when the user allows it. As usual, repeaters and content blocks allow mix and match when building content. The design and overall vibe takes cues from 80's sci-fi. When I started designing this I was playing Control on my PS4 and overloaded with nostalgia, and attempted to convey some of that in this website. Now, there's a bit of an experiment here. All UX bibles are saying that it's a sin make an intro, lock scroll and whatnot. But this is a site users are probably only going to see once. So my approach here is more like a Yield sign. There's an intro, the scroll is locked, but you have a skip button. I'm basically trying to make the user slow down a bit and take in the concept, but let them through if they're really in a rush. Also, as a communication strategy, I'm placing my bets on case studies that will be promoted in social networks, and also new content on the Insights which will hopefully become more interesting with video content. Users coming from there will only see the intro if after seeing that content they get curious and have a lookaround. This is making sense in my head, but it's a bet. I'm curious to see how it performs and if I have to change the approach. Let me know what you think.
  13. I don't really do routing here. Still need to learn that. My use of Stencil is more based on the benefits in organization and workflow. It's super easy to bring a component from one project to the next, and it's easier to maintain when everything is neat and tidy. Using my boilerplate I basically start with a StencilJS + Storybook base, to develop individual components and demo them. If it's a super simple project, storybook already generates a static site nicely. See this one here: https://papoes.iniciativaliberal.pt/, where I just made the basic components and combined them in simple HTML pages. And from there, if we have an HTML page you know how easy it is to make it dynamic with PW ? My suggestion is just to try out the getting started on Stencil's page. It's really not that much of a stretch going from knowing HTML+CSS+JS to webcomponents. Once there, when you feel comfortable, look into the routing bit. You're right. Still plenty of room to improve that bit.
  14. Hello boys and girls, here's my newest: https://drinkbodegabay.com/ Bodega Bay is a Hard Seltzer drink that's delivered sustainably and contributes to projects to move climate solutions forward and help those less fortunate than ourselves. The website was built with my customary repeater based content blocks solution. The frontend is based on webcomponents built with StencilJS, and as always, it was a pleasure to build. An interesting detail was the processing we had to make on the locations listed in the Where to Buy section. Basically we were handed an Excel list of locations with irregular addresses that had to be geographically located on google maps. Well, maps doesn't really agree with doing that much processing at once, so we had to convert each location's address into coordinates. We built a script that imported everything to pages, then another one that made requests to grab the coordinates from google maps, store them and move on. As Maps defends itself against multiple requests, this script had to wait, pick out the locations that were already georeffed, and repeat a few times until all were processed. In the end, only a couple of locations had to be manually referenced, as Google wasn't able to find them from the way the address was formed. Another detail was the interstitial we have here. Being an alcoholic drink, this must have an age verification popup. It also needed a cookies popup and language selection. So the solution here was to combine all that in an interstitial (languages are disabled now until they translate everything), where the user is redirected on the first time to get that out of the way, but with user agent testing it lets scrapers pass. I'm a bit worried this might cause problems down the line, so we're keeping an eye on it and will reconsider this solution if need be. Hope you like it. I'll have an even better one to show real soon ?
  15. Thanks for all the inputs. At least for now I'm sticking with user agent detection and keep an eye on it. I got it through Lighthouse and the major social network's scrapers, and will test it further to make sure there are no issues. Yes, I'm worried about that, but I'm trying to avoid popup hell by combining age verification, cookie preference and language selection in a single place. I suppose those can all be placed in a popup as well, so I'll keep that option in mind if I run into trouble. I'll post this project in the showcase section as soon as my client fills in the SEO stuff.
  16. I'm actually combining three things into one: Age verification, cookies consent and language selection. The site also has a lot of micro animations as elements enter the page that I'd rather not have happening behind a pesky modal. Might have to give in to the modal approach, but I'm hoping I can avoid it somehow.
  17. I was naive about this and got myself into a head scratcher on a new site that I'll showcase soon. It's a booze site, so users have to make a pinky promise that they are of legal age to access it. And so I thought "hey, let's have a cookie store the age validation, and if that's unset I redirect them to a gate page. I even pass the original page's id in there so that they return to wherever they landed." That's what I did, on PHP, and it seemed to work really well. It's all nice and dandy until I realise that when you attept to share the page on Facebook, the scraper is redirected too and everyone ends up sharing the gate page and not the cool cocktail recipe they wanted. Page indexing is probably compromised as well, and there's no way Lighthouse will ever tell me anything constructive about a page I want to test. I can only think of two options this late at night. First one is to check the user agent on PHP and only redirect if it looks like an actual browser. The second is to move that logic to client side JS. Checking for user agent sounds super falible. Moving the logic to JS will probably let robots scan the page and social networks read the OG info, but I suspect Lighthouse will get caught in the redirection as well. Any clever ideas on how to get around this?
  18. Yeah, that's more or less what I do. Would be cool to have something more elegant though, that wouldn't require all that configuration and conditional rendering on the frontend.
  19. I found this: https://github.com/TomS-/processwire-fieldtype-assisted-url Almost there, but it doesn't handle languages ?
  20. Is there anything as a field that allows the user to either select a page OR enter a URL? With what's available, it seems I can either give my editors a page field that doesn't allow them to point to outside URLs, or I give them a multi-language text field where they have to type the link in each individual language. This sucks. On some occations I've given both options. Page select and a multilanguage text field that overrides it. Not very elegant, sucks. Doesn't validate the URL, sucks. What would be awesome? A single field where the user either selects a page from the tree or inputs a URL with multi-language option. Also on the API, a boolean property that would easily tell if it's a page or manually entered URL that I could use to make it open in a new tab. ?⭐ Perfection!! Yeah, I know, been here long enough to know that by now I should be able to whip up a module like that. Alas, I suck.
  21. Thanks for the input guys. Sounds like a page per report is the most reasonable option. It all depends on the budget of course. There are a couple of issues that may carry a lot of complexity. First is how the clients (companies) are handled. I can either have a company be a user and then relate a report to that user for simplicity, or I can have the company as a page, a master user that's able to create sub-users for their staff. I'll need to build a UI to handle all that, which sounds lovely. Then there's the UI for uploading. Doing it one by one is not reasonable. Even uploading 50 reports and then being presented with a list where you select a company for each report sounds like something that's bound to cause errors (not sure if basing it on file naming convention would be much better though). I'll see that when I get there. Can't be sure of the best solution without seeing how those are produced.
  22. Hey guys, gals and everyone else. So, I'm sketching out a solution for a client, a platform where they deliver weekly reports to their clients, with a UI where clients log in to view their reports history. Each report is a PDF file Around 120 clients, meaning about the same number of PDFs submitted weekly Each client sees only their own reports, oc. What I'm unsure about is how to store all this. I'm thinking of making an interface where a zip file is uploaded, each PDF inside follows a rule like starting with the client's id or reference so it can be properly assigned to the client. What do you think is better? Store all this in a files field? Store each report as a page? Sounds weird to me to have hundreds of files in a field, but then again it also sounds much to have 120 new pages added every week. And of course this has to be organised, searchable by dates and whatnot.
  23. Damn, what a noob. That was it. How does one make a full project, publish it, test it, and never see a broken pages or a piece of red text anywhere saying Hey, where's your <body> tag? A mistery. Thank you sir, beer's on me ?
  24. @wbmnfktr The script tag is embedded but the cookie is not there. https://maisliberdade.pt/biblioteca/riqueza-das-nacoes-vol-i/ No errors on the console too. Checked again, cookieless tracking is off.
  • Create New...