Jump to content


Photo

Modules Fieldtype

Module

  • Please log in to reply
2 replies to this topic

#1 ryan

ryan

    Hero Member

  • Administrators
  • 5,984 posts
  • 3384

  • LocationAtlanta, GA

Posted 08 July 2012 - 06:55 AM

This probably won't be useful to most people, but this is a module I put together a couple weeks ago for my own needs. I thought it might be helpful with a question that came up in another thread, so just wanted to post it here too since I figured all the modules should be listed here.

ProcessWire Modules Fieldtype

Fieldtype that stores reference to one or more other modules. This is similar to FieldtypeModule except that it stores multiple modules. It uses asmSelect to make the selection sortable/searchable.


To install

Copy to /site/modules/ and go to Admin > Modules > Check for new modules.


Usage notes

Note the configuration settings that appear on the details tab when creating a new field that uses this module.

Lets say you created a field called my_modules that uses this Fieldtype. The value of your $page->my_modules will be a PHP array. When $page->outputFormatting is TRUE, the values of the array will be selected module objects (already instantiated/initialized). When output formatting is FALSE, the values will be module IDs (integers). Those IDs can be converted to either the module class name or an instance of the module using existing $modules API methods.

Download

https://github.com/r...ieldtypeModules

#2 Pete

Pete

    Administrator

  • Administrators
  • 1,802 posts
  • 727

  • LocationChester, England

Posted 09 July 2012 - 08:23 AM

Sounds interesting - are you able to share what you're using it for?

#3 ryan

ryan

    Hero Member

  • Administrators
  • 5,984 posts
  • 3384

  • LocationAtlanta, GA

Posted 09 July 2012 - 10:57 AM

Actually I was using it for the Blog profile. I was using it so that you could select from what "widget" modules you wanted to display in the sidebar and sort them. The widgets were markup rendering modules. However, I went back to making the widgets as pages (selected as page references), as I thought it was ultimately more flexible. So in the end, I'm not using this module for anything. But think there will be other situations where it is useful.





Also tagged with one or more of these keywords: Module

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users