Jump to content
teppo

Version Control

Recommended Posts

Hi Teppo

Tested this on latest ProcessWire (ver 3.0.62). Seems to work very well, except Image/File fields. In both of those it is possible to recover removed files, but when doing so, it loses the current files. These screenshots probably shows it best:

First I have 2 images:

Sieppaa1.PNG

Then we remove the other one:

Sieppaa2.PNG

Now we only have the city photo there:

Sieppaa3.PNG

Then I can go back time and find the Desert also:

Sieppaa4.PNG

This preview works pretty nicely (although file names are hashed). But then after saving the page disaster happens:

Sieppaa5.PNG

Desert is saved, but the city has gone 0 bytes.

Any idea what might be causing this? I thought it might be image field related, but the very same happens with file fields also.

Share this post


Link to post
Share on other sites

Hi.

It seems that there is an issue when the Version Control is set to track input changes on a repeater matrix field. I get the following error when trying to revert to an older entry.

Error: 
Call to a member function getInputfield() on a non-object (line 480 of /Users/vayurobins/Sites/headhunterland.dev/site/assets/cache/FileCompiler/site/modules/VersionControl/ProcessVersionControl.module)

Is this module compatible with Profields Repeater Matrix module?

Share this post


Link to post
Share on other sites

@Vayu Robins, to be honest I wouldn't be surprised if it wasn't. Repeaters, I believe, are somewhat supported, but Repeater Matrix is a lot more complex, at least as a concept.

I'll look into this as soon as possible.

@apeisa, I'll look into that image issue too. Unless that's really easy to fix, it might be time to release a 3.x branch of this module though. Could probably solve a bunch of things more cleanly now.

API level tests still look good, so I'm thinking that this file issue might have something to do either with the "recent" UI updates, or perhaps the temp file thing..

  • Like 7

Share this post


Link to post
Share on other sites

Hi @teppo

Finding out that there is also few more bugs with PW3:

  • revisions don't work - it always shows the latest version (the sliding preview or /setup/version-control/preview/?pages_id=1328&revision=511 urls). I did debug this quite a bit and this SQL generated by PageSnapshot::snapshot always returns Empty set (although there should be data and database seems to been populated fine):
  • SELECT t1.pages_id, t1.id AS revision, t2.fields_id, t2.property, t2.data
        FROM (
            SELECT MAX(t1.id) id, t1.pages_id, t2.fields_id
            FROM version_control__revisions AS t1, version_control__data AS t2
            WHERE t1.id = 513 AND t1.pages_id IN (1328) AND t1.timestamp <= FROM_UNIXTIME(1511771437) AND t2.revisions_id = t1.id
            GROUP BY t1.pages_id, t2.fields_id, t2.property
        ) AS t1
        INNER JOIN version_control__data AS t2
        ON t2.revisions_id = t1.id AND t2.fields_id = t1.fields_id
        GROUP BY t1.pages_id, t2.fields_id, t2.property

    In history tab clicking pagination also changes the tab (minor annoyance)

 

I also updated this to PW3 (well, added namespace to each .module file and changed PDO references to \PDO, but that didn't had any affect to these bugs (didn't test the earlier image test though). Here are those attached if you are interested (didn't test that well and took about a minute or so).

ProcessVersionControl.zip

  • Like 1

Share this post


Link to post
Share on other sites

Quick update: there's now a 2.0 branch and 2.0 milestone for this module at GitHub. For the time being the 2.0 branch is identical with master branch, but it's a start. I'm going to get another project I've been working on out there today, and after that I should have some time to work on VersionControl 2.0 :)

  • Like 9

Share this post


Link to post
Share on other sites

Version 2.0.0 of Version Control was just pushed to the 2.0 branch at GitHub.

While I'd be happy to hear how it works for you, please note that this should be considered a beta release: so far it seems to be working with basic text fields and file/image fields, but honestly I've not tested it much yet (got the file field part working literally minutes ago). Note also that this version bumps the required ProcessWire version to 3.0.62 – the current master/stable version.

Technically this release should work in 3.0.16 or 3.0.18 as well (the versions that introduced major changes to the image inputfield), but I don't plan to test this module in anything older than the master branch.

  • Like 1

Share this post


Link to post
Share on other sites
On 29/11/2017 at 10:15 PM, apeisa said:
  • revisions don't work - it always shows the latest version (the sliding preview or /setup/version-control/preview/?pages_id=1328&revision=511 urls)
  • In history tab clicking pagination also changes the tab (minor annoyance)

So far I've been unable to reproduce either one of these. Perhaps it's something that I fixed by accident, or perhaps it's something about my setup, but revisions seem to work fine and history tab pagination returns me to the history tab. I'll keep an eye out for these, though :)

Adding #VersionControlHistory to the pagination probably wouldn't hurt, so I'll try that in the next update.

Share this post


Link to post
Share on other sites

Version 2.1.0 of VersionControl was just pushed to the 2.0 branch at GitHub.

Note that this update changes the field-level UI quite a bit (see screenshot below). Personally I like this UI better anyway, but the main reason for the change was that it would've been a major pain to get the old UI to work with both the (current) default admin theme and AdminThemeUikit – let alone any third party admin themes.

5a7751064985f_ScreenShot2018-02-04at19_36_50.thumb.png.13ede43a99022dcc178110ed3e9f66f2.png

The colour theme is currently hardcoded, so it doesn't adapt to whatever changes you might've made to your admin theme. It's also exactly the same for both built-in admin themes. I could make some parts configurable at some point, but for the time being this is better than nothing.

Next up: more testing. I'm pretty sure that there are a few bugs here and there that I've managed to miss, and I'd like the core features of this module to be as solid as possible. I'm also contemplating giving the History tab a major facelift, but that's not exactly the first item on my list right now :)

  • Like 12

Share this post


Link to post
Share on other sites

I have tried to use front-end editing using the <edit> tags. It seems, that I always get the history tab below the fields I am editing even though those fields are not under version control. Is there any option not to show the history tab with front-end editing modals?

  • Like 2

Share this post


Link to post
Share on other sites

Thanks Teppo, looks great!

The bugs I reported earlier were not fixed on these updates. That make me look more careful the server setup and the issue was that PW timezone was not the same that server was using - that caused history tab to work inproperly. Interesting thing is that the field specific compare/restore did work nicely even on bad configuration.

  • Like 2

Share this post


Link to post
Share on other sites
19 hours ago, apeisa said:

[...] the issue was that PW timezone was not the same that server was using - that caused history tab to work inproperly. Interesting thing is that the field specific compare/restore did work nicely even on bad configuration.

Thanks for letting me know. That makes sense: the page level snapshot feature makes use of timestamps, so timezone settings being off could make it misbehave. Field level features work just based on revision IDs, so this issue wouldn't affect them :)

I should probably add a note about this somewhere..

  • Like 1

Share this post


Link to post
Share on other sites
On 05/02/2018 at 8:45 PM, lpa said:

I have tried to use front-end editing using the <edit> tags. It seems, that I always get the history tab below the fields I am editing even though those fields are not under version control. Is there any option not to show the history tab with front-end editing modals?

Just pushed a fix for this issue to the 2.0 branch :)

  • Like 2

Share this post


Link to post
Share on other sites

I get a notice here, maybe that is interesting....

PHP Notice: Trying to get property of non-object in site/modules/VersionControl/ProcessVersionControl.module:660

if ($diff && wire('fields')->get($field)->type instanceof FieldtypeFile) $diff = "";

 

Share this post


Link to post
Share on other sites
On 1/8/2018 at 8:08 AM, teppo said:

please note that this should be considered a beta release: so far it seems to be working with basic text fields and file/image fields, but honestly I've not tested it much yet

Hi @teppo,

Just wondering about updating to the v2 branch on a project I have under development. In the quote above, do you mean that the range of fieldtypes supported on the v2 branch is currently narrower than the v1 branch (only text and file/image fields)? Or do you expect that all the fieldtypes supported in v1 (integer, datetime, etc) will also work in v2 branch but just that you haven't tested them yet?

If it's the latter I will probably go ahead and upgrade (unless you think that wouldn't be wise to do yet). 

Share this post


Link to post
Share on other sites

@Robin S: it's the latter case. I had originally some weird issues with image fields and such, but got those fixed at the last minute, so was a bit worried that there might be other issues I just hadn't noticed yet.

Also the UI of the 2.0 branch could be a bit unstable: I've been moving things around, trying to figure out what works best, and I'm still considering rebuilding the History tab from the scratch.

That being said, if you're using PW 3.x, I'd definitely recommend going with the 2.0 branch. Current master branch works fine with PW <= 2.7, but not so much on 2.8 or 3.x. Also, if you do run into issues, please let me know so that I can take a closer look at them :)

  • Like 3

Share this post


Link to post
Share on other sites
33 minutes ago, teppo said:

Also, if you do run into issues, please let me know so that I can take a closer look at them

Thanks, will do.

  • Like 3

Share this post


Link to post
Share on other sites

Hi @teppo,

There is a little UI issue with accessing version history for checkbox fields. When a checkbox field doesn't use a separate label (and it doesn't by default), the icon for accessing the history UI doesn't appear. And if the checkbox field is rendered collapsed by default the icon does appear but disappears when the field is opened.

versioncontrol.gif.de3dd0498db85df878c737bee24929f9.gif

Share this post


Link to post
Share on other sites

Another minor UI thing: the new UI can look a bit funny with AdminThemeDefault and AdminThemeReno because opening the history doesn't trigger the core column sizing JS, so the height of fields in the same row isn't updated to match. It's not a big deal, and the issue doesn't occur for AdminThemeUikit so maybe not worth doing anything about.

versioncontrol2.gif.1d9bf0b4abe5dd54d869d5083a61e1a3.gif

If there is a column to the right of an open history container then the history gets overlapped by 1 pixel on the right edge. Again, not a big deal, but maybe these things could be avoided by using absolute positioning for the history container so it appears in a layer over the Page Edit interface and doesn't expand the inputfield column.

Using the core panel UI could be a nice alternative too, but I don't know how easy it is to inject HTML directly into this. I think it's only set up to handle iframes (which if so is a bit of a shame because it reduces the range of things the panel can be used for).

  • Like 1

Share this post


Link to post
Share on other sites

Thanks @Robin S, I'll take a look at these ASAP.

Part of the reason the new UI works as it does (in context, not overlay) is so that it could play nicely with some admin theme quirks and differences. Another reason is that overlay UI's are a bit of a problem from usability point of view, so I'd rather steer away from them. Anyway, I'll see what I can do about these.

The part about checkbox is a bit of a surprise to me. This also means that other icons, such as the default "collapse" icon, disappear when the field gets expanded, right? Seems weird to me, but perhaps that's how it's supposed to work. Not sure how I managed to miss this earlier :)

  • Like 2

Share this post


Link to post
Share on other sites

@teppo, do you have any advice if I want to add support for fieldtypes beyond those in the core? Does the module have any hookable methods that allow for that?

For instance, I tested with FieldtypeMapMarker and the history and diff parts seemed to work okay but the restore action failed because the saved data needs to be converted into an object of the right class. It looks like the module saves the string value of a field - am I able to hook into the restore action to control how the string is restored back to the field value?

Share this post


Link to post
Share on other sites

Hi @teppo,

The Version Control module is preventing the red asterisk from appearing in the header of required fields. The relevant admin CSS is:

.InputfieldStateRequired>.InputfieldHeader:first-child:after {
    content: ' *';
    color: #C00C19;
}

The addition of the field-revisions div interferes with this.

Share this post


Link to post
Share on other sites

Hello

This valuable module is not usable here (with multi language setup?).

The input fields simply disappear after trying to restore.

See this short screencast please:

http://theowp.bplaced.net/upload/v2.html

ProcessWire 3.0.98 and VersionControl Branch 2.0 of today.

Thank you.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      First a note about my other modules...
      I have three existing modules that are similar in that they allow restrictions to be placed on repeating inputfields: Limit Repeater, Limit PageTable, Limit Table
      Restrict Repeater Matrix takes a different approach to the module configuration from those other modules. The module settings for Restrict Repeater Matrix are applied in the field settings rather in a module config screen. I think this new approach is better, but it means that it isn't practical to create different settings for different roles via the admin interface. Instead the module has a hookable method, allowing roles to be targeted and other advanced usages to be achieved via a hook. The result is that the module is more flexible.
      I intend to transition my other modules to the same approach over the coming weeks, but because this will result in breaking changes I will be releasing the updated modules under new names ("Restrict Repeater", etc) to avoid users upgrading via the Upgrades module without full awareness of the changes. The old modules will be marked as deprecated.
      Restrict Repeater Matrix
      A module for ProcessWire CMS/CMF. Allows restrictions and limits to be placed on Repeater Matrix fields. Requires ProcessWire >= v3.0.0 and FieldtypeRepeaterMatrix >= v0.0.5.
      For any matrix type in a Repeater Matrix field you have the option to:
      Disable settings for items (cannot change matrix type) Prevent drag-sorting of items Prevent cloning of items Prevent toggling of the published state of items Prevent trashing of items Limit the number of items that may be added to the inputfield. When the limit is reached the "Add new" button for the matrix type will be removed and the matrix type will not be available for selection in the "Type" dropdown of other matrix items. Please note that restrictions and limits are applied with CSS/JS so should not be considered tamper-proof.
      Usage
      Install the Restrict Repeater Matrix module.
      For each matrix type created in the Repeater Matrix field settings, a "Restrictions" fieldset is added at the bottom of the matrix type settings:

      For newly added matrix types, the settings must be saved first in order for the Restrictions fieldset to appear. Set restrictions for each matrix type as needed. A limit of zero means that no items of that matrix type may be added to the inputfield.
      Setting restrictions via a hook
      Besides setting restrictions in the field settings, you can also apply or modify restrictions by hookingRestrictRepeaterMatrix::checkRestrictions. This allows for more focused restrictions, for example, applying restrictions depending on the template of the page being edited or depending on the role of the user.
      The checkRestrictions() method receives the following arguments:
      $field This Repeater Matrix field $inputfield This Repeater Matrix inputfield $matrix_types An array of matrix types for this field. Each key is the matrix type name and the value is the matrix type integer. $page The page that is open in ProcessPageEdit The method returns a multi-dimensional array of matrix types and restrictions for each of those types. An example of a returned array:

      Example hooks
      Prevent the matrix type "images_block" from being added to "my_matrix_field" in a page with the "basic-page" template:
      $wire->addHookAfter('RestrictRepeaterMatrix::checkRestrictions', function(HookEvent $event) { $field = $event->arguments('field'); $page = $event->arguments('page'); $type_restrictions = $event->return; if($field->name === 'my_matrix_field' && $page->template->name === 'basic-page') { $type_restrictions['images_block']['limit'] = 0; } $event->return = $type_restrictions; }); Prevent non-superusers from trashing any Repeater Matrix items in "my_matrix_field":
      $wire->addHookAfter('RestrictRepeaterMatrix::checkRestrictions', function(HookEvent $event) { $field = $event->arguments('field'); $type_restrictions = $event->return; if($field->name === 'my_matrix_field' && !$this->user->isSuperuser()) { foreach($type_restrictions as $key => $value) { $type_restrictions[$key]['notrash'] = true; } } $event->return = $type_restrictions; }); http://modules.processwire.com/modules/restrict-repeater-matrix/
      https://github.com/Toutouwai/RestrictRepeaterMatrix
    • By BitPoet
      Here's a little text formatter module that redirects all external links found in a textarea (e.g. for hit counting) to a given URL.
      TextformatterExternalRedirect
      GitHub repo
      As TextFormatters do, this module modifies the contents of the textarea (HTML) at rendering time. It prepends the given URL to the link address for external links (http and https), optionally makes sure that the link is opened in a new window and allows you to add css classes to such links.
      All options can be configured in the module's configuration settings.
      Usage:
      Download the zip archive and extract it to site/modules, the rename the top folder to TextformatterExternalRedirect Go to the backend and select "Modules" -> "Refresh", then click "Install" for "External Link Redirect" Click "Settings" and configure the module
      Go into the field configuration for the field(s) you want this formatter to apply to and add it from the dropdown
      Done, now any external links in the configured fields will have the configured settings applied Feel free to leave feedback and post and questions you have here.
       
    • By teppo
      Hey folks!
      Took a couple of late nights, but managed to turn this old gist of mine into a proper module. The name is SearchEngine, and currently it provides support for indexing page contents (into a hidden textarea field created automatically), and also includes a helper feature ("Finder") for querying said contents. No fancy features like stemming here yet, but something along those lines might be added later if it seems useful (and if I find a decent implementation to integrate).
      Though the API and selector engine make it really easy to create site search pages, I pretty much always end up duplicating the same features from site to site. Also – since it takes a bit of extra time – it's tempting to skip over some accessibility related things, and leave features like text highlighting out. Overall I think it makes sense to bundle all that into a module, which can then be reused over and over again 🙂
      Note: markup generation is not yet built into the module, which is why the examples below use PageArray::render() method to produce a simple list of results. This will be added later on, as a part of the same module or a separate Markup module. There's also no fancy JS API or anything like that (yet).
      This is an early release, so be kind – I got the find feature working last night (or perhaps this morning), and some final tweaks and updates were made just an hour ago 😅
      GitHub repository: https://github.com/teppokoivula/SearchEngine Modules directory: https://modules.processwire.com/modules/search-engine/ Demo: https://wireframe-framework.com/search/ Usage
      Install SearchEngine module. Note: the module will automatically create an index field install time, so be sure to define a custom field (via site config) before installation if you don't want it to be called "search_index". You can change the field name later as well, but you'll have to update the "index_field" option in site config or module settings (in Admin) after renaming it.
      Add the site search index field to templates you want to make searchable. Use selectors to query values in site search index. Note: you can use any operator for your selectors, you will likely find the '=' and '%=' operators most useful here. You can read more about selector operators from ProcessWire's documentation.
      Options
      By default the module will create a search index field called 'search_index' and store values from Page fields title, headline, summary, and body to said index field when a page is saved. You can modify this behaviour (field name and/or indexed page fields) either via the Module config screen in the PocessWire Admin, or by defining $config->SearchEngine array in your site config file or other applicable location:
      $config->SearchEngine = [ 'index_field' => 'search_index', 'indexed_fields' => [ 'title', 'headline', 'summary', 'body', ], 'prefixes' => [ 'link' => 'link:', ], 'find_args' => [ 'limit' => 25, 'sort' => 'sort', 'operator' => '%=', 'query_param' => null, 'selector_extra' => '', ], ]; You can access the search index field just like any other ProcessWire field with selectors:
      if ($q = $sanitizer->selectorValue($input->get->q)) { $results = $pages->find('search_index%=' . $query_string . ', limit=25'); echo $results->render(); echo $results->renderPager(); } Alternatively you can delegate the find operation to the SearchEngine module as well:
      $query = $modules->get('SearchEngine')->find($input->get->q); echo $query->resultsString; // alias for $query->results->render() echo $query->pager; // alias for $query->results->renderPager() Requirements
      ProcessWire >= 3.0.112 PHP >= 7.1.0 Note: later versions of the module may require Composer, or alternatively some additional features may require installing via Composer. This is still under consideration – so far there's nothing here that would really depend on it, but advanced features like stemming most likely would.
      Installing
      It's the usual thing: download or clone the SearchEngine directory into your /site/modules/ directory and install via Admin. Alternatively you can install SearchEngine with Composer by executing composer require teppokoivula/search-engine in your site directory.
    • By teppo
      MarkupMenu is a markup module for generating menu trees. When provided a root page as a starting point, it generates a navigation tree (by default as a HTML "<ul>" element wrapped by a "<nav>" element) from that point onwards. If you've also provided it with current (active) page, the menu will be rendered accordingly, with current item highlighted and items rendered up to that item and its children (unless you disable the "collapsed" option, in which case the full page tree will be rendered instead).
      Modules directory: https://modules.processwire.com/modules/markup-menu/ GitHub repository: https://github.com/teppokoivula/MarkupMenu Usage
      As a markup module, MarkupMenu is intended for front-end use, but you can of course use it in a module as well. Typically you'll only need the render() method, which takes an array of options as its only argument:
      echo $modules->get('MarkupMenu')->render([ 'root_page' => $pages->get(1), 'current_page' => $page, ]); Note: if you omit root_page, site root page is used by default. If you omit current_page, the menu will be rendered, but current (active) page won't be highlighted etc.
      A slightly more complex example, based on what I'm using on one of my own sites to render a (single-level) top menu:
      echo $modules->get('MarkupMenu')->render([ 'current_page' => $page, 'templates' => [ 'nav' => '<nav class="{classes} menu--{menu_class_modifier}" aria-label="{aria_label}">%s</nav>', 'item_current' => '<a class="menu__item menu__item--current" href="{item.url}" tabindex="0" aria-label="Current page: {item.title}">{item.title}</a>', ], 'placeholders' => [ 'menu_class_modifier' => 'top', 'aria_label' => 'Main navigation', ], 'include' => [ 'root_page' => true, ], 'exclude' => [ 'level_greater_than' => 1, ], ]); Note: some things you see above may not be entirely sensible, such as the use of {menu_class_modifier} and {aria_label} placeholders. On the actual site the "nav" template is defined in site config, so I can define just these parts on a case-by-case basis while actual nav markup is maintained in one place.
      Please check out the README file for available render options. I'd very much prefer not to keep this list up to date in multiple places. Basically there are settings for defining "templates" for different parts of the menu (list, item, etc.), include array for defining rules for including in the menu and exclude array for the opposite effect, classes and placeholders arrays for overriding default classes and injecting custom placeholders, etc. 🙂
      MarkupMenu vs. MarkupSimpleNavigation
      TL;DR: this is another take on the same concept. There are many similarities, but also some differences – especially when it comes to the supported options and syntax. If you're currently using MarkupSimpleNavigation then there's probably no reason to switch over.
      I'd be surprised if someone didn't draw lines between this module and Soma's awesome MarkupSimpleNavigation. Simply put I've been using MSN (...) for years, and it's been great – but there are some issues with it, particularly in the markup generation area, and it also does some things in a way that doesn't quite work for me – the xtemplates thing being one of these. In some ways less about features, and more about style, I guess 🙂
      Anyhow, in MarkupMenu I've tried to correct those little hiccups, modernise the default markup, and allow for more flexibility with placeholder variables and additional / different options. MarkupMenu was built for ProcessWire 3.0.112+ and with PHP 7.1+ in mind, it's installable with Composer, and I have a few additional ideas (such as conditional placeholders) still on my todo list.
      One more small(ish) difference is that MarkupMenu supports overriding default options via $config->MarkupMenu. I find myself redefining the default markup for every site, which until now meant that each site had a wrapper function for MarkupSimpleNavigation (to avoid code / config repetition), and this way I've been able to leave that out 🙂
      Requirements
      ProcessWire >= 3.0.112 PHP >= 7.1.0 If you're working on an earlier version of ProcessWire or PHP, use MarkupSimpleNavigation instead.
    • By teppo
      Hey folks!
      I'm happy to finally introduce a project I've been working on for quite a while now: it's called Wireframe, and it is an output framework for ProcessWire.
      Note that I'm posting this in the module development area, maily because this project is still in rather early stage. I've built a couple of sites with it myself, and parts of the codebase have been powering some pretty big and complex sites for many years now, but this should still be considered a soft launch 🙂
      --
      Long story short, Wireframe is a module that provides the "backbone" for building sites (and apps) with ProcessWire using an MVC (or perhaps MVVM – one of those three or four letter abbreviations anyway) inspired methodology. You could say that it's an output strategy, but I prefer the term "output framework" since in my mind the word "strategy" means something less tangible. A way of doing things, rather than a tool that actually does things.
      Wireframe (the module) provides a basic implementation for some familiar MVC concepts, such as Controllers and a View layer – the latter of which consists of layouts, partials, and template-specific views. There's no "model" layer, since in this context ProcessWire is the model. As a module Wireframe is actually quite simple – not even nearly the biggest one I've built – but there's still quite a bit of stuff to "get", so I've put together a demo & documentation site for it at https://wireframe-framework.com/.
      In addition to the core module, I'm also working on a couple of site profiles based on it. My current idea is actually to keep the module very light-weight, and implement most of the "opinionated" stuff in site profiles and/or companion modules. For an example MarkupMenu (which I released a while ago) was developed as one of those "companion modules" when I needed a menu module to use on the site profiles.
      Currently there are two public site profiles based on Wireframe:
      site-wireframe-docs is the demo&docs site mentioned above, just with placeholder content replaced with placeholder content. It's not a particularly complex site, but I believe it's still a pretty nice way to dig into the Wireframe module. site-wireframe-boilerplate is a boilerplate (or starter) site profile based on the docs site. This is still very much a work in progress, but essentially I'm trying to build a flexible yet full-featured starter profile you can just grab and start building upon. There will be a proper build process for resources, it will include most of the basic features one tends to need from site to site, etc. --
      Requirements and getting started:
      Wireframe can be installed just like any ProcessWire module. Just clone or download it to your site/modules/ directory and install. It doesn't, though, do a whole lot of stuff on itself – please check out the documentation site for a step-by-step guide on setting up the directory structure, adding the "bootstrap file", etc. You may find it easier to install one of the site profiles mentioned above, but note that this process involves the use of Composer. In the case of the site profiles you can install ProcessWire as usual and download or clone the site profile directory into your setup, but after that you should run "composer install" to get all the dependencies – including the Wireframe module – in place. Hard requirements for Wireframe are ProcessWire 3.0.112 and PHP 7.1+. The codebase is authored with current PHP versions in mind, and while running it on 7.0 may be possible, anything below that definitely won't work. A feature I added just today to the Wireframe module is that in case ProcessWire has write access to your site/templates/ directory, you can use the module settings screen to create the expected directories automatically. Currently that's all, and the module won't – for an example – create Controllers or layouts for you, so you should check out the site profiles for examples on these. (I'm probably going to include some additional helper features in the near future.)
      --
      This project is loosely based on an earlier project called pw-mvc, i.e. the main concepts (such as Controllers and the View layer) are very similar. That being said, Wireframe is a major upgrade in terms of both functionality and architecture: namespaces and autoloader support are now baked in, the codebase requires PHP 7, Controllers are classes extending \Wireframe\Controller (instead of regular "flat" PHP files), implementation based on a module instead of a collection of drop-in files, etc.
      While Wireframe is indeed still in a relatively early stage (0.3.0 was launched today, in case version numbers matter) for the most part I'm happy with the way it works, and likely won't change it too drastically anytime soon – so feel free to give it a try, and if you do, please let me know how it went. I will continue building upon this project, and I am also constantly working on various side projects, such as the site profiles and a few unannounced helper modules.
      I should probably add that while Wireframe is not hard to use, it is more geared towards those interested in "software development" type methodology. With future updates to the module, the site profiles, and the docs I hope to lower the learning curve, but certain level of "developer focus" will remain. Although of course the optimal outcome would be if I could use this project to lure more folks towards that end of the spectrum... 🙂
      --
      Please let me know what you think – and thanks in advance!
×
×
  • Create New...