-
Posts
8 -
Joined
-
Last visited
-
Days Won
1
LexSanchez last won the day on April 17
LexSanchez had the most liked content!
Contact Methods
-
Website URL
http://dnespanama.com/
Profile Information
-
Gender
Male
-
Location
Panamá
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
LexSanchez's Achievements
Newbie (2/6)
35
Reputation
-
TextformatterFontAwesome A Textformatter module for ProcessWire that converts text shortcuts into Font Awesome icons. Features ✅ Converts shortcuts like :fa-star: into Font Awesome icons ✅ Flexible icon mapping configuration ✅ Support for Font Awesome 6+ (solid, regular, brands) ✅ Automatic asset loading from CDN ✅ HTML or SVG output ✅ Cache for improved performance ✅ Easy configuration from the ProcessWire admin Installation Download or clone this module into /site/modules/TextformatterFontAwesome/ Go to Modules > Refresh in the ProcessWire admin Install the TextformatterFontAwesome module Configure icon mappings as needed Configuration Icon Mappings Define your text shortcuts and their corresponding Font Awesome classes: :fa-star: = fa-solid fa-star :fa-heart: = fa-solid fa-heart :fa-home: = fa-solid fa-house :fa-user: = fa-solid fa-user :fa-email: = fa-solid fa-envelope :fa-facebook: = fa-brands fa-facebook :fa-twitter: = fa-brands fa-twitter Configuration Options Output Format: HTML (CSS) or SVG Load Assets: Automatically include Font Awesome from CDN CDN Version: Font Awesome version to load (default 6.5.1) Custom CSS: Optional URL for custom CSS Enable Cache: Cache mappings for improved performance Usage 1. Apply to Fields Go to Setup > Fields > select your text field and in the Details tab: Under Applied Textformatters, select Font Awesome Icons Save the field 2. Use in Templates // The textformatter is automatically applied when rendering the field echo $page->body; // Shortcuts like :fa-star: are converted automatically // Or apply manually $textformatter = $modules->get('TextformatterFontAwesome'); $text = "I like this page :fa-heart: It's great! :fa-star:"; $textformatter->format($text); echo $text; // Output: I like this page <i class="fa-solid fa-heart"></i> It's great! <i class="fa-solid fa-star"></i> 3. Shortcut Examples Shortcut Result Description :fa-star: <i class="fa-solid fa-star"></i> Solid star :fa-heart: <i class="fa-solid fa-heart"></i> Solid heart :fa-home: <i class="fa-solid fa-house"></i> Solid house :fa-facebook: <i class="fa-brands fa-facebook"></i> Facebook logo :fa-email: <i class="fa-solid fa-envelope"></i> Email envelope Content Usage Examples In a Text Editor Welcome to our site! :fa-star: Contact us: - Email: info@example.com :fa-email: - Phone: +1234567890 :fa-phone: Follow us on social media: - Facebook :fa-facebook: - Twitter :fa-twitter: - Instagram :fa-instagram: Thanks for visiting! :fa-heart: HTML Output Welcome to our site! <i class="fa-solid fa-star"></i> Contact us: - Email: info@example.com <i class="fa-solid fa-envelope"></i> - Phone: +1234567890 <i class="fa-solid fa-phone"></i> Follow us on social media: - Facebook <i class="fa-brands fa-facebook"></i> - Twitter <i class="fa-brands fa-twitter"></i> - Instagram <i class="fa-brands fa-instagram"></i> Thanks for visiting! <i class="fa-solid fa-heart"></i> Advanced Customization Custom Mappings You can create your own shortcuts: :my-icon: = fa-solid fa-custom-icon :company: = fa-solid fa-building :product: = fa-solid fa-box Custom CSS If you use Font Awesome Pro or have custom icons: .fa-custom-icon::before { content: "\f123"; } Programmatic Usage // Get the module $fa = $modules->get('TextformatterFontAwesome'); // Format text $content = "Text with icons :fa-star: and :fa-heart:"; $fa->format($content); echo $content; // Configure dynamically $fa->set('outputFormat', 'svg'); $fa->set('loadAssets', false); Performance The module includes cache for parsed mappings Assets are loaded only when needed Smart detection of content with icons Compatibility ProcessWire 3.0+ Font Awesome 6.0+ PHP 7.4+ Support To report bugs or request features, visit: GitHub Issues License Mozilla Public License v2.0 Credits Based on TextformatterEmoji by Ryan Cramer.
- 1 reply
-
- 4
-
-
TrackingScripts Module Manage and inject tracking scripts (Google Analytics, Google Ads, Facebook Pixel, custom code) into site pages, with optional PrivacyWire consent integration and robots.txt/llms.txt file management. Features Google Analytics (GA4) — inject gtag.js with Measurement ID Google Ads — inject gtag.js with Ads conversion ID Facebook Pixel — inject Pixel tracking code with noscript fallback Custom code — free-form textareas for any third-party scripts (head and/or body) PrivacyWire integration — when enabled, scripts are injected with data-category attributes and type="text/plain" so they only load after user consent robots.txt & llms.txt — edit and auto-generate both files from the admin; content is written to the site root on save Per-service controls — enable/disable, position (head or body), and consent category for each service independently ID validation — regex validation for GA (G-), Ads (AW-), and Pixel (numeric) IDs before injection Admin-only exclusion — scripts are never injected on admin or form-builder templates Files site/modules/TrackingScripts/ ├── TrackingScripts.info.php ← module metadata ├── TrackingScripts.module.php ← main module (hooks, script injection) ├── TrackingScriptsConfig.php ← module configuration (ModuleConfig) ├── ProcessTrackingScriptsConfig.info.php ← Process module metadata └── ProcessTrackingScriptsConfig.module ← admin UI for non-superusers Installation Copy the TrackingScripts folder into /site/modules/ In the admin go to Modules → Refresh, then install TrackingScripts Optionally install ProcessTrackingScriptsConfig — this adds a Setup → Tracking Scripts page that allows non-superuser roles to edit the configuration. Assign the tracking-scripts-config permission to any role that needs access. Configuration Go to Modules → Configure → TrackingScripts (superuser) or Setup → Tracking Scripts (any user with permission). Google Analytics Field Description Enable Activate/deactivate injection Measurement ID GA4 ID, e.g. G-XXXXXXXXXX Position Inject in <head> or before </body> PrivacyWire Category Consent category (default: Statistics) Google Ads Field Description Enable Activate/deactivate injection Ads ID e.g. AW-XXXXXXXXX Position Inject in <head> or before </body> PrivacyWire Category Consent category (default: Marketing) Facebook Pixel Field Description Enable Activate/deactivate injection Pixel ID Numeric ID, e.g. 123456789012345 Position Inject in <head> or before </body> PrivacyWire Category Consent category (default: Marketing) Custom Tracking Code Two free-form textareas for any additional third-party code: Custom Code — Head: injected before </head> Custom Code — Body: injected before </body> PrivacyWire Integration When enabled, all tracking scripts are rendered with PrivacyWire-compatible attributes: <script type="text/plain" data-type="text/javascript" data-category="statistics" class="require-consent" src="..."></script> This ensures scripts only execute after the user gives consent for the corresponding cookie category. Requires the PrivacyWire module to be installed and active. Robots.txt & LLMs.txt Edit the content of both files directly from the admin. On save, the files are written to (or removed from) the site root: /robots.txt — search engine crawler directives /llms.txt — LLM/AI bot directives If a textarea is left empty, the corresponding file is deleted from the site root. How It Works The module hooks into Page::render (priority 100) to inject scripts via str_replace on </head> and </body>. This means: No template modifications required Works on all front-end pages automatically Runs before PrivacyWire (priority 101), so consent attributes are in place when PrivacyWire processes the page The robots.txt and llms.txt files are written via a hook on Modules::saveConfig, triggered whenever the module configuration is saved from either the module config screen or the Process admin page. ProcessTrackingScriptsConfig (Admin UI) A Process module that mirrors the full TrackingScripts configuration under Setup → Tracking Scripts. Purpose Allows non-superuser roles to manage tracking scripts without access to the Modules admin. Permission The module registers the permission tracking-scripts-config. To grant access: Go to Access → Roles Edit the desired role Check tracking-scripts-config Save How it works Reads and writes the same configuration data as TrackingScripts via $modules->getConfig() / $modules->saveConfig() Changes from either location (Modules → Configure or Setup → Tracking Scripts) are reflected in both Saving triggers the same Modules::saveConfig hook, so robots.txt/llms.txt files are written automatically Requirements ProcessWire 3.0.110+ PHP 7.2+ PrivacyWire (optional, for consent integration) License Licensed under the MIT License.
-
- 4
-
-
LexSanchez started following Module: Video or Social Post Embed and FrontEnd Login Not Work with AWS Cloudfront
-
Hi everyone: I do not know if someone before using ProcessWire with AWS CloudFront, currently I have problems with the login, it does not work for any reason, when I check in the logs generated by ProcessWire, it only indicates This request was aborted because it appears to be forged. (in /wire/core/SessionCSRF.php line 190). I have allowed CloudFront to forward all headers, cookies and allow all methods (GET, POST, PUT). When I perform the same process from the ip server if it works or from the balancer.
- 1 reply
-
- aws
- cloudfront
-
(and 1 more)
Tagged with:
-
Hi Bernhard: Sorry for answering something late, I attached 2 images of how it is shown in social network content.
-
Allowing a user to view certain admin page
LexSanchez replied to louisstephens's topic in Module/Plugin Development
Hi Louis: In the information array of your module you can add 'permission' => 'permission-name', add this permission to the role you need edit or use this module. -
Hello Theo: Thanks for your comment; I have made an update to the module that solves this error, please uninstall the module replace with the new version. Regards,
-
Text input in ProcessHello
LexSanchez replied to Sean Dinwiddie's topic in Module/Plugin Development
Hi Sean: This is a basic example of how to create a module that has configurable fields. <?php class Example extends Process implements Module, ConfigurableModule { private static $pathDir; /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( // The module's title, typically a little more descriptive than the class name 'title' => 'Example Module', // version number 'version' => '0.0.1', // summary is brief description of what this module is 'summary' => 'This module descripton.', // author 'author' => 'Author Name', // singular=true: indicates that only one instance of the module is allowed. // This is usually what you want for modules that attach hooks. 'singular' => true, // autoload=true: indicates the module should be started with ProcessWire. // This is necessary for any modules that attach runtime hooks, otherwise those // hooks won't get attached unless some other code calls the module on it's own. // Note that autoload modules are almost always also 'singular' (seen above). 'autoload' => true, // If true, the module may not be uninstalled once installed. 'permanent' => false, 'page' => array( // optionally install/uninstall a page for this process automatically 'name' => 'example-module', // name of page to create 'parent' => '', // parent name (under admin) or omit or blank to assume admin root 'title' => 'Example Module', // title of page, or omit to use the title already specified above ), 'permission' => 'example-module', 'requires' => array('PHP>=5.4.1', 'ProcessWire>=2.7.0'), 'icon' => 'film', // module icon ); } public static function getModuleConfigInputfields(array $data) { // ------------------------------------------------------------------------ // Initialize InputField wrapper // ------------------------------------------------------------------------ $fields = new InputfieldWrapper(); // ------------------------------------------------------------------------ // Define text input field for the directory path. // ------------------------------------------------------------------------ $field = wire('modules')->get('InputfieldText'); $field->name = 'pathDirectory'; $field->label = __('Directory Videos'); $field->required = true; $field->columnWidth = 50; $field->value = (!empty($data['pathDirectory']) ? rtrim($data['pathDirectory'],"/")."/" : '/var/www/html/videos/'); $field->description = __('Description Field.'); $fields->add($field); // ------------------------------------------------------------------------ // Return of the fields. // ------------------------------------------------------------------------ return $fields; } public function ___install() { parent::___install(); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // Variable from module settings self::$pathDir = $this->pathDirectory; } /** * Executed when root url for module is accessed * */ public function ___execute() { $preview = $this->modules->get("InputfieldMarkup"); $preview->value .= "<h2>echo " . $this->pathDirectory . "</h2>"; return $preview->render(); } } -
LexSanchez changed their profile photo
-
Video or Social Post Embed Based on the TextformatterVideoEmbed module developed by Ryan Cramer, we have added the possibility to embed publications of the main social networks Facebook, Twitter and Instagram. ProcessWire Textformatter module that enables translation of YouTube, Vimeo, Instagram, Facebook, Twitter or Issuu URLs to full embed codes, resulting in a viewable video or social post in textarea fields you apply it to. How to install Download or Clone from Github: https://github.com/lexsanchez/VideoOrSocialPostEmbed Copy the VideoOrSocialPostEmbed.module file to your /site/modules/ directory (or place it in /site/modules/VideoOrSocialPostEmbed/). Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "Video or Social Post Embed". Now you will be on the module config screen. Please make note of the config options and set as you see fit. How to use Edit your body field in Setup > Fields (or whatever field(s) you will be placing videos in). On the details tab, find the Text Formatters field and select "Video or Social Post Embed". Save. Edit a page using the field you edited and paste in YouTube, Vimeo, Facebook, Twitter, Instagram and/or Issuu URLs each on their own paragraph. Example How it might look in your editor (like TinyMCE): How it works This module uses YouTube, Vimeo, Instagram, Facebook, Twitter and Issuu oEmbed services to generate the embed codes populated in your content. After these services are queried the first time, the embed code is cached so that it doesn't need to be pulled again. Configuration You may want to update the max width and max height settings on the module's configuration screen. You should make these consistent with what is supported by your site design. If you change these max width / max height settings you may also want to check the box to clear cache, so that YouTube/Vimeo/Facebook/Twitter/Instagram/Issuu oembed services will generate new embed codes for you. Using with Markdown, Textile or other LML This text formatter is looking for a YouTube, Vimeo, Instagram, Facebook, Twitter or Issuu video URL surrounded by paragraph tags. As a result, if you are using Markdown or Textile (or something else like it) you want that text formatter to run before this one. That ensures that the expected paragraph tags will be present when VideoOrSocialPostEmbed runs. You can control the order that text formatters are run in by drag/drop sorting in the field editor. Copyright 2018 by Ryan Cramer / Updated by Lex Sanchez