Jump to content

asbjorn

Members
  • Posts

    179
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by asbjorn

  1. That sound like a good and also simple solution 🙂 . Could you do a post, and maybe a link to a GitHub repo (?) in the Modules/Plugins subforum when and if you are happy with the results in the future?

  2. Do any of you have experience and/or solutions for auto generated alt text in ProcessWire? I use https://alttext.ai/ with a WordPress plugin for another site. But am not that experienced with API work to put together a working integration myself for ProcessWire using their API.

    Have anyone solved this using the mentioned service or otherwise, and care to share thoughts on the theme?

  3. With PHP 8.2 I get this error:

    Deprecated: Use of "parent" in callables is deprecated in /**/site/modules/TextformatterParsedownExtraPlugin/lib/ParsedownExtraPlugin.php on line 94

    Is this something that could be fixed in an update of the plugin? 🙂

  4. The console and testing with a string works fine. And thanks for the input on the InputfieldPageName module settings, I'll try that.

    The problem is when I am working with the page title ($page->title) and not a string. Using $sanitizer->pageNameTranslate($page->title) outputs "a-young-doctor-039-s-notebook-amp-other-stories" when in a template.

    ($sanitizer->pageNameTranslate("A Young Doctor's Notebook & Other Stories") works fine).

    Update:

    Turning off "HTML Entity Encoder" settings for the page title field works. Is that recommended?

  5. I have been trying to do the same as @Hurme, without luck.

    My page titles have `'` and `&` and other special characters. I.e. the page title "A Young Doctor's Notebook & Other Stories".

    I have tried pageName, pageNameTranslate and pageNameUTF8 in different variations with the value "true" and/or "$beautify". But the results are always something like:

    • a-young-doctor-039-s-notebook-amp-other-stories
    • a-young-doctor--039-s-notebook--amp--other-stories

    Copy/paste of the page title "A Young Doctor's Notebook & Other Stories" into the name edit field in dashboard results in a-young-doctors-notebook-other-stories , which is what I am trying to achieve.

    (A bonus would be if "&" was translated to "and" as well.)

  6. I got my shared host to move me to a server with MySQL 8. What I am experiencing is that the language codes (no_NO and/or en_US.UTF-8 variations) does not work in /wire/modules/LanguageSupport/LanguageSupport.module.

    It might or might not be MySQL related, and I have found no solution yet. But I thought I should just put it out there,  so as multi language site owners could be aware if the issue should show.

  7. I found no other simpler solution, so I went for a loop through of languages, and summarized the count.

    // Save current language
    $savedLanguage = $user->language; 
    
    // Loop through languages
    // Find the other language
    // Code is only for two languages as of now
    foreach($languages as $language) {
      if  ($language->id == $savedLanguage->id) continue; 
      if(!$page->viewable($language)) continue;
      $user->language = $language;
      $languageCount = $pages->count("template=post");
    }
    
    // Revert to saved language
    $user->language = $savedLanguage;
    
    // Total count
    // Add up current language count and the other
    $postCount = $pages->count("template=post") + $languageCount;
    
    // Output number
    echo $postCount;

     

  8. As of today, the email sent contains the TFA-code alone. Is it possible for a function to add the timout, such as:

    "The code will expire at 08:00:35 (HH:MM:SS)" or something similar?

    I have older users for a project, and many do think the code has expired when sometimes the email takes a while to reach the inbox. So an expire timestamp would help along the way.

  9. I use the TfaEmail module to send emails with the Tfa code. The reason is that my users are familiar with email, not very technical otherwise, so that other Tfa solutions is a bit too advanced.

    Sometimes the email service is a bit slow, and the sending of email with codes might take a minute or two, so the users try again because they think the code has expired. So I was looking to implement another sentence in the email, after the code, that says "This code will expire at HH:ii". But I am at a loss on how to do this.

    At https://github.com/ryancramerdesign/TfaEmail/issues/1 I have requested this, but there might be easier ways like a hook or something? Any answer to put me in the right direction would be helpful. Other solutions that could help me with the issue (slow emails) is also very welcome.

  10. Currently version 4.7.0 of Font Awesom is used in ProcessWire for icons for templates and fields. Since its release, both version 5 have come – and version 6 is in the making. I would like to see a newer version in the future in ProcessWire, @ryan

    4.7.0 (in ProcessWire) has around 675 icons as far as I can tell. The current Font Awesome version has around 1600 icons. When version 6 comes, theres around 2200 icons I have read.

    • Like 5
  11. I have the following setup:

    • Pages with two level URL segments, e.g. /this-page/urlsegment1/urlsegment2/
    • More than often, due to changes in the data set, the part of the url that is /this-page/ changes name to /this-page-something-else/
    • PagePathHistory (the modules is installed) saves previous names and handles all the redirects when it comes to the URL without URL segments. URL segmented pages returns 404 errors though

    Looking for a solution, I was thinking of using the information in the PagePathHistory like this:

    • First, look for /this-page/urlsegment1/urlsegment2/, if it gives an 404 error:
    • Second, look for /this-page/ in any pages PagePathHistory, if it exists:
    • Third: Redirect to /this-page/'s new URL (/this-page-something-else/)

    I have tried:

    • $pages->get("path=/this-page/") without luck (expecting no luck here)
    • $pagePathHistory->getPage("/this-page/"), but this returns Fatal feil: Uncaught Error: Call to a member function getPage()

    Has anyone tried anything similar, with PagePathHistory, or maybe any third party modules?

×
×
  • Create New...