-
Posts
6 -
Joined
-
Last visited
Everything posted by LexSanchez
-
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(); } } -
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