Loading...
 

Greg's Tech blog

Adding MicroID info (or how to add meta tags to your apps)

Tuesday 30 of May, 2006

I grabbed a userid at www.claimid.com and wanted to add the microid meta tag to the pages of several apps I run - namely TikiWiki & Gallery. I figured this all out in under an hour, so your app may be different, but give it a try. One thing. This breaks a simple rule of microID - that the url is encrypted with the email addess. I used the site base URL (linux2.gmartin.org:82) for all pages. Since most of these apps only support static meta tags - that's where I wound up.

Here's how I did it:
The microid is a hash that is assigned to the url & email address combination for a particular page. The email address is the address on file at microid. The mID gets added to a meta tag in the page header. The following is the microID for

http://linux2.gmartin.org:82/gallery/albums.php
< meta name="microid" content="ccb852bd6c3bfce1414c1c950bada71584ade9ba" / >

I had to find the theme.tpl file corresponding to the theme I use (matrix) on the home page. I found it under ../gallery/themes/matrix/templates.

The instructions in the file say that in order to save edits across upgrades, not to edit the original files. I created a local directory (../gallery/themes/matrix/templates/local) and copied theme.tpl there. I edited the file with a text editor and modified the html to add the correct meta tag right before the line containing </head>
-------

For TikiWIki 1.10

This was much more involved, but simpler than v1.9.x. Tiki supports the use of meta tags. Problem is that they have a pre-defined set of tags and microID was not on of them. Take a look at http://.../tiki/tiki-admin.php?page=metatags

Edit /tiki/tiki-admin_includes_metatag.php and add these lines in the (isset($_REQUEST%22metatags%22)) section:

simple_set_value('metatag_microid');

I added them after the author tag so they were clustered on the top of the page separate from the geo tags.

Next is to edit the header.tpl file in ./tiki/templates. In that file I added:

{if $metatag_author ne ''} &lt meta name="microID" content="{$metatag_microid}" /&gt
{/if}
Again, I copied the 'author' item and edited it.


Last is to edit ./tiki/templates directory to modify tiki-admin-include-metatags.tpl file. I copied the author line and changed the references to microid to match the other changes.

&lt tr &gt &lt td class="form" &gt {tr}Meta microID{/tr}: &lt /td &gt &lt td &gt &lt input type="text" name="metatag_microid" 
value="{$metatag_microid}" size="50" / &gt &lt /td &gt &lt /tr &gt

~/np~
Once this is done, you should be able to edit the microid tag on the admin/meta tags page. Once you save that and refresh, the tags should be on all pages in the site (not particularly accurate based on the microID concept, but it works for me!


-------

For TikiWIki 1.92

This was much more involved. Tiki supports the use of meta tags. Problem is that they have a pre-defined set of tags and microID was not on of them. Take a look at http://.../tiki/tiki-admin.php?page=metatags

Edit /tiki/tiki-admin_includes_metatag.php and add these lines in the if (isset($_REQUEST) section:

$tikilib->set_preference('metatag_microid',$_REQUEST["metatag_microid"]);
$smarty->assign("metatag_microid",$_REQUEST["metatag_microid"]);

and this line in the else section:

$smarty->assign("metatag_microid",$tikilib->get_preference("metatag_microid",''));

I added them after the author tag so they were clustered on the top of the page separate from the geo tags.

Next is to edit the header.tpl file in ./tiki/templates. In that file I added:

[if $metatag_microid ne ''] &lt meta name="microid" content="{$metatag_microid}" / &gt
[/if]


Last is to edit ./tiki/templates directory to modify tiki-admin-include-metatags.tpl file. I copied the author line and changed the references to microid to match the other changes.

Once this is done, you should be able to edit the microid tag on the admin/meta tags page. Once you save that and refresh, the tags should be on all pages in the site (not particularly accurate based on the microID concept, but it works for me!