Jump to content

Search the Community

Showing results for tags 'Module'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. I missed the XML sitemap generator that I used in a previous CMS so I built my own module to achieve the same functionality. This module outputs an XML sitemap of your site that is readable by Google Webmaster Tools etc. I've generally found that it reduces the time it takes for new sites and pages to be listed in search engines using one in combination with Webmaster Tools etc (since you're specifically telling the service that a new site/new pages exist) so thought I may as well create a module for it. The module ignores any hidden pages and their children, assuming that since you don't want these to be visible on the site then you don't want them to be found via search engines either. It also adds a field called sitemap_ignore that you can add to your templates and exclude specific pages on a per-page basis. Again, this assumes that you wish to ignore that page's children as well. The sitemap is accessible at yoursite.com/sitemap.xml - the module checks to see whether this URL has been called and outputs the sitemap, then does a hard exit before PW gets a chance to output a 404 page. If there's a more elegant way of doing this I'll happily change the code to suit. Feedback and suggestions welcome On a slightly different note, I wanted to call the file XMLSitemap originally so as to be clearer about what it does in the filename, but if you have a module that begins with more than one uppercase letter then a warning containing only the module name is displayed on the Modules page, so I changed it to Sitemap instead which is fine as the description still says what it does. File can be downloaded via GitHub here: https://github.com/N.../zipball/master
  2. Hi, today I started and finished work on my new module "TextboxList". It includes "FieldtypeTextboxList" and "InputtypeTextboxList". The main function is to create inputfields like Facebook when you have to insert the name of your friend (see the screenshot below). It automatically creates a new "box" if you press "," or "enter". The result will be saved as a comma-separated list. It is based on the TextboxList.js of Guillermo Rauch so I wouldn't use this for a commercial project right now. (But I wrote him a mail if he would allow this). I changed the color schema so it looks like a native element. I recommend to use it if you have something like a tag list (like: bla, christmas, bla, 2011, bla, ...). You can download it here: https://github.com/N...oll/TextboxList Have fun with it! Greets, Nico
  3. Given a Google Calendar XML feed URL, this module will pull it, cache it, and let you foreach() it or render it. Download at: https://github.com/r.../MarkupLoadGCal USAGE The MarkupLoadRSS module is used from your template files. To use it, you get a copy of the module, tell it what URL to load from (with the load method), and then execute a find() query with a selector string. It works basically the same as a $pages->find("selector string"). <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://calendar XML feed'); $items = $cal->find('from=2011-12-1, to=2011-12-31'); foreach($items as $item) echo "<p>{$item->title}</p>"; To get a Google calendar URL, you would go into your (or another) calendar on Google and click to the calendar's settings. At the bottom of the screen, you will see a section called "Calendar Address" with XML, ICAL, and HTML. Copy the XML address, and use that with this module. If you just want one to test with, use the one from my examples below: http://www.google.co...com/public/full Note: you must use the 'full' not 'basic' calendar from Google Calendar. You can identify if you've got the right one because it will end with 'full' rather than 'basic', as in the URL above. Selector Properties The selector properties you may provide to find() are: from: Starting date in any common date/time format (or unix timestamp). to: Ending date in any common date/time format (or unix timestamp). keywords: Keyword(s) to search for in the Google calendar events. limit: Max number of items to load (default = 100). sort: May be 'date', '-date', 'modified' or '-modified'. html: Set to '0' if you don't want the event description in HTML. The find() method will return the found items. You can then foreach() these items to generate your output. A render() method is also included with the items which provides some default output, if you want it. Calendar Item (Event) Properties Each calendar item has the following properties: title: The title of the event description: Detailed description of the event (in HTML, unless disabled) location: Where the event will take place author: Author of this item from: Timestamp of when the event begins to: Timestamp of when the event ends dateFrom: Formatted date string of when the event begins dateTo: Formatted date string of when the event ends See the module file for additional configuration options. EXAMPLES Example #1: Simplest example <?php // get the calendar module $cal = $modules->get("MarkupLoadGCal"); // set the feed URL: may be any google calendar XML feed URL $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); // find all items for December, 2011 $items = $cal->find('from=2011-12-1, to=2011-12-31'); // render items using built-in rendering echo $items->render(); Example #2: Rendering your own items <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); $items = $cal->find('from=2011-12-1, to=2011-12-31'); foreach($items as $item) { echo " <h2>{$item->title}</h2> <p> <b>Date From:</b> {$item->dateFrom} (Timestamp: {$item->from}) <br /> <b>Date To:</b> {$item->dateTo} (Timestamp: {$item->to}) <br /> <b>Location:</b> {$item->location} <br /> <b>Author:</b> {$item->author} </p> {$item->description} "; } Example #3: Finding Keywords <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); $items = $cal->find("from=Aug 1 2011, to=Dec 1 2011, keywords=Eddie Owen"); echo $items->render(); ADDITIONAL INFO Options See the module's class file (MarkupLoadGCal) for a description of all options in the comments of the $options and $markup arrays at the top of the class file. Handling Errors If an error occurred when loading the feed, the $cal will have an 'error' property populated with a message of what error occurred: <?php $items = $cal->find("..."); if(empty($items) && $cal->error) { // an error occurred echo "Error! " . $cal->error; } $items will be blank if an error occurs, but it will always be of the same type, so it's up to you whether you want to detect errors. If you don't, then your calendar output will just indicate that nothing was found. Cache By default your calendar queries are cached for an hour. You can change the cache time by setting the $cal->cache property to the number of seconds you want it to cache. --- Edit: Added note that you must use the 'full' google calendar feed rather than the 'basic' one.
  4. Hi, I just uploaded the first version of the SchedulePages module to Github: https://github.com/f...r/SchedulePages This plugin module allows you to schedule (un)publication of pages. I hope you guys will like it. //Jasper Usage: ====== Place the SchedulePages.module file into the site/modules folder and install the plugin from the admin area. Install/activate the LazyCron module (if you haven't already). This module is part of the Processwire core, but it isn't activated by default. Add the following date fields to your template: publish_from publish_until Note: the fields are already created during the installation of the module That't all. LazyCron will run take care of (un)publishing your pages that have a the publish dates set. It will run on every hour. Please note: LazyCron hooks are only executed during pageviews that are delivered by ProcessWire. They are not executed when using ProcessWire's API from other scripts. Edit: Changed the name of the module and function as Ryan suggested below. Edit 2: Updated instructions. Required fields are now automatically created and from now it runs every hour. Edit 3: Added module dependency. The updated module is on Github
  5. ProcessWire DataTable 1.0.0 (https://github.com/somatonic/DataTable) This module enables you to find and edit (fancybox modal iframe) pages at a small and very large scale. So far it has: ajax suuport masked pagination state saving (datatable using cookie, template filter using session) template filter (only showing templates user has edit access) search text filter (using title|body field) multilanguage support (PW's language translator) Superuser will see all pages and system templates. Users only those with view|edit access and pages in trash. This Module is still very simple and only in "lazy" developement and testing and this is the first official release mainly to get it out for others to see and use. It also could provide as an example/kickstart for someone. Everyone is encouraged to help and contribute to further improve or add features. The module is hosted on my github account: https://github.com/somatonic/DataTable The plugin used in this module is the excellent jQuery Plugin DataTable 1.8.2 - http://datatables.net/ I've chosen it, because I used in in some other web projects and was really happy about it's power and ease to setup. It supports jQuery UI styling, which makes the deal perfect for a ProcessWire module. Thanks and have fun trying it out. ------ (original post, kept for nostalgic moments) Ok, I started trying to implement the great jQuery dataTables plugin into ProcessWire. So far it works very well and is very powerful and fun. Best of it it support jquery themeroller. Not sure how far this all can go with configuration and how to define which pages should be displayed, what collumns etc... Many many things to consider. But if it could provide as an example on how to implement it, it would be great tool for site builders. Here you can see a short video of how it looks and works.
  6. FieldtypeMapMarker Module for ProcessWire 2.1+ This Fieldtype for ProcessWire 2.1+ holds an address or location name, and automatically geocodes the address to latitude/longitude using Google Maps API. This Fieldtype was also created to serve as an example of creating a custom Fieldtype and Inputfield that contains multiple pieces of data. Download at: https://github.com/r...ldtypeMapMarker How to Use To use, install FieldtypeMapMarker like you would any other module (install instructions: http://processwire.c...wnload/modules/). Then create a new field that uses it. Add that field to a template and edit a page using that template. Enter an address, place or location of any sort into the 'Address' field and hit Save. For example, Google Maps will geocode any of these: 125 E. Court Square, Decatur, GA 30030 Atlanta, GA Disney World The address will be converted into latitude/longitude coordinates when you save the page. The field will also show a map of the location once it has the coordinates. On the front end, you can utilize this data for your own Google Maps (or anything else that you might need latitude/longitude for). Lets assume that your field is called 'marker'. Here is how you would access the components of it from the API: <?php echo $page->marker->address; // outputs the address you entered echo $page->marker->lat; // outputs the latitude echo $page->marker->lng; // outputs the longitude Of course, this Fieldtype works without it's Inputfield too. To geocode an address from the API, all you need to do is set or change the 'address' component of your field, i.e. <?php $page->marker->address = 'Disney Land'; $page->save(); // lat/lng will now be updated to Disney Land's lat/lng
  7. Hi! I just finished the first release of my first PW module: Piwik Top Keywords: https://github.com/f...ik-Top-Keywords This module can be used to create a tag cloud based on the keywords that visitors use to find your site (referrer keywords). These keywords are fetched from your Piwik installation. For those that don't know Piwik, it's an open source alternative for Google Analytics, more info on http://piwik.org. The keywords are, as a query, linked to ProcessWire's search page.* The module can be configured from the admin area, but it's also possible to configure it in your template. In order to reduce the load on your Piwik installation and avoid delays when rendering your pages, it makes sense to use it on cache enabled templates only. I am sure that the code can be improved, since it is my first module and because of the fact that I am not an experienced PHP developer. If you have any suggestions, please let me know. To Install: 1. Download the file attached (PiwikTopKeywords.module) to this post and place in /site/modules/. Go to Modules in the admin, 'Check for new modules' and click install for Piwik Top Keywords under the Piwik section. 2. Add the following to your CSS style sheet: #PiwikTagcloud {list-style-type:none; margin:0px; padding:0px; text-align: center;} #PiwikTagcloud li {display:inline !important; margin-right:15px; line-height:1.5em;} #PiwikTagcloud li a {display:inline; text-decoration: none;} #PiwikTagcloud a:hover {text-decoration: underline;} #PiwikTagcloud .smallest {font-size: 100%;} #PiwikTagcloud .small {font-size: 125%;} #PiwikTagcloud .medium {font-size:150%;} #PiwikTagcloud .large {font-size:170%;} #PiwikTagcloud .largest {font-size:200%;} To use: Add the following to your template: $PiwikTopKeywords = $modules->get("PiwikTopKeywords"); $PiwikTopKeywords->DisplayTopKeywords(); I also attached a screenshot of the output and a screenshot of the admin area: I'm not sure how many of you use Piwik and how many will use this module, but if it's helpful to anyone I am more than happy! //Jasper * Edit: I just realised that is your site doesn't have a search page, you might want to link the keywords to a Google site-search. Simply use the following Search URL in the config: http://www.google.com/#q=site:yoursite.com+
  8. Today I needed to install the latest Textile on an older site for a client, and figured I would go ahead and make a PW2 module out of it at the same time. Textile is the markdown language included with Textpattern CMS and apparently also used by Basecamp and Google+ to some extent. More information about Textile and syntax here: http://en.wikipedia....kup_language%29 Textile is very similar to Markdown (already included with PW), though now that I've spent some time with the syntax, I think I might like Textile a little more. To Install Download or clone from GitHub at: https://github.com/r...ormatterTextile Place files in /site/modules/TextformatterTextile/. Go to Modules in the admin, 'Check for new modules' and click install for Textile under the Textformatter section. You'll also see 'Textile Restricted' and that is a separate version of the module that may be used with untrusted input like user-supplied input or blog comments. The regular Textile should only be used with trusted input. To use Add this to any textarea (or text) field, and that field will interpret Textile codes and output XHTML markup on the front end of your site. Note that Textformatters appear on the 'Details' tab of the field editor when editing a text or textarea field. Use the regular 'Textile' unless the field in question may contain untrusted user input, in which case you should use 'Textile Restricted'. Please note Don't use this in combination with other text formatters like Markdown. Don't use with TinyMCE (there would be no point). This module may be used with any version of ProcessWire: 2.0, 2.1 or 2.2+.
  9. https://github.com/apeisa/Thumbnails Template usage: echo $page->cropImages->eq(0)->getThumb('thumbnail'); Better docs coming soon. Development sponsored by: http://stillmovingdesign.com.au/
  10. Hi, I didn't like the way how ProcessWire works with files right now. So I thought it's time for an Module which makes it better. Right now the module isn't finished but I'm working on it (probably together with Soma). My goal is to create an module which let's you mange all of your files and images easy and let you upload files which aren't connected to a page so that every page can use it. If you have wishes or ideas for this module you can post them here. (Also if you know a better way to solve this) And by the way here's a first screenshot (I started today, so it isn't that great right now). UPDATE: Download: https://github.com/N...oll/ManageFiles
  11. PageEditSoftLock ProcessWire2+ Module There was a request for a page lock feature in PW2.1 for pages being edited by an other user already, it would lock or throw a message of along the line of: "This page is currently being edited by "username'." Thanks to Ryan for helping getting this done quickly! Download: https://github.com/s...ageEditSoftLock How it works Only the module "PageEditSoftLock" needs to be installed/uninstalled, the "ProcessPageEditSoftLock" Module will install/uninstall itself. The module creates a table and a hidden admin page under /page/edit/ for pinging in the background while editing a page. You can configure the ping interval and expiration timeout to what you think is good. Defaults - 20 seconds for pinging, - 60 seconds for expiration time (all entries in the table older than this will get deleted). ---- 27-02-2012 update https://github.com/s...1f204bc1b6c740a Fix for new repeater field throwing the lock message because of the way repeater work and this module. Thanks to Ryan for finding a quick fix.
  12. PROCESSWIRE PROFILE EXPORTER This module serves two purposes: To enable exporting of ProcessWire 2.0 sites to a profile that can then be imported into ProcessWire 2.1 (i.e. to upgrade to 2.1). To enable exporting of ProcessWire 2.1 site profiles for sharing or distribution with others. In either case, the profile exporter does not touch your existing site. It just creates files in a directory (/site/install/) that can then be used for a fresh installation of ProcessWire. PLEASE NOTE: Consider this module alpha test only. It has not had a lot of use or testing yet so it's advisable to use it in a test environment and not on a production server at this time. I am posting this for those that indicated they wanted to help test the PW 2.0 to 2.1 upgrade process. HOW TO INSTALL Download at: https://github.com/r...ssExportProfile Place the file ProcessExportProfile.module in /site/modules/ Login to your admin, click "Modules" at the top, and click "Check for new modules" Click "install" for the Process > Export Profile module. It will create a new page where you can access it under the Setup menu. HOW TO EXPORT A PROFILE A profile consists of your site's database, files and templates. To create a profile, Go to Setup > Export Profile. Read the instructions and continue. Once the profile has been created, you can copy it somewhere else, zip it up, or [if performing an upgrade] copy it directly into your PW 2.1 directory as indicated in the 'upgrading' section below. The profile consists of files in these directories: /site/install/ < required /site/templates/ < required /site/modules/ < optional: use only if you have custom modules to include in the profile /site/templates-admin/ < optional: use only if you have a custom admin theme to include in the profile /site/assets/ < optional: use only if exporting all of /site/, and it should be left empty like PW's default profile* /site/config.php < optional: use only if you want to specify custom config settings, leave out otherwise** These directories collectively form the entire /site/ structure of a ProcessWire installation. If using the profile to upgrade ProcessWire from 2.0 to 2.1 then you'll only want the first two directories above (install and templates)–see the 'Upgrading' section following this one, as the instructions for upgrading are a little different than if you were exporting profiles for distribution. If you intend to share/distribute your profile with others (as opposed to upgrading), you'll want to ZIP them up into an archive (or use something like GitHub). You may want to make your profile include the entire /site/ directory for easier installation by others. If using the entire /site/ directory as your profile, then just copy all the /site/ files from ProcessWire's default uninstalled profile and replace the directories/files that you want to. For instance, you'll always want to replace the /site/install/ and /site/templates/ directories, but if your profile doesn't include plugin modules or configuration file changes, then you'd keep the default /site/config.php file and /site/modules/ directory from ProcessWire's default profile. *Any time you are including the entire /site/ directory as your profile, you'll want to include the /site/assets/ directory exactly as it is in the default ProcessWire uninstalled profile. That means the directory is empty, minus an index.php file. During installation, the installer copies files from /site/install/files/ to /site/assets/files/ and ensures they are writable. ProcessWire's installer also creates several other directories under /site/assets. But you don't need to worry about that. **If you ever do include a /site/config.php in your profile, make sure to remove the last 5 lines that contain confidential information about your database and user system hash. Once you've saved your profile somewhere else, you should delete the files that this module saved in /site/install/ (they might be consuming a lot of disk space). You'll see a link to do this after you've finished exporting a profile. UPGRADING FROM PROCESSWIRE 2.0 TO 2.1 This upgrade process is a little different from what you may have seen before. We won't actually be upgrading your current site. Instead we'll be exporting a profile of it, and using it to install a new/fresh copy of ProcessWire 2.1. To make this work, you'll have to install your copy of ProcessWire 2.1 in another location or another server. Once you've completed the installation and verified that everything is how it should be, you may then replace the original ProcessWire 2.0 site with the new one. It should be noted that this upgrade does not cover user accounts or access control. You will have to re-create any user accounts and access settings in the new system. This was necessary because PW 2.1 uses an entirely different user system and access control than PW 2.0. Should you have a lot of user accounts that need to be converted, let me know more in the PW forums and I can guide you through how to handle your specific case. Performing the upgrade 1. Export a site profile as described in the previous section. 2. Download the latest copy of ProcessWire 2.1 at http://processwire.com/download/ and install in a new location. If you are installing on the same server in a different directroy, then don't use the same database as you did in 2.0. Instead create a new database that you will be using for 2.1. 3. Before starting the 2.1 installer, copy these directories from your ProcessWire 2.0 installation to your ProcessWire 2.1 files (completely replacing the directories in the 2.1 files): /site/install/ => /site-default/install/ /site/templates/ => /site-default/templates/ 4. Now run the ProcessWire 2.1 installer by loading the URL to it in your browser. If all goes as it should, you'll see your 2.0 site now running 2.1. There are some likely issues that may occur, so read the following section about troubleshooting whether you think you need to or not. 2.0 TO 2.1 UPGRADE TROUBLESHOOTING I installed 2.1 using the new profile but now I get a 404 Not Found for every page If you run into this problem, login to ProcessWire 2.1 (/processwire/), edit the template used by your homepage, click the "access" tab and "yes". Then check the box for "guest" view access, and save. Your site should now be functional. I installed 2.1 using the new profile but now many pages have no title ProcessWire 2.0 assumed that all pages had a title field whether it was ever officially assigned to the template or not. ProcessWire 2.1 is different in this regard. So if you run into pages without titles, edit the templates used by those pages, add the field 'title' and hit save. The issue should now be fixed. I ran out of memory or had a timeout when exporting a profile or installing the 2.1 site with the profile On a large site, it's possible that the resources dedicated to PHP might not be enough for the exporter or installer to complete it's job. Should this happen to you, we may need to do one or more parts of the process manually. So if you run into this scenario, please post in the forum and we'll get it figured out. I installed 2.1 and all went well but I now have a non-working "Export Profile" page on my Setup menu (last item) This is the page used by the Profile Exporter module on your 2.0 site. Your 2.1 site won't have the Profile Exporter installed and you can safely delete this page or drag it to the trash.
  13. Hi guys, I've been doing events sections for a few sites and for each I needed to make an iCal feed. I've wrapped up this functionality into a module now to make it a little easier for myself and anyone else that needs to make these feeds. The module is basically a simple wrapper around the iCalcreator library (a copy is included). It's modelled on the MarkupRSS module from Ryan, so anyone familiar with that should have a feed up and running in no time. Usage The module takes a PageArray and creates the feed from that. The [tt]->render[/tt] method will send the output to the browser with a generated filename and will automatically download. Because it will return HTTP headers, it has to be included before any html and is best in its own template or followed up by [tt]exit;[/tt] <?php $today = time(); $items = $pages->find("template=event, sort=start_date, start_date>$today"); $ics = $modules->get("MarkupiCalendar"); $ics->title = "Upcoming Events"; $ics->description = "Some upcoming events"; $ics->itemStartDateField = 'start_date'; $ics->itemEndDateField = 'end_date'; $ics->itemLocationField = 'location'; $ics->render($items); You can use the [tt]->renderFeed[/tt] method to return the output as a string instead, which is particularly useful if you want to debug or write the output to a file. <?php $today = time(); $items = $pages->find("template=event, sort=start_date, start_date>$today"); $ics = $modules->get("MarkupiCalendar"); $ics->title = "Upcoming Events"; $ics->description = "Some upcoming events"; $ics->itemStartDateField = 'start_date'; $ics->itemEndDateField = 'end_date'; $ics->itemLocationField = 'location'; $cal = $ics->renderFeed($items); echo $cal; I often put RSS and iCal feeds at the top of my listing pages so as not to clutter up the site tree with extra templates. This way /events/ may point to my events page, and /events/ical will point to it's feed. Here is an example: <?php // iCal feed if ($input->urlSegment1 == "ical") { $today = time(); $items = $page->children("sort=start_date, start_date>$today"); $ics = $modules->get("MarkupiCalendar"); $ics->title = "Upcoming Events"; $ics->description = "Upcoming events for my company"; $ics->itemStartDateField = 'start_date'; $ics->itemEndDateField = 'end_date'; $ics->itemLocationField = 'location'; $ics->url = $page->httpUrl; $ics->render($items); exit; } // Render the template as normal. include("./includes/head.inc"); Download and feedback You can download or fork the module here: https://github.com/f...MarkupiCalendar At the moment it only supports all day events (as these are all I have dealt with) but I hope to add time based events soon. Any feedback is warmly appreciated and feel free to report bugs or suggestions for improvement. Stephen
  14. Provides ability to send an email, ping a URL or save a log entry when a login occurs to ProcessWire. Works with all logins. So if you've made your own login form on the front end of your site, this will still work with it. Download at: https://github.com/ryancramerdesign/LoginNotifier After you click the install button in Admin > Modules, you will get a configuration screen that looks like the following (attached).
  15. This module checks for changes on forms in the PW admin and throws a confirm dialog before leaving page without saving. Thanks to Ryan for the new module name suggestion. Much better choice I think. The module can be configured to switched on or off the check for each of these areas: - Page Edit - Field Edit - Template Edit - Access Pages - Modules Settings (may this not was neccessary, but just for the fun of trying to do a configurable module, well I just did it) ### update 1.0.3 - fixed issue with delete button throwing the alert ### update 1.0.2 - fixed issue with script adding (again) - updated some texts and documentation #update 1.0.1 - fixed issue with script adding - fixed subdir installation path - added script versioning Download: http://modules.processwire.com/modules/form-save-reminder/ Github: https://github.com/somatonic/FormSaveReminder
  16. ProcessWire RSS Feed Loader Given an RSS feed URL, this module will pull it, and let you foreach() it or render it. This module will also cache feeds that you retrieve with it. The module is designed for ProcessWire 2.1+, but may also work with 2.0 (haven't tried yet). This module is the opposite of the MarkupRSS module that comes with ProcessWire because that module creates RSS feeds. Whereas this module loads them and gives you easy access to the data to do whatever you want. For a simple live example of this module in use, see the processwire.com homepage (and many of the inside pages) for the "Latest Forum Post" section in the sidebar. Download at: https://github.com/r...n/MarkupLoadRSS REQUIREMENTS This module requires that your PHP installation have the 'allow_url_fopen' option enabled. By default, it is enabled in PHP. However, some hosts turn it off for security reasons. This module will prevent itself from being installed if your system doesn't have allow_url_fopen. If you run into this problem, let me know as we may be able to find some other way of making it work without too much trouble. INSTALLATION The MarkupLoadRSS module installs in the same way as all PW modules: 1. Copy the MarkupLoadRSS.module file to your /site/modules/ directory. 2. Login to ProcessWire admin, click 'Modules' and 'Check for New Modules'. 3. Click 'Install' next to the Markup Load RSS module. USAGE The MarkupLoadRSS module is used from your template files. Usage is described with these examples: Example #1: Cycling through a feed <?php $rss = $modules->get("MarkupLoadRSS"); $rss->load("http://www.di.net/articles/rss/"); foreach($rss as $item) { echo "<p>"; echo "<a href='{$item->url}'>{$item->title}</a> "; echo $item->date . "<br /> "; echo $item->description; echo "</p>"; } Example #2: Using the built-in rendering <?php $rss = $modules->get("MarkupLoadRSS"); echo $rss->render("http://www.di.net/articles/rss/"); Example #3: Specifying options and using channel titles <?php $rss = $modules->get("MarkupLoadRSS"); $rss->limit = 5; $rss->cache = 0; $rss->maxLength = 255; $rss->dateFormat = 'm/d/Y H:i:s'; $rss->load("http://www.di.net/articles/rss/"); echo "<h2>{$rss->title}</h2>"; echo "<p>{$rss->description}</p>"; echo "<ul>"; foreach($rss as $item) { echo "<li>" . $item->title . "</li>"; } echo "</ul>"; OPTIONS Options MUST be set before calling load() or render(). <?php // specify that you want to load up to 3 items (default = 10) $rss->limit = 3; // set the feed to cache for an hour (default = 120 seconds) // if you want to disable the cache, set it to 0. $rss->cache = 3600; // set the max length of any field, i.e. description (default = 2048) // field values longer than this will be truncated $rss->maxLength = 255; // tell it to strip out any HTML tags (default = true) $rss->stripTags = true; // tell it to encode any entities in the feed (default = true); $rss->encodeEntities = true; // set the date format used for output (use PHP date string) $rss->dateFormat = "Y-m-d g:i a"; See the $options array in the class for more options. You can also customize all output produced by the render() method, though it is probably easier just to foreach() the $rss yourself. But see the module class file and $options array near the top to see how to change the markup that render() produces. MORE DETAILS This module loads the given RSS feed and all data from it. It then populates that data into a WireArray of Page-like objects. All of the fields in the RSS <items> feed are accessible, so you use whatever the feed provides. The most common and expected field names in the RSS channel are: $rss->title $rss->pubDate (or $rss->date) $rss->description (or $rss->body) $rss->link (or $rss->url) $rss->created (unix timestamp of pubDate) The most common and expected field names for each RSS item are: $item->title $item->pubDate (or $item->date) $item->description (or $item->body) $item->link (or $item->url) $item->created (unix timestamp of pubDate) For convenience and consistency, ProcessWire translates some common RSS fields to the PW-equivalent naming style. You can choose to use either the ProcessWire-style name or the traditional RSS name, as shown above. HANDLING ERRORS If an error occurred when loading the feed, the $rss object will have 0 items in it: <?php $rss->load("..."); if(!count($rss)) { error } In addition, the $rss->error property always contains a detailed description of what error occurred: <?php if($rss->error) { echo "<p>{$rss->error}</p>"; } I recommend only checking for or reporting errors when you are developing and testing. On production sites you should skip error checking/testing, as blank output is a clear indication of an error. This module will not throw runtime exceptions so if an error occurs, it's not going to halt the site.
  17. Form Save Reminder Module To prevent losing unsaved changes when editing a Page: This module checks for changes while editing a page, and throws a confirm dialog when leaving the page without saving. More Infos and download this module: http://modules.proce...-save-reminder/
  18. HelperFieldLinks Just got a new module working that is only visible to superusers, and is handy for when developing a site, or investigate someone elses. 1. It adds a shortcut link to all fields on page in the backend. The link name equals the field name, so on very large complex sites with lots of fields, it can help to quickly see what name the field has. 2. It also adds a shortcut to the used template (in the template select field under "Settings" tab). They appear on bottom right corner of the field. Any suggestions for a better module name and general feedback is welcome. ProcessWire Modules Directory: http://modules.proce...er-field-links/ Direct github download: https://github.com/s...elperFieldLinks
  19. Here is a new module for ProcessWire 2.1 that imports pages from a CSV file. By default it will create new pages from data in the CSV file, but you can also configure it to modify existing pages too (existing pages that have the same title). Please give it a try and let me know how it works for you and if you run into any issues with it. This module is something I've had in the works for awhile, and regularly use on various projects, so figured I should clean it up a bit and release it. Also attached are a couple screenshots from it. How to Install: 1. Download from: https://github.com/r.../ImportPagesCSV 2. Place the file ImportPagesCSV.module in your /site/modules/ directory. 3. In ProcessWire admin, click to 'Modules' and 'Check for new modules'. 4. Click 'install' next to the 'Import Pages CSV' module (under heading 'Import'). Following that, you'll see a new menu option for this module on your Admin > Setup menu. Supported field types for importing:* PageTitle Text Textarea (including normal or TinyMCE) Integer Float Email URL Checkbox (single) *I'll be adding support for multi-value, page-reference and file-based Fieldtypes in a future version.
  20. There was a request that I add an official thread for this module, so here it is. MarkupTwitterFeed generates a feed of your tweets that you can output on your site. When you view the processwire.com homepage and see the latest tweets in the footer, this module is where they are coming from. This module was recently updated to support Twitter's new API which requires oAuth authentication. modules.processwire.com page GitHub project page Usage instructions
  21. Update 31.7.2019: AdminBar is now maintained by @teppo. Modules directory entry has been updated, as well as the "grab the code" link below. *** Latest screencast: http://www.screencas...73-ab3ba1fea30c Grab the code: https://github.com/teppokoivula/AdminBar *** I put this Adminbar thingy (from here: http://processwire.c...topic,50.0.html) to modules section and to it's own topic. I recorded quick and messy screencast (really, my first screencast ever) to show what I have made so far. You can see it from here: http://www.screencas...18-1bc0d49841b4 When the modal goes off, I click on the "dark side". I make it so fast on screencast, so it might seem a little bit confusing. Current way is, that you can edit, go back to see the site (without saving anything), continue editing and save. After that you still have the edit window, but if you click "dark side" after saving, then the whole page will be reloaded and you see new edits live. I am not sure if that is best way: there are some strengths in this thinking, but it is probably better that after saving there shouldn't be a possibility to continue editing. It might confuse because then if you make edits, click on dark side -> *page refresh* -> You lose your edits. *** When I get my "starting module" from Ryan, I will turn this into real module. Now I had to make some little tweaks to ProcessPageEdit.module (to keep modal after form submits). These probably won't hurt anything: if($this->redirectUrl) $this->session->redirect($this->redirectUrl); if(!empty($_GET['modal'])) $this->session->redirect("./?id={$this->page->id}&modal=true"); // NEW LINE else $this->session->redirect("./?id={$this->page->id}"); and... if(!empty($_GET['modal'])) { $form->attr('action', './?id=' . $this->id . '&modal=true'); } else { $form->attr('action', './?id=' . $this->id); // OLD LINE }
  22. MarkupCache is a simple module that enables you to cache any individual parts in a template. I'm working on a site now that has 500+ cities in a select pulldown generated from ProcessWire pages. Loading 500+ pages and creating the select options on every pageview isn't terribly efficient, but I didn't want to cache the whole template because it needed to support dynamic parameters in the URL. The solution was to cache just the code that generated the select options. Here's an example: $cache = $modules->get("MarkupCache"); if(!$data = $cache->get("something")) { // ... generate your markup in $data ... $cache->save($data); } echo $data; I left the markup generation code (the part that gets cached) out of the example above to keep it simple. Below is the same example as above, but filled out with code that finds the pages and generates the markup (the part that gets cached): $cache = $modules->get("MarkupCache"); if(!$data = $cache->get("city_options")) { foreach($pages->find("template=city, sort=name") as $city) { $data .= "<option value='{$city->id}'>{$city->title}</option>"; } $cache->save($data); } echo $data; That was an example of a place where this module might be useful, but of course this module can used to cache any snippets of code. By default, it caches the markup for an hour. If you wanted to cache it for a longer or shorter amount of time, you would just specify the number of seconds as a second parameter in the get() call. For example, this would keep a 60-second cache of the data: $cache->get("city_options", 60) I hope to have it posted to GitHub soon and it will be included in the ProcessWire distribution. If anyone wants it now, just let me know and I'll post it here or email it to you.
×
×
  • Create New...