Jump to content

Pete

Administrators
  • Posts

    3,994
  • Joined

  • Last visited

  • Days Won

    64

Pete last won the day on February 13

Pete had the most liked content!

3 Followers

About Pete

  • Birthday October 4

Profile Information

  • Gender
    Male
  • Location
    Lake District, England

Recent Profile Visitors

42,478 profile views

Pete's Achievements

Hero Member

Hero Member (6/6)

3.9k

Reputation

24

Community Answers

  1. Registrations on the forums have been temporarily disabled whilst we deal with a bot problem. Hopefully we'll be able to re-enable registrations later today.
  2. So I tried this method but it still puts in the parameter if it's empty: I think the solution is to use the notes to convey what the default value will be if empty, but also have a way not to add it into the markup if it's empty - perhaps some sort of __omit_empty override, so default_term__omit_empty parameter since we don't want to make assumptions for everyone else using this already? That way for these specific cases I can also add a note warning them that if it's left empty it will defer to the defaults that can change over time so the content editor has had fair warning. EDIT again - my brain is not in gear today because I can simply do this myself and check for an empty value ๐Ÿ˜† So this is a non-issue now - I can work with this easily by doing: if(strlen($default_term) === 0) { // use the default value in the PHP code } And using strlen because the value might actually be a zero of course. Edit #237: Here's my solution: Attributes: default_amount default_amount__notes=Leave blank to default to 150000 - default may be changed in future default_term default_term__notes=Leave blank to default to 25 years - default may be changed in future default_type default_type__type=select default_type__options=Repayment|Interest Only default_type__notes=Leave blank to default to Repayment default_rate default_rate__notes=Leave blank to default to 4% - default may be changed in future And defaults are now set in the PHP code, overridden with the HannaCode selections if any values are set <?php namespace ProcessWire; $types = ['Repayment' => 'repayment', 'Interest Only' => 'interest']; $default_amount = strlen($default_amount) > 0 ? $default_amount : 150000; $default_term = strlen($default_term) > 0 ? $default_term : 25; $default_type = strlen($default_type) > 0 ? $types[$default_type] : 'repayment'; $default_rate = strlen($default_rate) > 0 ? $default_rate : 4; echo $files->render('partials/calculators/mortgage', ['default_amount' => $default_amount, 'default_term' => $default_term, 'default_type' => $default_type, 'default_rate' => $default_rate]);
  3. Neat, I missed that! @Robin S a very good point and I'm not sure what the solution is to be honest. EDIT: skip to next post. A few options: For some tags the easiest option is not to use the Hanna Code Dialog - maybe we could simply have an option to skip your module being used on a per-tag basis somehow? I've no idea how hard that would be but would solve the problem for this one but still allow it to work for other tags on the same site In the Hanna Code Dialog have the defaults set as placeholders instead of default values - that way if they aren't populated then they aren't used? I can simply set the defaults in the PHP code then. I think perhaps option 2 makes the most sense above - if a dialog option has no value entered simply don't add it into the tag markup. EDIT: @Robin S actually the obvious answer is to use parametername__notes and mention the default there and add the default values into the PHP code I think - I'll try that now.
  4. @Robin S something I had noticed when making all variables editable is even if you don't change them from the defaults, it inserts them into the code. For example, I have a site where I want use this for a mortgage calculator and want to set things like term (years), type (repayment/interest-only), rate (percentage) and so on, but if I only want to change the "type" from repayment (default) to interest only on one page, the hannacode also ends up setting the rate in the code in the editor even though I leave it as the default. This wouldn't normally be a problem but the site has articles for different terms, repayment types and potentially interest rates, but when interest rates change I change the default rate in the Hannacode, but using the dialog it makes it fixed for that page. I think if you use the dialog and the value saved == the default value, it just shouldn't appear in the hanna code block. In my example, this would be the default with no overrides: [[mortgage_calculator]] And some pages I'll want it to default the mortgage amount: [[mortgage_calculator default_amount="70000"]] But changing one variable sets them all using HannacodeDialog even though the other values are the default ones: [[mortgage_calculator default_amount="70000" default_rate="4" default_type="repayment" default_term="25"]] On another note I'm also keen to see a TinyMCE version ๐Ÿฅบ๐Ÿ˜…. I know it's a lot harder than this next suggestion, but I did get ChatGPT to write most of a plugin for both TinyMCE and CKEditor in the past year- I knew nothing about plugins for either editor prior to that but with ChatGPT's help I was able to get there in about 90 minutes versus some confusing (to me!) documentation. It was funny because it was ChatGPT creating a plugin to write an article outline USING ChatGPT for one of them ๐Ÿ˜†
  5. @Jason Spooner I'm submitting a PR on Github now for Horst to look at - thanks for finding the issue.
  6. @horst the regex mentioned above does appear to be faulty as it only allows domain endings up to 6 characters whereas this discussion suggests an upper limit of 63 (though nobody has created one that long yet to my knowledge). I would just go for 2,24 for now to keep it relatively sensible as the longest currently is 24, or you could just make it 2,63 to future-proof it a bit? Source: https://stackoverflow.com/a/22038535
  7. @MarkE I was going to say "+1 for the times feature" but for accommodation it doesn't make as much sense to have it there as you are mainly after the number of days/nights right? Arrival/departure times could simply be set against each holiday cottage/apartment or fall back to a "company standard" arrival/departure time like you get with some of the bigger companies? All I'm thinking is otherwise you need to enter the arrival and departure time *every time* rather than have it set at one of the "parent levels" like cottage/apartment or globally. @ryan I definitely see the point for an optional time input for some types of event - like a single day course that runs 11am-3pm it would be good to still use this field otherwise you're back to needing 2 fields again. Same for multi-day events where there's a very definite start and end time. These are the sorts of things where on the frontend you would have a calendar with all the events on and there would be a real mix of single/multi-day but you definitely want a way of showing the times. Also allows for frontend stuff like the Resource Timeline and Resource Time Grid on libraries like https://fullcalendar.io/demos
  8. Thanks Ryan, I've really wanted something like this for a long time so good to hear you're making progress. ProDrafts is useful, but if this allows for a more complete version history like you might get in other CMS' and you can also then add in approval workflows down the line (separate module I reckon) that would be amazing too as I have a few sites where there are several people working on stuff at once and I know at least one of our mutual clients might find it useful too ๐Ÿ™‚
  9. Hi folks, I have a system with multiple separate installations that should be identical really apart from uploads and database and, for a long time, for no particular reason, the only folder I've symlinked to a "master" folder is the wire directory. Since nothing should differ on these installations apart from the site/assets folder, should I just be able to symlink all other directories too? In theory all I need to be unique is the assets folder and the site config files. There are obviously quite a few benefits - only having to update modules in one place, updating all installations to the same version at once from the master version etc. Currently I've been doing it with Github but I've realised I'm just duplicating a lot of files unnecessarily whilst I'm not using something like Docker (it will use something like that eventually but not needed for a year or two). I would be interested to know how others have approached this if you've had a similar business need.
  10. Can confirm this is caching properly now (tested using Wirecache option).
  11. Just tested and sending via CURL using Postmark's API from a command line it went through fine so I guess it must be the module trimming the .solutions part of the domain unless the server config can also have an effect on emails sent this way?
  12. Hi Horst, is there anything in the module that would trim a recipient's TLD? I'm finding a recipient with a .solutions domain is getting their addresses trimmed to user@domain.soluti when sending via Postmark but I didn't have this issue on an earlier version of the module... not that I can remember anyway ๐Ÿ™‚
  13. Ooh nice to see autocomplete getting some updates there ๐Ÿ™‚
  14. Thanks again - I've got the demo working. The HTMX demo works with 2 dummy variations under a product, but the Alpine demo doesn't show the options. I don't think it matters too much though as I've still got a lot to look at adapting this to my project first - I'll let you know how I get on.
  15. Wow thanks - I'll take a look and let you know how I get on!
ร—
ร—
  • Create New...