Add thumbnail to records and collections...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Add thumbnail to records and collections...

Layale Bassil

Hello,

 

I managed to import and display hierarchical data with a collection A and several records under this collection.

 

I would like to know how can I add an image to be displayed next to each record in the search result and in the detailed view.  Where these thumbnails have to be saved and how to add them to the records metadata?

 

Please advise.

 

Thank you.

Regards.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Add thumbnail to records and collections...

Demian Katz

If you index a URL into the thumbnail field in Solr, that should work. Alternatively, if you can figure out the URL programmatically based on other details in the record, you could build a custom record driver to override the getThumbnail method.

 

Does that help? Let me know if you still have questions!

 

- Demian

 

From: Layale Bassil [mailto:[hidden email]]
Sent: Wednesday, May 17, 2017 11:45 AM
To: '[hidden email]'
Subject: [VuFind-General] Add thumbnail to records and collections...
Importance: High

 

Hello,

 

I managed to import and display hierarchical data with a collection A and several records under this collection.

 

I would like to know how can I add an image to be displayed next to each record in the search result and in the detailed view.  Where these thumbnails have to be saved and how to add them to the records metadata?

 

Please advise.

 

Thank you.

Regards.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Add thumbnail to records and collections...

Layale Bassil

Thank you Demian it worked. I tried it once for a static URL and it worked. If I decide to make it dynamic, I guess I have an idea on how to customize the getThumbnail method the way I did with other methods.

 

Is there a built in function that get the collection link similar to the recordLink() function?

 

I need to customize the layout of the Collections/Home page and have every collection with an image and some text. Which files do I need to work on?

 

Thank you again for the continuous support.

 

Regards.

 

From: Demian Katz [mailto:[hidden email]]
Sent: Wednesday, May 17, 2017 7:07 PM
To: Layale Bassil <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: Add thumbnail to records and collections...

 

If you index a URL into the thumbnail field in Solr, that should work. Alternatively, if you can figure out the URL programmatically based on other details in the record, you could build a custom record driver to override the getThumbnail method.

 

Does that help? Let me know if you still have questions!

 

- Demian

 

From: Layale Bassil [[hidden email]]
Sent: Wednesday, May 17, 2017 11:45 AM
To: '[hidden email]'
Subject: [VuFind-General] Add thumbnail to records and collections...
Importance: High

 

Hello,

 

I managed to import and display hierarchical data with a collection A and several records under this collection.

 

I would like to know how can I add an image to be displayed next to each record in the search result and in the detailed view.  Where these thumbnails have to be saved and how to add them to the records metadata?

 

Please advise.

 

Thank you.

Regards.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Add thumbnail to records and collections...

Demian Katz

If you decide to create dynamic thumbnails, this is the method you will want to override:

 

https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php#L1332

 

The templates for browsing collections can be found here:

 

https://github.com/vufind-org/vufind/tree/master/themes/bootstrap3/templates/collections

 

The controller that populates the data for the templates can be found here:

 

https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/Controller/CollectionsController.php

 

It’s been a while since I’ve worked on this code; I seem to recall that there are different configuration options that can impact the way the data is loaded. I’m not sure from memory how easy or hard this will be to customize – but if you run into any obstacles, please let me know and I’ll work on refreshing my memory.

 

As you will see from looking at the templates, the standard way to create a link to the collection looks like this:

 

<?=$this->url('collection', ['id' => $item['value']])?>

 

However, depending on how your instance is configured, using the standard recordLink function may correctly identify records as collections and link to them accordingly. If you have access to a record driver object, you can try that (and if it fails, see https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/Record/Router.php#L91 to figure out which configurations to change to make it work). However, if you have a collection ID without the full record driver object, the approach above is the simplest thing to do.

 

- Demian

 

From: Layale Bassil [mailto:[hidden email]]
Sent: Thursday, May 18, 2017 9:45 AM
To: Demian Katz; '[hidden email]'
Subject: RE: Add thumbnail to records and collections...

 

Thank you Demian it worked. I tried it once for a static URL and it worked. If I decide to make it dynamic, I guess I have an idea on how to customize the getThumbnail method the way I did with other methods.

 

Is there a built in function that get the collection link similar to the recordLink() function?

 

I need to customize the layout of the Collections/Home page and have every collection with an image and some text. Which files do I need to work on?

 

Thank you again for the continuous support.

 

Regards.

 

From: Demian Katz [[hidden email]]
Sent: Wednesday, May 17, 2017 7:07 PM
To: Layale Bassil <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: Add thumbnail to records and collections...

 

If you index a URL into the thumbnail field in Solr, that should work. Alternatively, if you can figure out the URL programmatically based on other details in the record, you could build a custom record driver to override the getThumbnail method.

 

Does that help? Let me know if you still have questions!

 

- Demian

 

From: Layale Bassil [[hidden email]]
Sent: Wednesday, May 17, 2017 11:45 AM
To: '[hidden email]'
Subject: [VuFind-General] Add thumbnail to records and collections...
Importance: High

 

Hello,

 

I managed to import and display hierarchical data with a collection A and several records under this collection.

 

I would like to know how can I add an image to be displayed next to each record in the search result and in the detailed view.  Where these thumbnails have to be saved and how to add them to the records metadata?

 

Please advise.

 

Thank you.

Regards.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Add thumbnail to records and collections...

Layale Bassil

Thank you very much for the detailed reply Demian. I am going around all the details provided below and will let ask more specific question as they arise.

 

Many thanks as always.

 

Best regards.

 

From: Demian Katz [mailto:[hidden email]]
Sent: Thursday, May 18, 2017 5:36 PM
To: Layale Bassil <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: Add thumbnail to records and collections...

 

If you decide to create dynamic thumbnails, this is the method you will want to override:

 

https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php#L1332

 

The templates for browsing collections can be found here:

 

https://github.com/vufind-org/vufind/tree/master/themes/bootstrap3/templates/collections

 

The controller that populates the data for the templates can be found here:

 

https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/Controller/CollectionsController.php

 

It’s been a while since I’ve worked on this code; I seem to recall that there are different configuration options that can impact the way the data is loaded. I’m not sure from memory how easy or hard this will be to customize – but if you run into any obstacles, please let me know and I’ll work on refreshing my memory.

 

As you will see from looking at the templates, the standard way to create a link to the collection looks like this:

 

<?=$this->url('collection', ['id' => $item['value']])?>

 

However, depending on how your instance is configured, using the standard recordLink function may correctly identify records as collections and link to them accordingly. If you have access to a record driver object, you can try that (and if it fails, see https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/Record/Router.php#L91 to figure out which configurations to change to make it work). However, if you have a collection ID without the full record driver object, the approach above is the simplest thing to do.

 

- Demian

 

From: Layale Bassil [[hidden email]]
Sent: Thursday, May 18, 2017 9:45 AM
To: Demian Katz; '[hidden email]'
Subject: RE: Add thumbnail to records and collections...

 

Thank you Demian it worked. I tried it once for a static URL and it worked. If I decide to make it dynamic, I guess I have an idea on how to customize the getThumbnail method the way I did with other methods.

 

Is there a built in function that get the collection link similar to the recordLink() function?

 

I need to customize the layout of the Collections/Home page and have every collection with an image and some text. Which files do I need to work on?

 

Thank you again for the continuous support.

 

Regards.

 

From: Demian Katz [[hidden email]]
Sent: Wednesday, May 17, 2017 7:07 PM
To: Layale Bassil <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: Add thumbnail to records and collections...

 

If you index a URL into the thumbnail field in Solr, that should work. Alternatively, if you can figure out the URL programmatically based on other details in the record, you could build a custom record driver to override the getThumbnail method.

 

Does that help? Let me know if you still have questions!

 

- Demian

 

From: Layale Bassil [[hidden email]]
Sent: Wednesday, May 17, 2017 11:45 AM
To: '[hidden email]'
Subject: [VuFind-General] Add thumbnail to records and collections...
Importance: High

 

Hello,

 

I managed to import and display hierarchical data with a collection A and several records under this collection.

 

I would like to know how can I add an image to be displayed next to each record in the search result and in the detailed view.  Where these thumbnails have to be saved and how to add them to the records metadata?

 

Please advise.

 

Thank you.

Regards.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Add thumbnail to records and collections...

Demian Katz

Sounds good. Glad to help!




From: Layale Bassil <[hidden email]>
Sent: Friday, May 19, 2017 10:21 AM
To: Demian Katz; '[hidden email]'
Subject: RE: Add thumbnail to records and collections...
 

Thank you very much for the detailed reply Demian. I am going around all the details provided below and will let ask more specific question as they arise.

 

Many thanks as always.

 

Best regards.

 

From: Demian Katz [mailto:[hidden email]]
Sent: Thursday, May 18, 2017 5:36 PM
To: Layale Bassil <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: Add thumbnail to records and collections...

 

If you decide to create dynamic thumbnails, this is the method you will want to override:

 

https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php#L1332

 

The templates for browsing collections can be found here:

 

https://github.com/vufind-org/vufind/tree/master/themes/bootstrap3/templates/collections

 

The controller that populates the data for the templates can be found here:

 

https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/Controller/CollectionsController.php

 

It’s been a while since I’ve worked on this code; I seem to recall that there are different configuration options that can impact the way the data is loaded. I’m not sure from memory how easy or hard this will be to customize – but if you run into any obstacles, please let me know and I’ll work on refreshing my memory.

 

As you will see from looking at the templates, the standard way to create a link to the collection looks like this:

 

<?=$this->url('collection', ['id' => $item['value']])?>

 

However, depending on how your instance is configured, using the standard recordLink function may correctly identify records as collections and link to them accordingly. If you have access to a record driver object, you can try that (and if it fails, see https://github.com/vufind-org/vufind/blob/master/module/VuFind/src/VuFind/Record/Router.php#L91 to figure out which configurations to change to make it work). However, if you have a collection ID without the full record driver object, the approach above is the simplest thing to do.

 

- Demian

 

From: Layale Bassil [[hidden email]]
Sent: Thursday, May 18, 2017 9:45 AM
To: Demian Katz; '[hidden email]'
Subject: RE: Add thumbnail to records and collections...

 

Thank you Demian it worked. I tried it once for a static URL and it worked. If I decide to make it dynamic, I guess I have an idea on how to customize the getThumbnail method the way I did with other methods.

 

Is there a built in function that get the collection link similar to the recordLink() function?

 

I need to customize the layout of the Collections/Home page and have every collection with an image and some text. Which files do I need to work on?

 

Thank you again for the continuous support.

 

Regards.

 

From: Demian Katz [[hidden email]]
Sent: Wednesday, May 17, 2017 7:07 PM
To: Layale Bassil <[hidden email]>; '[hidden email]' <[hidden email]>
Subject: RE: Add thumbnail to records and collections...

 

If you index a URL into the thumbnail field in Solr, that should work. Alternatively, if you can figure out the URL programmatically based on other details in the record, you could build a custom record driver to override the getThumbnail method.

 

Does that help? Let me know if you still have questions!

 

- Demian

 

From: Layale Bassil [[hidden email]]
Sent: Wednesday, May 17, 2017 11:45 AM
To: '[hidden email]'
Subject: [VuFind-General] Add thumbnail to records and collections...
Importance: High

 

Hello,

 

I managed to import and display hierarchical data with a collection A and several records under this collection.

 

I would like to know how can I add an image to be displayed next to each record in the search result and in the detailed view.  Where these thumbnails have to be saved and how to add them to the records metadata?

 

Please advise.

 

Thank you.

Regards.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general