Show custom field data on the reorder screen
Nearly everything I'd want to use Low Reorder for would benefit from having thumbnail images (or other information) next to the title on the reorder screen. It would be great if we had the ability to show content from one or more custom fields within the entry list. Is this feasible?
Replies
Low 18 Aug 2011 08:07
Hi Ray,
It's tricky at least. Not all custom fields would be suitable for the reorder list (relationship, matrix, etc), so there'd only be partial support for displaying a custom field. Then there's the question if you want the raw data or the parsed data. For an image, you'd want a thumbnail, so parsed. But parsing a textarea field may cause errors...
Ray 18 Aug 2011 13:59
Yeah, I poked around in the add-on last night and came to the same conclusion. The field I wanted to show last night was an image inside of a Matrix field, which meant lots and lots of DB calls.
I hacked around and got it to work, but building a user-friendly way to configure additional fields in the reorder view would definitely be a challenge (and an expensive one at that). You'd almost want to allow other devs to build fieldtype plugins that would extend the feature's ability to parse the various fieldtypes available in EE.
Thanks for your reply, Low!
outline4 7 Dec 2012 17:06
one year later, and especially for multilingual projects this is still true!
ordering by thumbs, or by some other custom fields would really enhance this add-on A LOT! just ordering by title, doesn't really cut it!
just a subset of available fields would be enough!
textareas, input fields, assets, image file fields etc..
cheers
stefan
outline4 7 Dec 2012 17:09
and it would be handy to display multiple fields at one...
like title_en and title_es next to each other!
Low 7 Dec 2012 17:20
Stefan, that's exactly why I added the low_reorder_show_entries extension hook.
The stuff what you'd want to see there can vary so much per project, that it's very hard, if not impossible, to cater for every scenario. Instead, the hook allows you to customize the output of the list of entries by whatever you'd want, keeping Low Reorder lean and flexible at the same time.
outline4 7 Dec 2012 17:31
oh that's great, but then I don't have a clue where to start, what a hook is and how to program :-/ (I know, I know)
would you be so kind to give me an example on how to reorder by some other custom text field? I think, once I know where all the files have to go, I can handle it myself...
this would really help me a lot!
cheers
stefan
Low 7 Dec 2012 18:04
Sure, I'll see if I can put an example up on GitHub one of these days.
outline4 7 Dec 2012 18:05
that'd be great!
outline4 20 Jan 2014 09:44
another year passed - still the same question :D
I client of mine would like his entries ordered by thumbs...
each entry contains one image. it's a photo frame field... he's got like 500 entries that he needs to reorder, and reordering by image would be top... also because his titles are not so well chosen (it's an import from another system).
any help would be highly appreciated!
if you know of somebody who has done this already - please let me know!
cheers
stefan
Low 21 Jan 2014 20:22
Here: https://github.com/low/low_reorder_ti...
You need to change the field property to the correct image field, and you might want to change the way it displays the image. That should get you going.
outline4 21 Jan 2014 21:18
Great! I'll give it a whirl tomorrow...
Do you think that this will also work with an assets field?
Sorry for asking this question, but I am really a PHP noob!
Low 21 Jan 2014 21:25
Not sure. Depends on how Assets stores the image file.
outline4 22 Jan 2014 11:02
hi low,
well thanks for your example.
I think it would work perfectly if the field_id_xx would directly store the filename.
unlucky me, I use photoframe, and because photoframe saves multiple versions of one image, the field_id_xx only stores the entry_id and then has a separate table called: "exp_photo_frame".
maybe - and only if you have some spare time - you could help me set this up.
so my private $field = 'field_id_47' stores the entry_id
in the table *exp_photo_frame* there are the following fields:
field_id | entry_id | file | original file
47 | 2367 | {filedir_2}_framed/filename.jpg | {filedir_2}filename.jpg
maybe that's an easy one for you... for me it's kinda impossible...
cheers
stefan
Low 22 Jan 2014 11:17
Try replacing line 158 with this:
Untested, but should work.
outline4 22 Jan 2014 11:23
hm, that didn't work...
but woudn't we have to query the "exp_photo_frame" somehow?
here's the error message:
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 3
Filename: low_reorder_titles/ext.low_reorder_titles.php
Line Number: 161 ($src = $this->EE->typography->parse_file_paths($img[3]);)
Low 22 Jan 2014 11:28
Ah right. But we're stepping into rather unsupported territory now. I'm not familiar with Photo Frame, so I can't test, nor see how the data model is. If you need to develop this further, this falls outside the scope of LR support, and into custom add-on development, for which I'd need to charge...
outline4 22 Jan 2014 11:54
I suspected that :D
it's very close... you'd just have to make another query... and the datamodel of photoframe is really straight forward...
like I stated above this is the table:
how much do you think this would cost?
If it's around $100 I'll be happy :D
Low 22 Jan 2014 12:00
Email me at hi at gotolow dot com, and I'm sure we can work something out.
Jos Medinger 22 Jan 2014 12:41
This topic is bang on what I need - however you're talking about image fields and the extension that you kindly put together replaces the titles with those images.
Could you put up an alternative version which *keeps* the titles and shows selectable additional custom value(s) from a simple text field? i.e.
private $field = 'field_id_12|field_id_13|field_id_14';
etc
Or failing that, just a single text field for the time being!?
Many Thanks
Jos
Low 22 Jan 2014 12:59
Hi Jos. As I mentioned in this reply, any further development on the example extension I created falls beyond the support I can offer for Low Reorder, and should be considered custom add-on development. You can either try and do it yourself, or email me at hi at gotolow dot com for a quote.
Jos Medinger 22 Jan 2014 13:13
That's a pity
I had hoped this would fall under 'examples of use for extension hooks' :)
Given that this isn't the first time people have asked for the ability to show custom fields on the reorder page (even if only simple ones rather than parsed ones), it might be one for the development tin!
Low 22 Jan 2014 13:20
The low_reorder_show_entries hook was added so the core could stay simple: just show the title. Allowing for custom fields is a can of worms (what happens if you want to show a Grid field or Relationship field), so I decided to keep it out of the core, and instead allow for it using the hook. To help people along with it, I created the example extension.
Ray 22 Jan 2014 14:45
Low - thanks for giving us an example of extending this add-on. I may be integrating this into a site that uses Low Reorder soon. If I do, I'll post my code onto Github and link to it here so that others will have an example of the code in action. Thanks again for your hard work!
Ray 2 Feb 2014 20:32
I just modified Low's Reorder Titles extension to allow for Matrix-based images to show up on the reorder screen. I also appended each entry's title to its image, which one of you were looking to do earlier. Screenshot:
Here's a diff of my version: https://github.com/bitmanic/low_reord....
Note that I've only got support for one Matrix field at this point (lines 156 - 196). You'll need to hard code the column id that your Matrix field stores its image data in.
The part that adds the title back to the reorder screen starts on line 206.
Once I have more time, I'd like to refactor this extension to allow for an array of values to be passed to it. This array would be able to handle at least File and Matrix fields, but possibly some other fields as well. If you bug me enough, I may be more apt to do it. ;)
Thanks again, Low! This is working perfectly for me.