HTML tags in items and the OAI harvester

Hi all-
I am working with a new installation of Omeka, and we have just managed to get a good OAI-DC harvest. In future harvests, we will be harvesting data with URLs embedded in the fields [for instance the identity field may have a URL to a finding aid]. I want to know if I can find a way to bulk convert the text string to a link.

I know how to use html tags to create links when I am entering individual records. We will be able to add prefixes and suffixes to the data to be imported. So I should be able to enter a proper html tagged link.

However, will I need to go through each record by hand and check off the "use html box"? or can I activate html for all the records in an import?

Any suggestions or even guesses would be appreciated. I don't want to waste other people's time getting html tags into our data if I can't get the URLs to display properly in the Omeka interface.


The OAI harvester isn't going to set elements as "using html" by default, as you've seen.

For your own purposes, you can make a small edit to libraries/OaipmhHarvester/Harvest/OaiDc.php that sets whichever fields you want to be HTML as they're imported.

In particular, line 70 of that file sets 'html' => false. Simply changing false to true will cause every element to be marked as HTML. If you know the HTML is confined to some subset of elements, I'd recommend that you only set 'html' to true for those specific elements.

You could also make some code fairly easily that simply checks if any given element from the OAI harvest is a URL, and then builds the link. Replacing line 70 with something like:

$html = false;
if (strncmp($text, 'http://', 7) == 0) {
    $text = '<a href="' . $text . '">$text</a>';
    $html = true;

$elementTexts['Dublin Core'][ucwords($element)][] = array('text' => (string) $text, 'html' => $html);

Would cause the harvester to automatically create links for element texts that start with 'http://'.

not only did you answer my question, you gave me a much better way to handle the issue.