PHPackages                             dudley/dudley - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. dudley/dudley

AbandonedArchivedWordpress-plugin[Framework](/categories/framework)

dudley/dudley
=============

A WordPress plugin framework for developing custom modules powered by meta fields.

28PHP

Since Aug 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jmichaelward/dudley)[ Packagist](https://packagist.org/packages/dudley/dudley)[ RSS](/packages/dudley-dudley/feed)WikiDiscussions development Synced 2w ago

READMEChangelogDependenciesVersions (3)Used By (0)

Plugin Name
===========

[](#plugin-name)

Contributors: jmichaelward, 3five, WebDevStudios Donate link: Tags: patterns library, web components, modular design system Requires at least: 4.5.3 Tested up to: 4.7.4 Stable tag: 0.1 License: GPLv2 or later License URI:

Description
===========

[](#description)

Clients hire agencies and freelancers to develop fully-custom themes for their website. Designers create mockups, developers build these mockups out to spec, and before long, the site is live. What we sometimes fail to recognize in the process is that, although the theme is custom, many of the components that comprise it are a reimagining of a component that was developed in a previous project.

Web users have come to expect certain kinds of functionality on a site and, as a result, a variety of design patterns have emerged. Developers have a tendency to recreate these patterns from scratch each time we take on a new project: image carousels, FAQ accordions, huge banner areas with headlines and calls to actions, featured links, and so on.

The goal of the Dudley plugin is to simplify the process. Instead of building *everything* from scratch, what if we reused some of the most common patterns, so that we could instead focus our efforts on the parts of a site that are truly custom?

This plugin provides out-of-the-box access to a series of packages for developers to install. Generally, these packages should contain the following:

- Code that defines the meta fields for each module (e.g., something like an ACF JSON file, or a custom PHP file)
- PHP model classes for accessing and outputting that data
- Template view files with HTML markup for each module
- Base CSS and JavaScript that provides the core visual structure and interactivity required by the module

Requirements
------------

[](#requirements)

- Latest stable version of Composer
- PHP 5.4 or greater

Installation
------------

[](#installation)

- Clone this repo into the plugins directory of your WordPress installation `git clone git@bitbucket.org:jmw-patterns/dudley.git`
- Search for packages to install on [Packagist.org](https://packagist.org). All native Dudley packages are prefaced with `dudley`.
- Configure Dudley's `composer.json` file to require the packages you need. Here is an example configuration that uses the Banner and Social Media Accounts packages:

```
{
  "name": "dudley/dudley",
  "description": "A WordPress plugin framework for developing custom modules powered by meta fields.",
  "type": "wordpress-plugin",
  "authors": [
    {
      "name": "Jeremy Ward",
      "email": "jeremy@jmichaelward.com",
      "role": "Lead Developer"
    },
    {
      "name": "3five, Inc.",
      "email": "wordpress@3five.com",
      "role": "Sponsor"
    },
    {
      "name": "WebDevStudios",
      "role": "Sponsor"
    }
  ],
  "autoload": {
    "psr-4": {
      "Dudley\\Patterns\\": "src/"
    }
  },
  "minimum-stability": "dev",
  "require": {
    "dudley/banner": "*",
    "dudley/social-media-accounts": "*"
  }
}

```

- In the command line, from the root of the plugin directory, run `composer validate` to confirm that your `composer.json`file is properly formatted.
- Next, run `composer install`. All of your required packages will install into the `vendor` directory.

How To Use Patterns
===================

[](#how-to-use-patterns)

Example if using Advanced Custom Fields: During activation, the Dudley plugin copies the ACF field group JSON file associated with each package into the `acf-json` directory. This makes the fields available for sync and allows you to update their individual settings using the front-end interface. Most patterns are likely assigned to a Page or Post by default, and in general, you'll need to update them on a per-project basis so they can be used on the actual templates where you need them.

Once configured, you should now be able to populate the field group with data and call that pattern's associated action within the template to which you've assigned it.

### *Example:*

[](#example)

The Social Media Accounts module connects by default to the Options page that's automatically registered by the plugin. By default, a few social networks are defined: Facebook, Twitter, LinkedIn, etc. If a client requires a particular network, you can first sync the field group with the WordPress database, then make changes to field group by navigating to it in the Dashboard.

Once your changes have been saved, navigate to the options page and enter in some sample data. Finally, in the template where you need to call it, type in `
