* Changing Preference Order in Media Tab

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Changing Preference Order in Media Tab

Post by ADC65 » 13 Aug 2021 09:15

I am aware that the media in the Media tab of the Individual Property Box automatically orders by date, with undated items being listed at the bottom. I know that the preference order can be changed using the black up/down arrows, and that the property box defaults back to date order rather than preference after reopening. All this is fine and I am happy with the way that FH7 deals/displays things. In general, I am not bothered about Preference order within FH7.

However, to facilitate how things are displayed when I export to my website using Mike Tate's excellent Export plugin, I would like to be able to sort the media so that the Preference order is the same as the date order. This is because my website software uses the preference order to display things, not date.

As I have added certificates and census returns in a non-chronological order, the preference numbers are not in the same order as the media dates. As I have a lot of media and about 2000 people in my file, doing this manually as a one-off exercise seems a bit daunting. I was wondering if there is a way to do this either in FH7 itself (I can't find any way myself), or if there is an exiting plugin (I have looked but can't see one), or whether it would be relatively easy to do programmatically. I'm happy to have a go at it if anyone can give me some pointers, but I don't want to make it a project.

Thanks for any advice.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Changing Preference Order in Media Tab

Post by tatewise » 13 Aug 2021 10:44

There is nothing to perform that function already so I am working on a prototype Plugin.
It is quite tricky working with both Media and Dates so decided to do it for you.

Please confirm which Media tabs you want sorted, i.e. Individual, Family, Source, Place?

You mentioned certificates and census returns in the context of Individuals.
That is unusual because Individual & Family records usually only have photos, and certificates and census returns are associated with Source records.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Changing Preference Order in Media Tab

Post by ADC65 » 13 Aug 2021 12:14

Hello Mike,

That is very kind of you, it is most generous and if I can help with anything please let me know. I know it is a bit of a niche request so please don't take any time if it works out to be too tricky.

It is the Individual Media tab I am interested in. I have attached an example below.

Ind_Media_Tab.JPG
Ind_Media_Tab.JPG (95.53 KiB) Viewed 2380 times

I accept that attaching documentation to individuals is unusual (the images are also attached to the source records). I do this for two reasons: firstly, I find it much easier to work with the documents if they are in the individual's Media tab, rather than going via the Source; secondly, it enables me work with the media much more easily in my website. I understand this is really outside of the remit of FH, but it works for me. I have attached an example below. You'll notice the Census years are out of order. I can force the correct order in TNG (which my website uses), but it is likely to be overwritten next time I do a GEDCOM upload. If the Preference order is set the same as the date, they will appear correctly in TNG.

website.JPG
website.JPG (68.81 KiB) Viewed 2380 times

Hopefully this answers what you needed to know. Thanks, Adrian.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Changing Preference Order in Media Tab

Post by tatewise » 13 Aug 2021 13:58

OK, try that attached Order Media by Date plugin Version 0.1 Date 13 Aug 2021.

It lets you choose which record types need their Media tab reviewed.
Only if the Date sorted order differs from the existing order will the Media links get altered.
So, for example, if a Media tab has just two entries already in date order then it won't be affected.

If you don't like what the plugin has done use Edit > Undo Plugin Updates.
Attachments
Order Media by Date.fh_lua
Version 0.1 Date 13 Aug 2021
(2.75 KiB) Downloaded 70 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Changing Preference Order in Media Tab

Post by ADC65 » 13 Aug 2021 15:17

Hi Mike,

That appears to be working perfectly! (I have only done a test on Individuals so far.) I will do a bit more testing and confirm back. I'm so grateful for your help, this has saved me weeks of tedium.

Adrian
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Changing Preference Order in Media Tab

Post by ADC65 » 17 Aug 2021 21:53

Hello Mike,

I have found one problem with the plugin. I flag non-photograph media documents as "Exclude from All Publications" (you can see this in the screenshot above). It appears that when a list of Individual Media has a mixture of Exclude from All Publications (i.e., both flags set) and No Exclusions (i.e., no flags set), the media sort mixes these up, with the result that some Media that should have the flags set now do not, and vice versa. I suspect that this is something that might need to be sorted with the Preference Number? Hopefully it's not too difficult a fix.

Thanks
Adrian
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Changing Preference Order in Media Tab

Post by ADC65 » 17 Aug 2021 21:57

Here's a before and after which might help illustrate what I'm trying to explain.

Before:
before.JPG
before.JPG (57.92 KiB) Viewed 2252 times

After:
after.JPG
after.JPG (63.79 KiB) Viewed 2252 times
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Changing Preference Order in Media Tab

Post by tatewise » 18 Aug 2021 09:43

Sorry Adrian, that was me being too quick with a solution and not thinking it through properly.
It also upset Link to Face frames and other characteristics associated with Media. :oops:
I am working on a correct solution.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Changing Preference Order in Media Tab

Post by tatewise » 18 Aug 2021 10:06

Try the attached Order Media by Date plugin Version 0.2 Date 18 Aug 2021 that should correct things.

BTW: I did post a version of this briefly but removed it as I thought it had a mistake, but it was OK after all.
Attachments
Order Media by Date.fh_lua
Version 0.2 Date 18 Aug 2021
(2.91 KiB) Downloaded 68 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Changing Preference Order in Media Tab

Post by ADC65 » 18 Aug 2021 23:38

Thanks Mike, that seems to be working for me (I have only tested the Individual Media Tab, not the others). Thanks again for your help.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

Post Reply