Recently Browsing 0 members
No registered users viewing this page.
I have been following @bernhard's great tutorial on creating a Dashboard and everything has very easy to understand so far. However, I need to add a select field that a template is using (so users can create a new page from the dashboard), but I am really at a complete lost on how to achieve this. I have been googling, but can't really find anything on the matter.
$field = $this->modules->get('InputfieldSelect'); $field->name = "Select Manufacturer"; $field->findPagesSelector = "template=basic-page"; //not needed for select field $field->labelFieldName = "title"; $field->name = "Manufacturer Select"; $field->columnWidth = 34; $fieldset->add($field); I have the above code, which was originally an InputfieldPage, but since this is an options field, I have changed it. Has anyone actually gotten a select from a template (and its' values) in a module?
By Lex Sanchez
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.
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.
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
A while back I was trying to get Processwire working on the Homestead vagrant box - a really handy vagrant box made by Taylor Otwell (Laravel creator). One cool thing about homestead is it has its own config file where you can set 'path maps' which map a folder on your computer to the vagrant box, and then also set up hostnames. So for example you can set up 10 domains pointing to different locations on your machine, making it a nice all in one vagrant development box for your sites.
One thing it didn't do was support processwire. The way it works is it uses setup files for each site, and you can specify things like a site to use nginx, a site to use apache, etc.
So to get round this I wrote a custom setup script for it to get processwire working, and it works really well. I've put it up on github should anyone else find it handy, it's a pretty simple little script and is based on the Laravel one included in Homestead.
Hopefully it'll be useful to someone out there You can grab it here: https://github.com/rickmills/homestead-processwire
This module provides functions to validate email adresses and hosts. The module generates a textfile for blacklisted mailhosts (trashmail), which will be always up to date.
// get module $mailcheck = $modules->get('EmailVerification'); // return bool/ string - automatted update of blacklist file $mailcheck->blacklisted(email|domain) // return bool - validate a top level domain, checks against IANA list $mailcheck->validTLD(tld) // return array of punycoded TLDs - cyclic updated, data pulled from IANA $mailcheck->getTLDs(cycle=2592000) // return bool - checks syntax converts to punycode $mailcheck->validDomainName(domain); // return bool - checks punycode encoded syntax $mailcheck->validHostName(host); // return bool - checks syntax and accessibility $mailcheck->validHost(email|domain) // add a single value to blacklist $mailcheck->addToBlacklist(email|domain) USAGE
$mailcheck = $modules->get('EmailCheck'); $email = 'firstname.lastname@example.org'; if($mailcheck->blacklisted($email)) echo 'Email Provider not allowed'; if(!$mailcheck->validHost($email)) echo 'Mailhost not available'; Example blacklist file: blacklist.txt