Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/01/2025 in all areas

  1. I came across this and thought it was cool. https://deepwiki.com/processwire/processwire
    12 points
  2. Just a brief note for anyone following this theme, I have spent some time reading over the various discussions regarding the new default theme and I will need to dig in deeper before I implement any changes to accommodate CSS variables. For now, if you wish to use Chroma for the backend please select 'original' as your AdminThemeUIKit preference. I'm working out some better math for some color calculations to make them less prone to throwing contrast/accessibility errors.
    2 points
  3. Thanks @gmclelland! Pretty useful service for getting high-level overviews. I tried this prompt: Explain how ProcessWire handles locales. And got this: # How ProcessWire Handles Locales ProcessWire provides comprehensive locale support through its **LanguageSupport module system**, which manages internationalization (i18n) and localization functionality across the entire framework. ## Core Locale Management ProcessWire's locale handling is primarily managed through the **Languages class**, which extends WireArray and provides centralized locale management functionality [1](#0-0) . This class contains the main `setLocale()` and `getLocale()` methods that handle locale settings throughout the system [2](#0-1) . The system uses PHP's native `setlocale()` function as its foundation, with extensive wrapper functionality to support multi-language environments [3](#0-2) . The locale settings affect various categories including `LC_ALL` and `LC_NUMERIC` for proper formatting of numbers, dates, and other locale-specific content. ## Individual Language Objects Each language in ProcessWire is represented by a **Language object** that includes its own locale management methods [4](#0-3) . These objects provide wrapper methods that allow setting locales on a per-language basis, enabling fine-grained control over locale settings for different languages in multilingual sites. ## Translation Functions ProcessWire implements a GetText-like translation system with three core functions that work with the locale system [5](#0-4) : - `__()` for basic string translation - `_x()` for contextual translation with additional context - `_n()` for plural form handling These functions are available both globally and as methods in Wire-derived classes [6](#0-5) . ## System Integration The locale system is initialized during system startup through the **LanguageSupport module** [7](#0-6) . This ensures that proper locale settings are established early in the request lifecycle. Locale settings also integrate with other core components: - **Number formatting** through WireNumberTools, which uses locale information for proper numeric display [8](#0-7) - **Page name localization** for multilingual URLs through LanguageSupportPageNames [9](#0-8) - **Field value management** for multilingual content through specialized field types [10](#0-9) ## Locale Validation and Maintenance ProcessWire includes system checks to ensure locale settings are properly configured and functional [11](#0-10) . These checks help identify and resolve locale-related issues during system updates and maintenance. ## Notes ProcessWire's locale handling system is designed to be flexible and comprehensive, supporting both simple single-language sites and complex multilingual installations. The system builds on PHP's native locale functionality while providing ProcessWire-specific enhancements for content management scenarios. The modular architecture allows locale functionality to be enabled or disabled as needed, making it suitable for sites that may not require internationalization features.
    1 point
  4. @TomPich Yes, but it only gives me back the ID. Most of the options in the documentation has printed the ID. @ngrmm It works, the result: <link rel='alternate' hreflang='x-default' href='https://domain.local:8890/leistungen/' /> <link rel='alternate' hreflang='de' href='https://domain.local:8890/leistungen/' /> <link rel='alternate' hreflang='english' href='https://domain.local:8890/en/services/' /> That's perfect. The only thing I changed is: $hreflang = $language->title; to get <link rel='alternate' hreflang='en' href='https://domain.local:8890/en/services/' /> Thanks a lot!
    1 point
  5. this is how I did it // Output a default alternate link for search engines that don't support hreflang echo "<link rel='alternate' hreflang='x-default' href='$page->httpUrl' />"; // Loop through all available languages foreach($languages as $language) { if(!$page->viewable($language)) continue; $url = $page->localHttpUrl($language); $hreflang = $language->name; // Replace "default" with "de" (assumes "de" is the default language) $hreflang = ($hreflang == 'default') ? "de" : $hreflang; // Output the alternate link for the current language echo "<link rel='alternate' hreflang='$hreflang' href='$url' />"; }
    1 point
  6. This module is a remake of Ryan's classic Comments module, but uses its own code and is based on the FrontendForms module. This is the third module in the "Frontend" series, alongside the FrontendContact and FrontendLoginRegister modules. To use this module, FrontendForms must be installed. Otherwise, it won't work! If you don't have this module installed yet, please download and install it first! This module has a large amount of configuration settings supports pagination supports UiKit3, Boostrap 5 and Pico 2 CSS frameworks out of the box and a lot more The download link as well as many more images and the documentation for this module can be found on Github. Please note: This is the first version in an early alpha stage, so using it on live sites is not recommended. This module should be available in the module directory eventually, but it still needs a lot of testing. If you discover any issues or have ideas for improving the module, please post them here in the forum or directly on Github. Happy testing!
    1 point
×
×
  • Create New...