Jump to content

Preview/Discussion: RockDataTables


Recommended Posts

22 minutes ago, adrian said:

but you have put a lot more thought into this than I, so feel free to ignore my ramblings

actually that's a good point because requesting the data from the server is one thing whereas presenting it is another. at datatables you have cell renderers that render your values differently in different situations. so your datefield would ideally be an integer (making it sortable) and be DISPLAYED in the table as a formatted string (using moment.js). so you would not need to format the date via sql because that is done on the client ;) maybe that's why i was not really eager about it and you thought it would be more important. but having a findObject/Array method in the core would justify that feature to some extend.

regarding the datatables there will also be an option for defining php functions (see here https://processwire.com/talk/topic/15524-preview-rockdatatables/?do=findComment&comment=158061 ).

$table->data(
    $pages->find('template=item'), [
      ['col_name1', 'label of this column', function() { return $this->page->title; }],
      ...

So that would make it really simple to setup tables - you would not have to know or write anything related to SQL. You could just use php's date('Ymd', $page->yourdatefield) function. So all the SQL options are really only meant to be used for complex tables. I think every developer working with that kind of complex tables should not be afraid of using some (very simple btw) sql queries :)

thanks for all your input!

 

  • Like 2
Link to post
Share on other sites
14 hours ago, bernhard said:

You mean something like "make a piechart of column x and y"? I'm already thinking of that but don't know if it's really worth the effort when you can write nice charts with some lines of chartjs code... maybe a simple example/tutorial would be of more help...

2

Yes, a simple tutorial would be a great starting point. If there's enough clamour / demand for it, you could consider doing some concrete implementations based on Chartjs. Exciting stuff.
 

 

Link to post
Share on other sites
5 hours ago, FrancisChung said:

you could consider doing some concrete implementations based on Chartjs.


Rather than chartjs, can I suggest something that outputs SVG (not canvas) and is potentially based on D3js to make it easy to manipulate beyond the charting library's built-in options. SVG gives more options for exporting the charts for use in vector graphics editors.

I admit I haven't done a chart heavy project in a couple of years so I am not fully up to date, but I quite like http://c3js.org/ - they are not the sexiest charts by default, but you can manipulate however you want via CSS and D3js making it incredibly flexible. There might be other good/better options out there now also so definitely worth some research time.

  • Like 5
Link to post
Share on other sites
4 minutes ago, bernhard said:

@kongondo I guess you are working on a C3 module or are you really talking about D3 itself?

No. I am using D3 itself. Early on, I researched quite a number of charting libraries (including all the usual suspects). I also looked at C3 (and similar). It is a wrapper around D3 to help you avoid the D3 learning curve. I decided to stick with D3 itself for a number of reasons.

  1. I didn't mind the D3 learning curve. In fact, I didn't find it as challenging as some sell it to be. No disrespect to C3 and maybe it is the ProcessWire in me but I wanted to get my hands dirty instead of being on the other side of some other library. Besides, if I was going to learn C3 API, I might as well learn D3.
  2. There's thousands of D3 examples with thousands of developers around the world using it. Whatever you want to do, there's a high likelihood that somebody else has already done it; So, there is already an existing solution to your problem .
  • Like 2
Link to post
Share on other sites
21 minutes ago, bernhard said:

very nice library!

It really is supercool - so incredibly flexible. I think it's initial look might put some people off, but you have so much control over what is output which is what makes it so powerful - sounds like something else we all love around here :)

  • Like 1
Link to post
Share on other sites

I agree with @kongondo that D3 isn't really that hard - I think it comes down the how much flexibility you need. I think you have to take the approach that best fits the task - as always.

PS - this was my original D3 type approach to generating SVG and PNG diagrams/charts programmatically: https://pear.php.net/package/Image_Canvas

It was very cool back in the day :)

  • Like 1
Link to post
Share on other sites
10 hours ago, gmclelland said:

Note that the Flot library listed here is essentially orphaned.

Pure D3 sounds like a solid choice. I really like where this thread has gone so far :) I hope I can make use of this and buy bernhard dozens of drinks in the future (his liver better be made of steel).

  • Like 3
Link to post
Share on other sites
  • 1 month later...

Wow, RockDataTables would be perfect for an upcoming project, and for where I'm working in general (dashboards collating info from diverse sources via external APIs). Please keep us updated, I would definitely pay a reasonable fee for a Pro module!

  • Like 1
Link to post
Share on other sites
  • 3 weeks later...

It's still the version linked above. I only added the comment for the early exit if no pages are found.

16 hours ago, theo said:

I mean more supported Fieldtypes "and stuff"?

Which fieldtypes do you need support for? It's very easy to add your own Fieldtypes to the switch statement. Any contributions are welcome. I'll start working on the module in the next days and I can start with that function as it is very important for the module. Though, as I said, it's already very easy to modify it to your needs and you don't have to wait for my version..

Link to post
Share on other sites
6 minutes ago, bernhard said:

Which fieldtypes do you need support for? It's very easy to add your own Fieldtypes to the switch statement. Any contributions are welcome. I'll start working on the module in the next days and I can start with that function as it is very important for the module. Though, as I said, it's already very easy to modify it to your needs and you don't have to wait for my version..

I just wanted to ask if I missed something.

It is not urgent for me, I am still evaluating what's possible with PW to be able to decide if it's the right tool for a certain job.

Are you going to publish your code in the next weeks or so?

Thank you.

Link to post
Share on other sites

@bernhard: Another thing to keep in mind.

Field Names can contain uppercase characters whereas the database fields are all lowercase, it seems.

So after getting the type with the name possibly containing uppercase chars, the field name has to be converted to lowercase for the DB table "field_xyz"

    foreach ($fields as $f) {
        $field = $this->fields->get($f);
        $f=strtolower($f);

 

  • Thanks 1
Link to post
Share on other sites

Playing around with this, I have tested repeaters and there is some code to get titles in addition to the index from FieldtypeOptions  (Not sure if you like this).

Just sharing what I have.

$this->addHook("Pages::findObject", function($event) {
    $event->return = $this->pages->findArray($event->arguments(0), $event->arguments(1), $event->arguments(2), true);
});
$this->addHook("Pages::findArray", function($event) {
    $selector = $event->arguments(0);
    $fields = $event->arguments(1);
    $fields_pages = $event->arguments(2) ?: [];
    $type = $event->arguments(3) ? \PDO::FETCH_OBJ : \PDO::FETCH_ASSOC;
    // build sql string
    $sql = "SELECT\n  p.";

    // add fields of pages table
    $fields_pages[] = 'id'; // make sure we return the page id
    $fields_pages = array_unique($fields_pages);
    $sql .= implode(",\n  p.", $fields_pages);

    foreach ($fields as $f) {
        $field = $this->fields->get($f);

        if (!$field)
            continue;
        $fieldtype = $field->type;
        $f = strtolower($f);
        // fielddata is always stored in the "data" column of the field's table
        // multilang fields have several data columns identified by the language id
        // we use a variable to query the current user's language, eg data1234
        $data = "data";
        switch (true) {
            // if it is a multilang field we append the language id to query the correct column
            case $fieldtype instanceof FieldtypeTextLanguage:
            case $fieldtype instanceof FieldtypeTextareaLanguage:
                if ($this->user->language->name != 'default')
                    $data .= $this->user->language->id;
            // no break here intended!
            // build sql query
            case $fieldtype instanceof FieldtypeText:
            case $fieldtype instanceof FieldtypeCheckbox:
                $sql .= ",\n  (SELECT $data FROM field_$f WHERE pages_id = p.id) AS $f";
                break;
            case $fieldtype instanceof FieldtypePage:
            case $fieldtype instanceof FieldtypeRepeater:
                $sql .= ",\n  (SELECT GROUP_CONCAT($data SEPARATOR ',') FROM field_$f WHERE pages_id = p.id) AS $f";
                break;
            case $fieldtype instanceof FieldtypeFile:
                $sql .= ",\n  (SELECT $data FROM field_$f WHERE pages_id = p.id) AS $f";
                //$sql .= ",\n  (SELECT description FROM field_$f WHERE pages_id = p.id) AS ".$f."_desc";
                break;
            case $fieldtype instanceof FieldtypeOptions:
                $sql .= ",\n  (SELECT $data FROM field_$f WHERE pages_id = p.id) AS $f";
                $sql .= ",\n  (SELECT title FROM fieldtype_options WHERE fields_id=(SELECT id FROM fields WHERE name = '$f') AND option_id=$f) AS " . $f . "_title";
                break;
            default:
                $sql .= ",\n  '$fieldtype not supported' AS $f";
        }
    }

    $pages = $this->pages->findIDs($selector);

    if (count($pages) == 0) {
        $event->return = [];
    } else {
        $sql .= "\nFROM\n  pages AS p";
        $sql .= "\nWHERE\n  p.id IN (" . implode(",", $pages) . ")";
        //echo '<pre>' . $sql . '</pre>';
        $results = $this->database->query($sql);
        $event->return = $results->fetchAll($type);
    }
});

 

Testing with:

foreach ($pages->findArray("template=families, sort=title, limit=5000", array('title'), array()) as $p) {
    foreach ($pages->findArray("parent=" . $p['id'] . ",sort=title, limit=5000", array('title'), array()) as $m) {
        foreach ($pages->findArray("parent=" . $m['id'] . ",sort=title, limit=5000", array('title', 'sku12', 'Sound_Sample'), array()) as $s) {
            echo ($p['title'] . ' ' . $m['title'] . ' ' . $s['title'] . '<br>');
            $repeater = $s['sound_sample'];
            if ($repeater) {
                foreach ($pages->findArray('id=' . str_replace(',', '|', $repeater) . ",limit=5000", array('name', 'Sound_Type_ss', 'Files_ss'), array()) as $r) {
                    echo '<h5>' . $r['files_ss'] . '</h5>';
                    echo '<h5>' . $r['sound_type_ss_title'] . '</h5>';
                }
            }
        }
    }
}

 

  • Like 1
Link to post
Share on other sites

Playing more...

If you need a fast multi level nav, you can try the code below (using findArray).

Set "has_parent" to the id of the parent page.

The difference to looping through pages -> children is remarkable.

Objects : 794 / Execution time : 0.021355867385864 seconds

 

function buildTree($flat, $pidKey, $idKey = null) {
    $grouped = array();
    foreach ($flat as $sub) {
        $grouped[$sub[$pidKey]][] = $sub;
    }
    $fnBuilder = function($siblings) use (&$fnBuilder, $grouped, $idKey) {
        foreach ($siblings as $k => $sibling) {
            $id = $sibling[$idKey];
            if (isset($grouped[$id])) {
                $sibling['children'] = $fnBuilder($grouped[$id]);
            }
            $siblings[$k] = $sibling;
        }
        return $siblings;
    };
    $tree = $fnBuilder($grouped[$flat[0][$pidKey]]); //!!
    return $tree;
}

$arr = $pages->findArray("has_parent=1029, sort=parent_id, include=all, limit=5000", array('title'), array('id', 'parent_id', 'name'));
$tree = buildTree($arr, 'parent_id', 'id');

foreach ($tree as $p1) {
    echo '<h2>' . $p1['title'] . '</h2>';
    if (isset($p1['children']))
        foreach ($p1['children'] as $p2) {
            echo '<h3>' . $p2['title'] . '</h3>';
            if (isset($p2['children']))
                foreach ($p2['children'] as $p3) {
                    $count++;
                    echo '<a href="../myparent/' . $p1['name'] . '/' . $p2['name'] . '/' . $p3['name'] . '/">';
                    echo '<h6>' . $p3['title'] . '</h6></a>';
                }
        }
}

 

Function buidTree is from here: https://stackoverflow.com/questions/4196157/create-array-tree-from-array-list

@bernhard Am I hijacking your thread?

  • Like 1
Link to post
Share on other sites
8 minutes ago, theo said:

@bernhard Am I hijacking your thread?

Totally fine, I enjoy the discussion (and added this tag to the thread title).

Your example shows that the findArray method would be useful not only for the datatables module but also for other scenarios. I think it would be a good addition to the core (as already mentioned by adrian). I'll work on this next week and make a PR ans see what ryan says.

For reference, here is info regarding the limit for WHERE IN(...): https://stackoverflow.com/questions/4275640/mysql-in-condition-limit

  • Like 1
Link to post
Share on other sites
Quote

> Totally fine, I enjoy the discussion (and added this tag to the thread title).

Great! :)

Although it would be a great addition from the community, I am not sure if ryan would like to add it to core.

You lose all the comfort of Processwire.

For example I've written some code last evening to access image-urls and descriptions (snippet, experimental):

case $fieldtype instanceof FieldtypeImage:
  $sql .= ",\n  (SELECT GROUP_CONCAT($data SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS $f";
  $sql .= ",\n  (SELECT GROUP_CONCAT(description SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS " . $f . "_desc";
break;
foreach ($pages->findArray("id=1, sort=title, limit=1000", array('title', 'images'), array()) as $p) {
 $images = explode(chr(29), $p['images']);
 $images_desc = explode(chr(29), $p['images_desc']);
 $imgs = array_combine($images, $images_desc);
 $langid = $this->user->language->id;
  if ($langid == $languages->getDefault()->id)
      $langid = 0;

 foreach ($imgs as $url => $descr) {
  $ajson = json_decode($descr, true);
  if (isset($ajson[$langid])) $desc=$ajson[$langid]; else $desc="";
  echo "URL=" . $p['id'] . '/' . $url . ", DESCR=" . $desc;
 }
}

 

You see, it works if you know how, but it feels a bit like writing assembler. ;)
But yes, it is fast!

  • Like 1
Link to post
Share on other sites

The method could just be another option for find(), just like findIDS and findMany etc. exist. It will be simple for basic usage and offer the option for custom SQL queries for advanced use. I plan to implement it like this (pseudo):

$pages->findArray('template=foo, sort=bar', [
  'field1',
  'field2',
  'url' => 'SELECT GROUP_CONCAT($data SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS $f',
  'desc' => 'SELECT GROUP_CONCAT(description SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS $f_desc',
]);

field1 and 2 would be simple, url and desc are an example of advanced use.

  • Like 1
Link to post
Share on other sites
15 minutes ago, bernhard said:

The method could just be another option for find(), just like findIDS and findMany etc. exist. It will be simple for basic usage and offer the option for custom SQL queries for advanced use. I plan to implement it like this (pseudo):


$pages->findArray('template=foo, sort=bar', [
  'field1',
  'field2',
  'url' => 'SELECT GROUP_CONCAT($data SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS $f',
  'desc' => 'SELECT GROUP_CONCAT(description SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS $f_desc',
]);

field1 and 2 would be simple, url and desc are an example of advanced use.

Yes, speed must be the first priority here. Load only things you need.

In case of Images, only desc is "advanced use".

"data" is already the filename and url is not in the database.

URL is (pseudo) assets/files/$pageid/$data

But I think we should offer a more convenient way for "description" than writing the select statement yourself.

"description" exists for FieldtypeFile too.

  • Like 1
Link to post
Share on other sites

@bernhard: Or like this:

 

$this->addHook("Pages::findArray", function($event) {
...
    foreach ($fields as $f) {
        $field_extra = explode(':', $f);
        $f = $field_extra[0];
        $field_extra = array_slice($field_extra, 1);
        $field = $this->fields->get($f);
...
            case $fieldtype instanceof FieldtypeImage:
                $sql .= ",\n  (SELECT GROUP_CONCAT($data SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS $f";
                if (in_array('description', $field_extra))
                    $sql .= ",\n  (SELECT GROUP_CONCAT(description SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS " . $f . "_description";
                break;
            case $fieldtype instanceof FieldtypeOptions:
                $sql .= ",\n  (SELECT $data FROM field_$f WHERE pages_id = p.id) AS $f";
                if (in_array('title', $field_extra))
                    $sql .= ",\n  (SELECT title FROM fieldtype_options WHERE fields_id=(SELECT id FROM fields WHERE name = '$f') AND option_id=$f) AS " . $f . "_title";
                break;

 

Then request extra data like 'images:description':

foreach ($pages->findArray("id=1, sort=title, limit=1000", ['title', 'images:description'], []) as $p) {

 

Link to post
Share on other sites

Ok, took some time but now I get your point :) And I like it!

This could definitely speed things up and make things a lot easier. Not sure how to implement this properly, though. We have different table structures for some fields. The first and easiest is for a simple textfield:

pages_id | data

then we have image/field fields:

pages_id | data | sort | description | modified | created

then we have option fields:

pages_id | data | sort

 

So if I understood you correctly, you are suggesting something like this:

$pages->findArray('foo=bar', [
  'mytextfield',
  'myimagefield:description',
  'myoptionsfield:title',
]);

Resulting in an output like this:

array (5)
mytextfield => "demo page" (9)
myimagefield => "foo.jpg|bar.jpg" (15)
myimagefield_desc => "my foo image|my bar image" (25)
myoptionsfield => "1|2|4" (5)
myoptionsfield_title => "option 1|option 2|option 4" (26)

Right?

What if we changed this a little bit and used arrays. See the examples below:

$pages->findArray('foo=bar', [
    // examples below
]);

// simple textfield
// request:
    'mytextfield'
// return: data column of this field
    'this is some text'

// image field
// request
    'myimagefield'
// return
    'foo.jpg|bar.jpg'
    
// image field with more requested info
// request
    'myimagefield' => [
        'description',
        'sort',
        'mycustomsql' => 'SELECT ... FROM ...',
    ],
// return
    'myimagefield' => 'foo.jpg|bar.jpg',
    'myimagefield_description' => 'foo desc|bar desc',
    'myimagefield_sort' => '1|2',
    'myimagefield_mycustomsql' => 'x|y'
    
// simple options field
// request
    'myoptionsfield'
// return
    '1|2|4'
    
// options field more info
// request
    'myoptionsfield' => [
        'title'
    ],
// return
    'myoptionsfield' => '1|2|4',
    'myoptionsfield_title' => 'option 1|..2|..4',

// custom sql field
// request
    'mycustomsqlfield' => 'SELECT ... FROM ...',
// return
    'mycustomsqlfield' => 'some return value',
    
// page field
// request
    'mypagefield' => [
        'pages:templates_id',
        'pages:status',
    ],
// return
    'mypagefield' => '1010|1011|1012',
    'mypagefield_templates_id' => '44|45|44',
    'mypagefield_status' => '1|1|8192',

Some notes:

  • If a simple string is requested, the "data" column of this table will be returned (or data1234 for multilang fields)
  • all concatenated fields MUST be sorted via the sort column in order to have a consistant sort order across multiple array items
  • What if image descriptions are empty? Would it still work?
  • If a key => value is requested and the "value" is an array we do sub-queries
    • if the subquery has a colon we query this table instead of the current field's table (pages:status instead of mypagefield:status)

 

This should give us a lot of flexibility, I think. For more complex scenarios we will still need to use joins. I've already started working on a proof of concept SQL editor module: 

With both tools in our hands I think it will be quite easy to query all the data we need and it will still be quite simple to use.

@adrian I would be very interested in your opinion about this :)

Link to post
Share on other sites
1 hour ago, bernhard said:

Ok, took some time but now I get your point :) And I like it!

This could definitely speed things up and make things a lot easier. Not sure how to implement this properly, though. We have different table structures for some fields. The first and easiest is for a simple textfield:

 

It is easy to make it "all purpose" with the code above.

Just change it to return all the requested values (foreach):

case $fieldtype instanceof FieldtypeImage:
   $sql .= ",\n  (SELECT GROUP_CONCAT($data SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS $f";
   foreach ($field_extra as $exfld)
      $sql .= ",\n  (SELECT GROUP_CONCAT($exfld SEPARATOR 0x1D) FROM field_$f WHERE pages_id = p.id) AS " . $f . "_".$exfld;
break;

Query like this:

foreach ($pages->findArray("id=1, sort=title, limit=1000", ['title', 'images:description:modified:created'], ['created']) as $p) {
echo $p['created']; //Page created
echo $p['images_created']; //Images created. Delimited String
echo $p['images_modified']; //Images modified.Delimited String

Created SQL looks like

SELECT p.created, p.id, (SELECT data1012 FROM field_title WHERE pages_id = p.id) AS title, 
(SELECT GROUP_CONCAT(data SEPARATOR 0x1D) FROM field_images WHERE pages_id = p.id) AS images, 
(SELECT GROUP_CONCAT(description SEPARATOR 0x1D) FROM field_images WHERE pages_id = p.id) AS images_description, 
(SELECT GROUP_CONCAT(modified SEPARATOR 0x1D) FROM field_images WHERE pages_id = p.id) AS images_modified, 
(SELECT GROUP_CONCAT(created SEPARATOR 0x1D) FROM field_images WHERE pages_id = p.id) AS images_created FROM pages AS p WHERE p.id IN (1)

Not sure if array or delimited makes a difference.

I don't think this is ever going to be a foolproof tool, but it's great base which you can extend to your taste.

For my purpose (Exporting data to CSV fast) it's almost ready.

  • Like 1
Link to post
Share on other sites
33 minutes ago, theo said:

Not sure if array or delimited makes a difference.

array makes two things possible:

  1. add custom sql queries as sub-queries (don't know if that would be useful in some cases? or unnecessary?)
  2. add pages:status syntax - this makes a lot of sense to me, because I've come over this problem a lot with tables where you want to know the status of the referenced page. you would need joins for that and using a subquery could make it possible to avoid this complexity. have to make performance tests though.
36 minutes ago, theo said:

I don't think this is ever going to be a foolproof tool

Why not? Or what exactly?

37 minutes ago, theo said:

For my purpose (Exporting CSV Data fast) it's almost ready.

Jep, can imagine that it shines here :)

  • Like 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By monollonom
      (once again I was surprised to see a work of mine pop up in the newsletter, this time without even listing the module on PW modules website 😅. Thx @teppo !)
      Github: https://github.com/romaincazier/FieldtypeQRCode
      Modules directory: https://processwire.com/modules/fieldtype-qrcode/
      This is a simple module I made so a client could quickly grab a QR Code of the page's url in the admin.
      There's not much to it for now, but if need be you can output anything using a hook:
      $wire->addHookAfter("FieldtypeQRCode::getQRText", function($event) { $event->return = "Your custom text"; }) You can also output the QR code on your front-end by calling the field:
      echo $page->qr_code_field; The module uses the PHP library QR Code Generator by Kazuhiko Arase. When looking for a way to generate a QR Code in PW I came across @ryan's integration in his TFA module. I'm not very familiar with fieldtype/inputfield module development so I blindly followed @bernhard (great) tutorial and his BaseFieldtypeRuntime. At some point I'll take a deeper look to make a module on my own.
      Some ideas for improvements :
      add the ability to choose what to ouput : page's url / editUrl / file(s) / image(s) / ... allow to output multiple QR codes ?
    • By Chris Bennett
      https://github.com/chrisbennett-Bene/AdminThemeTweaker
      Inspired by @bernhard's excellent work on the new customisable LESS CSS getting rolled into the core soon, I thought I would offer up the module for beta testing, if it is of interest to anyone.

      It takes a different approach to admin styling, basically using the Cascade part of CSS to over-ride default UiKit values.
      Values are stored in ModuleConfig Module creates a separate AdminThemeTweaker Folder at root, so it can link to AdminThemeTweaker.php as CSS AdminThemeTweaker.php reads the module values, constructs the CSS variables then includes the CSS framework Can be switched on and off with a click. Uninstall removes everything, thanks to bernhard's wonderful remove dir & contents function.
      It won't touch your core. It won't care if stuff is upgraded. You won't need to compile anything and you don't need to touch CSS unless you want to.

      It won't do much at all apart from read some values from your module config, work out the right CSS variables to use (auto contrast based on selected backgrounds) and throw it on your screen.
      You can configure a lot of stuff, leave it as it comes (dark and curvy), change two main colors (background and content background) or delve deep to configure custom margins, height of mastheads, and all manner of silly stuff I never use.

      Have been developing it for somewhere around 2 years now. It has been (and will continue to be) constantly tweaked over that time, as I click on something and find something else to do.
      That said, it is pretty solid and has been in constant use as my sole Admin styling option for all of those 2 years.

      If nothing else, it would be great if it can provide any assistance to @bernhard or other contributor's who may be looking to solve some of the quirkier UiKit behavior.
      Has (in my opinion) more robust and predictable handling of hidden Inputfields, data-colwidths and showIf wrappers.
      I am very keen to help out with that stuff in any way I can, though LESS (and any css frameworks/tools basically) are not my go.
      I love CSS variables and banging-rocks-together, no-dependency CSS you can write with notepad.



       

    • By opalepatrick
      I see old posts saying that repeaters are not the way to go in Custom Process Modules. If that is the case, when using forms (as I am trying to do) how would one tackle things like repeat contact fields where there can be multiple requirements for contact details with different parameters? (Like point of contact, director, etc) or even telephone numbers that have different uses?
      Just for background I am creating a process module that allows me to create types of financial applications in the admin area (no need to publish any of this, pure admin) that require a lot of personal or company information.
      Maybe I am thinking about this incorrectly?
    • By HMCB
      I ran across a reference to IftRunner module. The post was 6 years ago. I cant find it in available modules. Has it been pulled?
    • By tcnet
      PageViewStatistic for ProcessWire is a module to log page visits of the CMS. The records including some basic information like IP-address, browser, operating system, requested page and originate page. Please note that this module doesn't claim to be the best or most accurate.
      Advantages
      One of the biggest advantage is that this module doesn't require any external service like Google Analytics or similar. You don't have to modify your templates either. There is also no Javascript or image required.
      Disadvantages
      There is only one disadvantage. This module doesn't record visits if the browser loads the page from its browser cache. To prevent the browser from loading the page from its cache, add the following meta tags to the header of your page:
      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> How to use
      The records can be accessed via the Setup-menu of the CMS backend. The first dropdown control changes the view mode.

      Detailed records
      View mode "Detailed records" shows all visits of the selected day individually with IP-address, browser, operating system, requested page and originate page. Click the update button to see new added records.

      Cached visitor records
      View modes other than "Detailed records" are cached visitor counts which will be collected on a daily basis from the detailed records. This procedure ensures a faster display even with a large number of data records. Another advantage is that the detailed records can be deleted while the cache remains. The cache can be updated manually or automatically in a specified time period. Multiple visits from the same IP address on the same day are counted as a single visitor.

      Upgrade from older versions
      Cached visitor counts is new in version 1.0.8. If you just upgraded from an older version you might expire a delay or even an error 500 if you display cached visitor counts. The reason for this is that the cache has to be created from the records. This can take longer if your database contains many records. Sometimes it might hit the maximally execution time. Don't worry about that and keep reloading the page until the cache is completely created.
      Special Feature
      PageViewStatistic for ProcessWire can record the time a visitor viewed the page. This feature is deactivated by default. To activate open the module configuration page and activate "Record view time". If activated you will find a new column "S." in the records which means the time of view in seconds. With every page request, a Javascript code is inserted directly after the <body> tag. Every time the visitor switches to another tab or closes the tab, this script reports the number of seconds the tab was visible. The initial page request is recorded only as a hyphen (-).

      Settings
      You can access the module settings by clicking the Configuration button at the bottom of the records page. The settings page is also available in the menu: Modules->Configure->ProcessPageViewStat.
      IP2Location
      This module uses the IP2Location database from: http://www.ip2location.com. This database is required to obtain the country from the IP address. IP2Location updates this database at the begin of every month. The settings of ProcessPageViewStat offers the ability to automatically download the database monthly. Please note, that automatically download will not work if your webspace doesn't allow allow_url_fopen.
      Dragscroll
      This module uses DragScroll. A JavaScript available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability in view mode "Day" to drag the records horizontally with the mouse pointer.
      parseUserAgentStringClass
      This module uses the PHP class parseUserAgentStringClass available from: http://www.toms-world.org/blog/parseuseragentstring/. This class is required to filter out the browser type and operating system from the server request.
×
×
  • Create New...