Personal Video Database
English => Development => Topic started by: John666 on October 08, 2011, 11:23:31 pm
-
In the %OPTIONS% section at the beginning of the template files there is an entry for ‘sortby=’. My question is… How do I sort on a custom field?
I have tried everything I can think of but all that happens is the output is sorted by some other method, I assume the ID.
Is this possible or have I been wasting my time trying?
-
It is not possible
-
Thanks for letting me know. Is it something that will be implemented in the new release?
Just another thought... Is it possible to copy the information I have entered into the custom field over to a standard field, for example I don’t use the Barcode field.
I have over 1000 entries and it would take hours to go and modify all of them manually.
And, is it possible to sort by more than one field in templates, so that you have a primary and secondary sort in differing directions?
-
Just another thought... Is it possible to copy the information I have entered into the custom field over to a standard field, for example I don’t use the Barcode field.
Yes. Export the custom field (along with Title and Year to identify the record), then import it to Barcode.
-
Yes. Export the custom field (along with Title and Year to identify the record), then import it to Barcode.
Thanks, that will save me a lot of time.
Any suggestions on sorting by more than one field in templates?
What I am trying to do is first sort by the contents of the 'Barcode' field and then by 'Title'.
The reason for this is that I am using the Barcode field to group specific types of records but I want them to be sorted by title within the groups.
If I just sort by the barcode field the titles are out of order.
-
If you're just using Barcode as a sort key, use Excel to append Title to Custom, and import that to Barcode.
-
If you're just using Barcode as a sort key, use Excel to append Title to Custom, and import that to Barcode.
Yes, I thought of that, but every time I enter a new record I would have to do the same thing and that would be very time consuming.
Is it a feature that is likely to be added to the new version?
-
Is it a feature that is likely to be added to the new version?
Only nostra sees the future. Seems like a rather obscure thing to me, but you haven't described the application.
-
It's a bit complicated, but here goes.
I am using the 'Release' field for storing UK Certifications e.g. 'U', 'PG', '12A' etc.
The reason for using the Release field is so that it appears in the List, formatted as '%T (%Y) %R' giving me 'Avatar (2009) 12A'.
I then found that if you sort by the Release field it sorts it into 12, 12A, 15, 18, PG, U which is out of age order.
I now use the 'Barcode' field in addition and enter 10 for U, 20 for PG, 30 for 12A, 40 for 12, 50 for 15 and 60 for 18.
This means that I can now sort the Certification correctly for output to a web page. The problem still remains that the names are out of sequence.
I have tried re-indexing the database but this does not help either.
Take a look at the images; maybe they can explain it better.
I also need to do this with the Year and IMDb Ratings so that my individual lists would appear as follows
Type Sort By List Output
Normal Title Avatar
Cert Barcode 12 Avatar
Rating IMDb 8.1 Avatar
Year Year 2009 Avatar
I have got all of these working, apart from the seemingly random order of the titles except where the title is the sort field.
[attachment deleted by admin]
-
Have you considered using HTML Frames export template (http://www.videodb.info/forum_en/index.php/topic,1844.msg13919.html#msg13919)? Maybe svenne could add the filters you require, or explain a technique for doing something similar in your template.
[attachment deleted by admin]
-
WOW, thanks for that. I have been having a look at it for hours now. It's way over my head but a good place to start.
Thanks.
-
Hi John,
How did you manage to pull the certification into PVD? I am trying that as well to pull Certification: Singapore as well.
-
Hi, sorry to disappoint. I entered the certificate info myself into the ‘release’ field but it could have been any custom field.
The easiest way if you have a lot of them is to export them to a .csv file, edit the appropriate field content and then import the changes. You must remember to include the record ID as one of the import/export fields.
I then use the export expression #stringreplace to convert the text into a number for sorting etc. for a website. See the Screen Captures.
[attachment deleted by admin]
-
You must remember to include the record ID as one of the import/export fields.
...Or anything that will uniquely match records on import, if there is no ID. Using [Title] and [Year] usually works fine for movies.