Facebook like and social graph

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

Facebook like and social graph

Byron Smith-4

Hi Demian,

 

I am currently looking at the possibility of including a facebook ‘like’ ‘recommend’ or ‘send’ button with each individual VuFind item record and using the facebook social graph meta tags to control the way this information displays on a facebook users wall/timeline.  I think this would be a fantastic social tool for libraries to be able to share their library resources into the facebook community.  Would you be able to point me in the right direction of what files I would need to modify to make something like this work with VuFind?  Do you think something like this would be achievable?

 

Regards,

 

Byron


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Demian Katz
That should definitely be achievable.  You might want to take a look at Filipe's "Community tab" patch for some example Facebook integration code:

http://vufind.org/jira/browse/VUFIND-404

(I know this isn't exactly what you're talking about, but perhaps it can save you a little time).

As far as adding <meta> tags goes, VuFind 1.x uses an $addHeader variable in Smarty which allows you to inject extra data into the HTML header.  It is currently used in just one place in web/services/Record/Record.php:

        if ($this->recordDriver->hasRDF()) {
            $interface->assign(
                'addHeader', '<link rel="alternate" type="application/rdf+xml" ' .
                'title="RDF Representation" href="' . $configArray['Site']['url'] .
                '/Record/' . urlencode($_REQUEST['id']) . '/RDF" />' . "\n"
            );
        }

...but with a little refactoring (to make sure all addHeader values are concatenated rather than overwriting each other) you should be able to use this mechanism.  Once VuFind 2.0 comes along, it will have more sophisticated header manipulation (courtesy of Zend Framework), so anything you do in 1.x should be forward-portable (and can probably be simplified).

Hopefully that helps get you started, but let me know if you still have questions!

- Demian

From: Byron Smith [[hidden email]]
Sent: Friday, April 20, 2012 1:12 AM
To: 'VuFind List'
Subject: [VuFind-General] Facebook like and social graph

Hi Demian,

 

I am currently looking at the possibility of including a facebook ‘like’ ‘recommend’ or ‘send’ button with each individual VuFind item record and using the facebook social graph meta tags to control the way this information displays on a facebook users wall/timeline.  I think this would be a fantastic social tool for libraries to be able to share their library resources into the facebook community.  Would you be able to point me in the right direction of what files I would need to modify to make something like this work with VuFind?  Do you think something like this would be achievable?

 

Regards,

 

Byron


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

hatop
In reply to this post by Byron Smith-4


I recently put a facebook recommend button to the records, looks
really lovely.

For the button there was only the need to modify two templates:

On vufind2, vi layouts/layout.phtml
   <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
near the body tag,

and vi templates/record/view.phtml
    <div class="fb-like"
         data-href="<?=key($this->driver->getURLs())?>"
         data-send="true" data-width="450" data-show-faces="true"
         data-action="recommend" data-font="tahoma"></div>
    </div>
just after the getCoreMetadata stuff.

Facebook manageds to rip of title, thumbnail and description
from the url target to show up on the pinboard.
(demo http://archiv.ub.uni-marburg.de/vufind/)

I use vufind2, but it is similar with vufind1.3. If you really need
more details, I think I can try to look up my notes for that.

Greetings,
 Götz.

On Fri, Apr 20, 2012 at 03:12:42PM +1000, Byron Smith wrote:

> Hi Demian,
>
>  
>
> I am currently looking at the possibility of including a facebook 'like'
> 'recommend' or 'send' button with each individual VuFind item record and
> using the facebook social graph meta tags to control the way this
> information displays on a facebook users wall/timeline.  I think this would
> be a fantastic social tool for libraries to be able to share their library
> resources into the facebook community.  Would you be able to point me in the
> right direction of what files I would need to modify to make something like
> this work with VuFind?  Do you think something like this would be
> achievable?
>
>  
>
> Regards,
>
>  
>
> Byron
>

> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2

> _______________________________________________
> VuFind-General mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/vufind-general


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Byron Smith-4
Thankyou very much for this Götz, I really appreciate it. That is quite
close to what I am looking for.  I have tried to apply this to a demo
instance of VuFind 1.3 and have it close to working.  

The only problem I run into is when I copy the <script> below the body tag.
I have had to save this as a .js file rather than embedding the script
directly into the layout template file.

The facebook recommend and send buttons display ok once this is done however
when I click the 'recommend' button I get an invalid URL.  Is there
something I am missing here?  At the moment the URL is referencing
="<?=key($this->driver->getURLs())?>"

You can see my test instance of Vufind at:

http://webwired.webhop.net:1255/vufind2

Regards,

Byron

-----Original Message-----
From: Götz Hatop [mailto:[hidden email]]
Sent: Friday, 20 April 2012 10:19 PM
To: Byron Smith
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph



I recently put a facebook recommend button to the records, looks
really lovely.

For the button there was only the need to modify two templates:

On vufind2, vi layouts/layout.phtml
   <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
near the body tag,

and vi templates/record/view.phtml
    <div class="fb-like"
         data-href="<?=key($this->driver->getURLs())?>"
         data-send="true" data-width="450" data-show-faces="true"
         data-action="recommend" data-font="tahoma"></div>
    </div>
just after the getCoreMetadata stuff.

Facebook manageds to rip of title, thumbnail and description
from the url target to show up on the pinboard.
(demo http://archiv.ub.uni-marburg.de/vufind/)

I use vufind2, but it is similar with vufind1.3. If you really need
more details, I think I can try to look up my notes for that.

Greetings,
 Götz.

On Fri, Apr 20, 2012 at 03:12:42PM +1000, Byron Smith wrote:
> Hi Demian,
>
>  
>
> I am currently looking at the possibility of including a facebook 'like'
> 'recommend' or 'send' button with each individual VuFind item record and
> using the facebook social graph meta tags to control the way this
> information displays on a facebook users wall/timeline.  I think this
would
> be a fantastic social tool for libraries to be able to share their library
> resources into the facebook community.  Would you be able to point me in
the
> right direction of what files I would need to modify to make something
like

> this work with VuFind?  Do you think something like this would be
> achievable?
>
>  
>
> Regards,
>
>  
>
> Byron
>

>
----------------------------------------------------------------------------
--
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2

> _______________________________________________
> VuFind-General mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/vufind-general



------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Demian Katz
I think this is just a matter of translating PHP to Smarty, since VuFind 2.0 uses native PHP templates instead of Smarty and passes data around a bit differently.

In VuFind 1.x, the data that 2.0 has in $this->driver->getURLs() is found in a Smarty variable called $coreURLs.  Unfortunately, I can't figure out a really simple way to extract the first key from an array in Smarty (further proof that getting rid of Smarty in 2.0 was a good idea).  I think you have three options:

1.) Customize the record driver to simply assign the value you need to a different Smarty variable.
2.) Write a Smarty plug-in to wrap around the PHP key() function so you can call key() from within Smarty.
3.) Use a Smarty {foreach} loop to grab the first variable somehow -- should be possible, but it will result in ugly, bulky code for such a simple task.

Sorry there's not a better answer here!  Let me know if you need me to elaborate on any of the possible solutions.

- Demian
________________________________________
From: Byron Smith [[hidden email]]
Sent: Friday, April 20, 2012 10:11 AM
To: 'Götz Hatop'
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph

Thankyou very much for this Götz, I really appreciate it. That is quite
close to what I am looking for.  I have tried to apply this to a demo
instance of VuFind 1.3 and have it close to working.

The only problem I run into is when I copy the <script> below the body tag.
I have had to save this as a .js file rather than embedding the script
directly into the layout template file.

The facebook recommend and send buttons display ok once this is done however
when I click the 'recommend' button I get an invalid URL.  Is there
something I am missing here?  At the moment the URL is referencing
="<?=key($this->driver->getURLs())?>"

You can see my test instance of Vufind at:

http://webwired.webhop.net:1255/vufind2

Regards,

Byron

-----Original Message-----
From: Götz Hatop [mailto:[hidden email]]
Sent: Friday, 20 April 2012 10:19 PM
To: Byron Smith
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph



I recently put a facebook recommend button to the records, looks
really lovely.

For the button there was only the need to modify two templates:

On vufind2, vi layouts/layout.phtml
   <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
near the body tag,

and vi templates/record/view.phtml
    <div class="fb-like"
         data-href="<?=key($this->driver->getURLs())?>"
         data-send="true" data-width="450" data-show-faces="true"
         data-action="recommend" data-font="tahoma"></div>
    </div>
just after the getCoreMetadata stuff.

Facebook manageds to rip of title, thumbnail and description
from the url target to show up on the pinboard.
(demo http://archiv.ub.uni-marburg.de/vufind/)

I use vufind2, but it is similar with vufind1.3. If you really need
more details, I think I can try to look up my notes for that.

Greetings,
 Götz.

On Fri, Apr 20, 2012 at 03:12:42PM +1000, Byron Smith wrote:
> Hi Demian,
>
>
>
> I am currently looking at the possibility of including a facebook 'like'
> 'recommend' or 'send' button with each individual VuFind item record and
> using the facebook social graph meta tags to control the way this
> information displays on a facebook users wall/timeline.  I think this
would
> be a fantastic social tool for libraries to be able to share their library
> resources into the facebook community.  Would you be able to point me in
the
> right direction of what files I would need to modify to make something
like

> this work with VuFind?  Do you think something like this would be
> achievable?
>
>
>
> Regards,
>
>
>
> Byron
>

>
----------------------------------------------------------------------------
--
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2

> _______________________________________________
> VuFind-General mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/vufind-general



------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

hatop
In reply to this post by Byron Smith-4



> The only problem I run into is when I copy the <script> below the body tag.
> I have had to save this as a .js file rather than embedding the script
> directly into the layout template file.
 smarty requires something like
{literal}
{/literal}
around the facebook script. That was one reason to switch to vufind2,
and to my opinion the progress in "clean architecture" is just awesome.
Nothing gets in my way, no smarty, no Zend. I can survive with those
rudimantary php knowlegde I have when I need to leave my beautiful
java world.

>
> The facebook recommend and send buttons display ok once this is done however
> when I click the 'recommend' button I get an invalid URL.  Is there
> something I am missing here?  At the moment the URL is referencing
> ="<?=key($this->driver->getURLs())?>"

 what fb wants, is a web page to recommend, and since we have such
 since ever for our IR stuff, it was easy. But in general, the
 url for FB should (in my opinion) be persistent and have good
 DC metadata tags.

>
> You can see my test instance of Vufind at:
>
> http://webwired.webhop.net:1255/vufind2

Hmm, I just recommended something to myself (not really, to my FB identity
of course).
Not sure if it is supposed to work or if FB needs some time to show up the
recommedation. Have you done/solved it ?

Regards,
 Götz.


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Demian Katz
>  what fb wants, is a web page to recommend, and since we have such
>  since ever for our IR stuff, it was easy. But in general, the
>  url for FB should (in my opinion) be persistent and have good
>  DC metadata tags.

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

- Demian
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Byron Smith-4
That makes sense to me Demian.  The user will be clicking 'like' from the record view so it sounds like that would work especially if it was possible to add in extra og meta tags.

Regards,

Byron

On 23/04/2012, at 10:55 PM, Demian Katz <[hidden email]> wrote:

>> what fb wants, is a web page to recommend, and since we have such
>> since ever for our IR stuff, it was easy. But in general, the
>> url for FB should (in my opinion) be persistent and have good
>> DC metadata tags.
>
> Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.
>
> - Demian

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

hatop
In reply to this post by Demian Katz
On Mon, Apr 23, 2012 at 12:55:37PM +0000, Demian Katz wrote:
> >  what fb wants, is a web page to recommend, and since we have such
> >  since ever for our IR stuff, it was easy. But in general, the
> >  url for FB should (in my opinion) be persistent and have good
> >  DC metadata tags.
>
> Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.
>

yes, of course you are right. Thats even better in the sense that the
solution is more independant from setup done elsewhere.

-- Götz.

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Byron Smith-4
In reply to this post by Demian Katz

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Demian Katz

I think that looks like a reasonable solution to your problem.

 

As far as populating the meta tags goes, that’s another job for the $addHeader variable I mentioned earlier – you could add some code like this to the getCoreMetadata() method of web/RecordDrivers/IndexRecord.php:

 

$addHeader = $interface-> get_template_vars('addHeader'); // get existing value, if any

$addHeader .= ‘<meta name=”title” content=”’ . htmlspecialchars($this->getTitle()) . ‘” />’;

$interface->assign(‘addHeader’, $addHeader); // store updated value

 

Obviously you may need to do more work to generate some of the other meta tags – but my point is that you need to read addHeader out of the Smarty interface (in case other code has already put data there), then update it, then write it back.

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Monday, April 23, 2012 10:13 PM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Byron Smith-4

Thanks for that Demian, I have got the majority of the meta tags inserted using the method you described and it seems to be working nicely.  I still have three additional OG meta tags that I would like to add but I am unsure of the function that would be required to retrieve the appropriate information.  The meta tags I am trying to add are:

 

<meta property="og:description" content="My description here"/>

<meta property="og:type" content="Book"/>

<meta property="og:site_name" content="My Site Name"/>

 

Any idea on how I could pull the required information for this?  The description and type I would like to retrieve from what is appearing in the following screenshot snippet and the Site Name I was hoping to pull from the config.ini.  What are your thoughts?

 

 

Regards,

 

Byron

 

 


From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, 24 April 2012 10:43 PM
To: Byron Smith; 'Götz Hatop'
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph

 

I think that looks like a reasonable solution to your problem.

 

As far as populating the meta tags goes, that’s another job for the $addHeader variable I mentioned earlier – you could add some code like this to the getCoreMetadata() method of web/RecordDrivers/IndexRecord.php:

 

$addHeader = $interface-> get_template_vars('addHeader'); // get existing value, if any

$addHeader .= ‘<meta name=”title” content=”’ . htmlspecialchars($this->getTitle()) . ‘” />’;

$interface->assign(‘addHeader’, $addHeader); // store updated value

 

Obviously you may need to do more work to generate some of the other meta tags – but my point is that you need to read addHeader out of the Smarty interface (in case other code has already put data there), then update it, then write it back.

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Monday, April 23, 2012 10:13 PM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Demian Katz

For type, use $this->getFormats().  That will return an array that you should iterate through – some records may have multiple formats.

 

For description, use $this->getSummary().  This will also return an array; I’m not sure whether it’s better to just pick the first value of the array or offer multiple descriptions – in most cases there probably won’t be more than one.

 

For site_name, use $configArray[‘Site’][‘title’].

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 12:53 AM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Thanks for that Demian, I have got the majority of the meta tags inserted using the method you described and it seems to be working nicely.  I still have three additional OG meta tags that I would like to add but I am unsure of the function that would be required to retrieve the appropriate information.  The meta tags I am trying to add are:

 

<meta property="og:description" content="My description here"/>

<meta property="og:type" content="Book"/>

<meta property="og:site_name" content="My Site Name"/>

 

Any idea on how I could pull the required information for this?  The description and type I would like to retrieve from what is appearing in the following screenshot snippet and the Site Name I was hoping to pull from the config.ini.  What are your thoughts?

 

 

Regards,

 

Byron

 

 


From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, 24 April 2012 10:43 PM
To: Byron Smith; 'Götz Hatop'
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph

 

I think that looks like a reasonable solution to your problem.

 

As far as populating the meta tags goes, that’s another job for the $addHeader variable I mentioned earlier – you could add some code like this to the getCoreMetadata() method of web/RecordDrivers/IndexRecord.php:

 

$addHeader = $interface-> get_template_vars('addHeader'); // get existing value, if any

$addHeader .= ‘<meta name=”title” content=”’ . htmlspecialchars($this->getTitle()) . ‘” />’;

$interface->assign(‘addHeader’, $addHeader); // store updated value

 

Obviously you may need to do more work to generate some of the other meta tags – but my point is that you need to read addHeader out of the Smarty interface (in case other code has already put data there), then update it, then write it back.

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Monday, April 23, 2012 10:13 PM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: Facebook like and social graph

Eoghan Ó Carragáin
There seems to be a bit of overlap here with embedding schema.org elements (http://vufind.org/jira/browse/VUFIND-425)

Demian, out of interest, have you given any thought to how Vufind 2.0 might handle different types of microdata (opengraph, schema.org, rdfa)?

Eoghan



On 25 April 2012 13:57, Demian Katz <[hidden email]> wrote:

For type, use $this->getFormats().  That will return an array that you should iterate through – some records may have multiple formats.

 

For description, use $this->getSummary().  This will also return an array; I’m not sure whether it’s better to just pick the first value of the array or offer multiple descriptions – in most cases there probably won’t be more than one.

 

For site_name, use $configArray[‘Site’][‘title’].

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 12:53 AM


To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Thanks for that Demian, I have got the majority of the meta tags inserted using the method you described and it seems to be working nicely.  I still have three additional OG meta tags that I would like to add but I am unsure of the function that would be required to retrieve the appropriate information.  The meta tags I am trying to add are:

 

<meta property="og:description" content="My description here"/>

<meta property="og:type" content="Book"/>

<meta property="og:site_name" content="My Site Name"/>

 

Any idea on how I could pull the required information for this?  The description and type I would like to retrieve from what is appearing in the following screenshot snippet and the Site Name I was hoping to pull from the config.ini.  What are your thoughts?

 

 

Regards,

 

Byron

 

 


From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, 24 April 2012 10:43 PM
To: Byron Smith; 'Götz Hatop'
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph

 

I think that looks like a reasonable solution to your problem.

 

As far as populating the meta tags goes, that’s another job for the $addHeader variable I mentioned earlier – you could add some code like this to the getCoreMetadata() method of web/RecordDrivers/IndexRecord.php:

 

$addHeader = $interface-> get_template_vars('addHeader'); // get existing value, if any

$addHeader .= ‘<meta name=”title” content=”’ . htmlspecialchars($this->getTitle()) . ‘” />’;

$interface->assign(‘addHeader’, $addHeader); // store updated value

 

Obviously you may need to do more work to generate some of the other meta tags – but my point is that you need to read addHeader out of the Smarty interface (in case other code has already put data there), then update it, then write it back.

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Monday, April 23, 2012 10:13 PM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

VuFind and microdata (was: Facebook like and social graph)

Demian Katz

I’ve given a little bit of thought to microdata in VuFind, but so far my thoughts have led me to the conclusion that I’m not ready to deal with it yet.  As I see it, there are two possible approaches:

 

1.)    The “simple” solution is to come up with a standard set of microdata that VuFind provides by default.  This has a couple of major disadvantages: first of all, there are a lot of competing standards, and the market still needs time to settle out to see if there will really be a preferred option.  I don’t want to implement something that will need to be frequently changed as the wind shifts.  Second, since most microdata integrates into existing markup rather than simply adding extra elements, it makes template maintenance more challenging and could be an obstacle to local customization (one more detail to keep track of).

2.)    The more robust solution is to have some kind of configurable option to control which microdata options are used.  Because of the “microdata integrated with markup” issue mentioned above, I don’t see a way to do this without either making templates hideously complex (multiple if statements inside every tag) or ending up with a profusion of alternate templates representing the same thing.  Again, it becomes a maintenance headache.

 

I’m certainly not opposed to having microdata in VuFind – anything that improves interoperability with the rest of the web is clearly a good thing.  I just view it as being left as a local customization option for now, because I don’t see an easy way to make it configurable, and I don’t want to commit to the task of maintaining extra-complicated templates until the market is more stable and the benefits are more clear.

 

Unfortunately, I don’t really see VuFind 2.0 changing the fundamentals of this situation.  Although I see the inherent logic in the way microdata uses the existing structure of HTML to convey meaning, it’s really a headache for a strict model-view-controller application with multiple themes; unless you commit to a single standard, the view ends up needing extra intelligence that complicates template building, and you have to implement that intelligence redundantly to support theming.

 

It’s entirely possible that I’m overreacting, missing the obvious and/or being a curmudgeon.  Feel free to publicly disagree with me on this – I don’t want to stand in the way of progress if I’m misjudging the situation.  I welcome proposed solutions, and of course sharing patches in JIRA is always useful even if I’m not willing to commit to maintaining this logic in the trunk just yet.

 

- Demian

 

From: Eoghan Ó Carragáin [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 9:40 AM
To: Demian Katz
Cc: Byron Smith; Götz Hatop; VuFind List
Subject: Re: [VuFind-General] Facebook like and social graph

 

There seems to be a bit of overlap here with embedding schema.org elements (http://vufind.org/jira/browse/VUFIND-425)

Demian, out of interest, have you given any thought to how Vufind 2.0 might handle different types of microdata (opengraph, schema.org, rdfa)?

Eoghan


On 25 April 2012 13:57, Demian Katz <[hidden email]> wrote:

For type, use $this->getFormats().  That will return an array that you should iterate through – some records may have multiple formats.

 

For description, use $this->getSummary().  This will also return an array; I’m not sure whether it’s better to just pick the first value of the array or offer multiple descriptions – in most cases there probably won’t be more than one.

 

For site_name, use $configArray[‘Site’][‘title’].

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 12:53 AM


To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Thanks for that Demian, I have got the majority of the meta tags inserted using the method you described and it seems to be working nicely.  I still have three additional OG meta tags that I would like to add but I am unsure of the function that would be required to retrieve the appropriate information.  The meta tags I am trying to add are:

 

<meta property="og:description" content="My description here"/>

<meta property="og:type" content="Book"/>

<meta property="og:site_name" content="My Site Name"/>

 

Any idea on how I could pull the required information for this?  The description and type I would like to retrieve from what is appearing in the following screenshot snippet and the Site Name I was hoping to pull from the config.ini.  What are your thoughts?

 

 

Regards,

 

Byron

 

 


From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, 24 April 2012 10:43 PM
To: Byron Smith; 'Götz Hatop'
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph

 

I think that looks like a reasonable solution to your problem.

 

As far as populating the meta tags goes, that’s another job for the $addHeader variable I mentioned earlier – you could add some code like this to the getCoreMetadata() method of web/RecordDrivers/IndexRecord.php:

 

$addHeader = $interface-> get_template_vars('addHeader'); // get existing value, if any

$addHeader .= ‘<meta name=”title” content=”’ . htmlspecialchars($this->getTitle()) . ‘” />’;

$interface->assign(‘addHeader’, $addHeader); // store updated value

 

Obviously you may need to do more work to generate some of the other meta tags – but my point is that you need to read addHeader out of the Smarty interface (in case other code has already put data there), then update it, then write it back.

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Monday, April 23, 2012 10:13 PM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: VuFind and microdata (was: Facebook like and social graph)

Eoghan Ó Carragáin
Hi,
I ran into some of the issues you describe when putting the VUFIND-425 patch together. We never actually implemented it in our live catalogue.

Having more granularity in the variables assigned to the trunk templates might help a bit with local modifications, e.g. as mentiond in the VUFIND-435 ticket, publication details like publisher, place of publication, date of publication are currently assigned to the template as a single variable whereas I think schema.org wraps them individually.

I suppose we could try to "maintain" patches on JIRA (i.e. make sure they still work for each release) which would avoid making the trunk templates overly complex.
Thanks,
Eoghan




On 25 April 2012 15:05, Demian Katz <[hidden email]> wrote:

I’ve given a little bit of thought to microdata in VuFind, but so far my thoughts have led me to the conclusion that I’m not ready to deal with it yet.  As I see it, there are two possible approaches:

 

1.)    The “simple” solution is to come up with a standard set of microdata that VuFind provides by default.  This has a couple of major disadvantages: first of all, there are a lot of competing standards, and the market still needs time to settle out to see if there will really be a preferred option.  I don’t want to implement something that will need to be frequently changed as the wind shifts.  Second, since most microdata integrates into existing markup rather than simply adding extra elements, it makes template maintenance more challenging and could be an obstacle to local customization (one more detail to keep track of).

2.)    The more robust solution is to have some kind of configurable option to control which microdata options are used.  Because of the “microdata integrated with markup” issue mentioned above, I don’t see a way to do this without either making templates hideously complex (multiple if statements inside every tag) or ending up with a profusion of alternate templates representing the same thing.  Again, it becomes a maintenance headache.

 

I’m certainly not opposed to having microdata in VuFind – anything that improves interoperability with the rest of the web is clearly a good thing.  I just view it as being left as a local customization option for now, because I don’t see an easy way to make it configurable, and I don’t want to commit to the task of maintaining extra-complicated templates until the market is more stable and the benefits are more clear.

 

Unfortunately, I don’t really see VuFind 2.0 changing the fundamentals of this situation.  Although I see the inherent logic in the way microdata uses the existing structure of HTML to convey meaning, it’s really a headache for a strict model-view-controller application with multiple themes; unless you commit to a single standard, the view ends up needing extra intelligence that complicates template building, and you have to implement that intelligence redundantly to support theming.

 

It’s entirely possible that I’m overreacting, missing the obvious and/or being a curmudgeon.  Feel free to publicly disagree with me on this – I don’t want to stand in the way of progress if I’m misjudging the situation.  I welcome proposed solutions, and of course sharing patches in JIRA is always useful even if I’m not willing to commit to maintaining this logic in the trunk just yet.

 

- Demian

 

From: Eoghan Ó Carragáin [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 9:40 AM
To: Demian Katz
Cc: Byron Smith; Götz Hatop; VuFind List
Subject: Re: [VuFind-General] Facebook like and social graph

 

There seems to be a bit of overlap here with embedding schema.org elements (http://vufind.org/jira/browse/VUFIND-425)

Demian, out of interest, have you given any thought to how Vufind 2.0 might handle different types of microdata (opengraph, schema.org, rdfa)?

Eoghan


On 25 April 2012 13:57, Demian Katz <[hidden email]> wrote:

For type, use $this->getFormats().  That will return an array that you should iterate through – some records may have multiple formats.

 

For description, use $this->getSummary().  This will also return an array; I’m not sure whether it’s better to just pick the first value of the array or offer multiple descriptions – in most cases there probably won’t be more than one.

 

For site_name, use $configArray[‘Site’][‘title’].

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 12:53 AM


To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Thanks for that Demian, I have got the majority of the meta tags inserted using the method you described and it seems to be working nicely.  I still have three additional OG meta tags that I would like to add but I am unsure of the function that would be required to retrieve the appropriate information.  The meta tags I am trying to add are:

 

<meta property="og:description" content="My description here"/>

<meta property="og:type" content="Book"/>

<meta property="og:site_name" content="My Site Name"/>

 

Any idea on how I could pull the required information for this?  The description and type I would like to retrieve from what is appearing in the following screenshot snippet and the Site Name I was hoping to pull from the config.ini.  What are your thoughts?

 

 

Regards,

 

Byron

 

 


From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, 24 April 2012 10:43 PM
To: Byron Smith; 'Götz Hatop'
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph

 

I think that looks like a reasonable solution to your problem.

 

As far as populating the meta tags goes, that’s another job for the $addHeader variable I mentioned earlier – you could add some code like this to the getCoreMetadata() method of web/RecordDrivers/IndexRecord.php:

 

$addHeader = $interface-> get_template_vars('addHeader'); // get existing value, if any

$addHeader .= ‘<meta name=”title” content=”’ . htmlspecialchars($this->getTitle()) . ‘” />’;

$interface->assign(‘addHeader’, $addHeader); // store updated value

 

Obviously you may need to do more work to generate some of the other meta tags – but my point is that you need to read addHeader out of the Smarty interface (in case other code has already put data there), then update it, then write it back.

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Monday, April 23, 2012 10:13 PM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general
Reply | Threaded
Open this post in threaded view
|

Re: VuFind and microdata (was: Facebook like and social graph)

Demian Katz

I can at least say that VuFind 2 will help with the data granularity issues…  or at least, it will make them easier to fix.  VuFind 2’s record templates use a “pull” rather than “push” approach to retrieving data.  That is, rather than assigning a ton of variables in the controller, VuFind 2 instead sends a record driver object to the template, and the template calls public methods to get the data it needs.  This avoids some of the problems VuFind 1 has with variables from one record bleeding into another, it avoids retrieving data that we never use, and it offers much greater flexibility.  There’s also a “tryMethod” method which allows you to retrieve data from a named method and get null if the method does not exist, which allows for more robust sharing of templates between multiple record drivers.  I think all of that should help at least a bit….

 

- Demian

 

From: Eoghan Ó Carragáin [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 10:35 AM
To: Demian Katz
Cc: Byron Smith; Götz Hatop; VuFind List
Subject: Re: VuFind and microdata (was: Facebook like and social graph)

 

Hi,
I ran into some of the issues you describe when putting the VUFIND-425 patch together. We never actually implemented it in our live catalogue.

Having more granularity in the variables assigned to the trunk templates might help a bit with local modifications, e.g. as mentiond in the VUFIND-435 ticket, publication details like publisher, place of publication, date of publication are currently assigned to the template as a single variable whereas I think schema.org wraps them individually.

I suppose we could try to "maintain" patches on JIRA (i.e. make sure they still work for each release) which would avoid making the trunk templates overly complex.
Thanks,
Eoghan



On 25 April 2012 15:05, Demian Katz <[hidden email]> wrote:

I’ve given a little bit of thought to microdata in VuFind, but so far my thoughts have led me to the conclusion that I’m not ready to deal with it yet.  As I see it, there are two possible approaches:

 

1.)    The “simple” solution is to come up with a standard set of microdata that VuFind provides by default.  This has a couple of major disadvantages: first of all, there are a lot of competing standards, and the market still needs time to settle out to see if there will really be a preferred option.  I don’t want to implement something that will need to be frequently changed as the wind shifts.  Second, since most microdata integrates into existing markup rather than simply adding extra elements, it makes template maintenance more challenging and could be an obstacle to local customization (one more detail to keep track of).

2.)    The more robust solution is to have some kind of configurable option to control which microdata options are used.  Because of the “microdata integrated with markup” issue mentioned above, I don’t see a way to do this without either making templates hideously complex (multiple if statements inside every tag) or ending up with a profusion of alternate templates representing the same thing.  Again, it becomes a maintenance headache.

 

I’m certainly not opposed to having microdata in VuFind – anything that improves interoperability with the rest of the web is clearly a good thing.  I just view it as being left as a local customization option for now, because I don’t see an easy way to make it configurable, and I don’t want to commit to the task of maintaining extra-complicated templates until the market is more stable and the benefits are more clear.

 

Unfortunately, I don’t really see VuFind 2.0 changing the fundamentals of this situation.  Although I see the inherent logic in the way microdata uses the existing structure of HTML to convey meaning, it’s really a headache for a strict model-view-controller application with multiple themes; unless you commit to a single standard, the view ends up needing extra intelligence that complicates template building, and you have to implement that intelligence redundantly to support theming.

 

It’s entirely possible that I’m overreacting, missing the obvious and/or being a curmudgeon.  Feel free to publicly disagree with me on this – I don’t want to stand in the way of progress if I’m misjudging the situation.  I welcome proposed solutions, and of course sharing patches in JIRA is always useful even if I’m not willing to commit to maintaining this logic in the trunk just yet.

 

- Demian

 

From: Eoghan Ó Carragáin [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 9:40 AM
To: Demian Katz
Cc: Byron Smith; Götz Hatop; VuFind List
Subject: Re: [VuFind-General] Facebook like and social graph

 

There seems to be a bit of overlap here with embedding schema.org elements (http://vufind.org/jira/browse/VUFIND-425)

Demian, out of interest, have you given any thought to how Vufind 2.0 might handle different types of microdata (opengraph, schema.org, rdfa)?

Eoghan

On 25 April 2012 13:57, Demian Katz <[hidden email]> wrote:

For type, use $this->getFormats().  That will return an array that you should iterate through – some records may have multiple formats.

 

For description, use $this->getSummary().  This will also return an array; I’m not sure whether it’s better to just pick the first value of the array or offer multiple descriptions – in most cases there probably won’t be more than one.

 

For site_name, use $configArray[‘Site’][‘title’].

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Wednesday, April 25, 2012 12:53 AM


To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Thanks for that Demian, I have got the majority of the meta tags inserted using the method you described and it seems to be working nicely.  I still have three additional OG meta tags that I would like to add but I am unsure of the function that would be required to retrieve the appropriate information.  The meta tags I am trying to add are:

 

<meta property="og:description" content="My description here"/>

<meta property="og:type" content="Book"/>

<meta property="og:site_name" content="My Site Name"/>

 

Any idea on how I could pull the required information for this?  The description and type I would like to retrieve from what is appearing in the following screenshot snippet and the Site Name I was hoping to pull from the config.ini.  What are your thoughts?

 

 

Regards,

 

Byron

 

 


From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, 24 April 2012 10:43 PM
To: Byron Smith; 'Götz Hatop'
Cc: 'VuFind List'
Subject: Re: [VuFind-General] Facebook like and social graph

 

I think that looks like a reasonable solution to your problem.

 

As far as populating the meta tags goes, that’s another job for the $addHeader variable I mentioned earlier – you could add some code like this to the getCoreMetadata() method of web/RecordDrivers/IndexRecord.php:

 

$addHeader = $interface-> get_template_vars('addHeader'); // get existing value, if any

$addHeader .= ‘<meta name=”title” content=”’ . htmlspecialchars($this->getTitle()) . ‘” />’;

$interface->assign(‘addHeader’, $addHeader); // store updated value

 

Obviously you may need to do more work to generate some of the other meta tags – but my point is that you need to read addHeader out of the Smarty interface (in case other code has already put data there), then update it, then write it back.

 

- Demian

 

From: Byron Smith [mailto:[hidden email]]
Sent: Monday, April 23, 2012 10:13 PM
To: Demian Katz; 'Götz Hatop'
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

Hi Demian,

 

I have been able to link to the current page by using

 

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}

 

<div class="fb-like" data-href="{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-send="true" data-width="450" data-show-faces="true" data-action="recommend" data-font="tahoma"></div>

 

Is this ok to use?  I still need to find a way to populate the OG meta tags in the record view so that the record formats in Facebook properly.

 

Regards,

 

Byron

 

-----Original Message-----
From: Demian Katz [mailto:[hidden email]]
Sent: Monday, 23 April 2012 10:56 PM
To: [hidden email]; Byron Smith
Cc: 'VuFind List'
Subject: RE: [VuFind-General] Facebook like and social graph

 

>  what fb wants, is a web page to recommend, and since we have such

>  since ever for our IR stuff, it was easy. But in general, the

>  url for FB should (in my opinion) be persistent and have good

>  DC metadata tags.

 

Would it make sense, in the absence of a good external link, to recommend the current page?  That URL is easy to generate in 1.x, and it would probably be fairly straightforward to augment the record view with extra <meta> tags.

 

- Demian


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general

 

 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
VuFind-General mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-general