• Content count

  • Joined

  • Last visited

  • Days Won


heldercervantes last won the day on July 16

heldercervantes had the most liked content!

Community Reputation

274 Excellent

About heldercervantes

  • Rank
    Sr. Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Porto, Portugal

Recent Profile Visitors

2,171 profile views
  1. I've been doing functions from the start, but more recently I've had a couple of instances where I go for a custom module. I can't really speak in terms of performance, haven't made any tests, but the module approach feels better when there's more than one or two functions, to organise everything more neatly. Example: I'm working on an online store built from scratch. In that project the server shoots emails all the time. On register, on purchase, on order status changes, etc. Each email has a template that can be edited in the CMS. It becomes complex having to handle multiple templates and usage scenarios, replacing variables, different results based on context, so turning it into a module made it much more organised. I guess for me it's about volume and reusability. If it's small stuff I don't bother.
  2. What you're attempting seems too specific. It may be possible to hack the module to use a textLanguage field for tags instead of the simple text one, but that's a bad idea. You'll lose the ability to update the module, and may screw up the API. I'd find another way around it, perhaps using a repeater to hold everything together. I can suggest 2 different approaches: 1. Alternative images field for the second language If you have a field called "images", and another called "images_de", while having a second language with the name "de", the API will automatically use "images_de" if that's the user's language. This will automatically filter all your content. Downside: You'll have to upload images twice. Not good if you want all images to appear on both languages, but then again I have come across the need to have images that appear on one language but not the other so... 2. Use a repeater to hold everything together Set up a repeater, have a field for the image, and a textLanguage for the tags. Downside: You'll have to code your own tags logic for whatever you're building in the frontend, and you'll have to upload images one by one. You do make a good point. If the images field with language support gets different fields for description, I'd say the same should happen to tags as well. Maybe you should add this to the wishlist section of the forum.
  3. I've been mostly a designer too. Up until the end of 2015 I was creative director and my coding days were more than 10 years behind me. I wouldn't suggest anything else. It's super flexible and the API is so straightforward that you'll need little more than to learn how to use a foreach loop in PHP to get on with it. You also have a great community willing to help in this forum, something that frankly I haven't seen anywhere else, coding related or not.
  4. Thanks for the correction @Robin S, have to admit I spoke off the top of my head on that one.
  5. Someone more knowledgeable than me may clarify the why, but it seems you need to combine start with limit. This is for pagination purposes, and it makes sense in that context. I guess it "could" assume an infinite limit by default, but as I said someone more knowledgeable may point out a good reason why it shouldn't. So just put a limit of whatever large number you feel comfortable and it should work. This code works for me: $pl = $pages->find('template=basic-page, start=3, limit=3'); Also, you don't need to set `sort=sort`, that's the default behaviour (see correction below). However if these pages you're grabbing are not children of the same page, you'll have a whole new problem to deal with.
  6. Hey Ben. The last site I built used that version of PW and I find no problem whatsoever running on Chrome in Windows 10. Are you and your client logging in with the same user? I forget to add permissions to the client's user all the time.
  7. Ah New Zealand... I want to visit so bad.
  8. Learning new is something that I do as I work on projects. On my down time I usually work on personal projects. Rethinking my personal site, looking for new opportunities... heck, the other day I found myself creating a text editor web-app, as if there weren't enough of those already, just for the fun of it. The idea is to keep challenging myself, so more and better things can come up in the future.
  9. It certainly does. This was my second one. I literally took the resources folder, view-sourced (just made that a verb) the old site, cleaned up the HTML and added fields to fill it in. More could have been made to improve the HTML and there's a lot in the frontend that I'd have done differently, but we wouldn't want this migration to cost as much as a completely new site
  10. Looks like I missed something moving to production. Thanks for the heads up.
  11. I'll need some time for that. Let me see what I can do.
  12. The idea is quite simple: You set up a repeater field with all the fields you'll need for each type of block. Title, body, images, single image... etc. You add another options field (I called it "type") and populate that with the names of the block types you'll need. For each other field (body, images...) you set up its visibility to show only when type is relevant. The result should be a repeater, when you add a block the only field that shows up will be a drop-down for type, and when you choose that, the relevant fields appear. Setting up a field's visibility: Adding a block before choosing type (ignore the other two fields, that's for something else): And after choosing type... From the template, I'm just doing a foreach that goes through the repeater, then use the type field to decide what "sub-template" file to include. That keeps things neat and separated. This can also be done with a RepeaterMatrix ProField, which simplifies this whole process. On a more recent project I'm currently working on I'm using that combined with field templates to achieve more or less the same effect.
  13. @Sérgio Jardim and I are gonna be there and decided a beer is in order. If you're going to be there, let's hang out.
  14. The title says it all, let's hang out
  15. I'm going too. Probably not the whole thing, I'm still looking at the program. I'm following you on twitter so we can contact at the time.