Showing posts with label xhtml. Show all posts
Showing posts with label xhtml. Show all posts

Sunday, 24 June 2012

Adding Full Text Search to your Oracc 2 project portal

(FOR ORACC PROJECT MANAGERS)

One of Oracc 2's new functionalities is the Full Text Search across the whole of the site. There is a new documentation page about how to use it.

It is also very easy to enable users to do Full Text Search on your project alone, from one or more portal pages of your project. To do so you will need to edit them with Emacs or an XHTML editor.

  • First add this line of code somewhere within the head element of the page, ideally with the other link elements:

    <link rel="stylesheet" type="/css/oraccbase.css"/>

    EDIT: This is now built into the main Oracc stylesheet.

  • Then add this code wherever you want it to appear in the body of your web page, replacing [PROJECT] with the name of your project:

    <span class="find-button"><a href="/[PROJECT]/find">Full 
    Text Search</a></span>

    For instance, you might add a link to the online help:

    <p>Do a <span class="find-button"><a href="/cams/find">Full 
    Text Search</a></span> in CAMS 
    <a href="/doc/user/fulltextsearch/">[HELP]</a>.</p>

    EDITED TO ADD:

    If you are working with ESP, use <esp:link url="/[PROJECT]/find">...</esp:link> instead of <a href="/[PROJECT]/find">...</a>. The necessary CSS code is already built into ESP's stylesheet.

    This is displayed in the browser as:

    Do a Full Text Search in CAMS [HELP].

  • Finally, don't forget to run oracc web to make it go live online.

Note that this does not replace the existing text, catalogue and glossary search functions, but allows users to search across the whole of your project, including portal pages. That does mean though that it is not very sensitive to the type of data it is searching, and returns rather rough and ready results. In particular, at the moment it privileges glossary entries but Steve is improving the way it returns results all the time.

As always, please let me know if you need assistance.

Wednesday, 20 June 2012

Portal pages: preparing for Oracc 2

(For Oracc project managers)

If your Oracc project includes portal web pages that serve as introductory material to your corpus, you will need to ensure that they are valid XHTML 1.0 Strict before they can run on Oracc 2.

That sounds scary but it's not really. It just means that they are encoded so that all browsers can read and represent them correctly—and that Oracc 2's new full-text search can find and use them.

To find out more about how to check and convert your web pages, see the Oracc documentation on validating portal pages as XHTML Strict. If you use ESP to write your portal pages you don't need to do this, as ESP ensures XHTML Strict compliance as a matter of course.

As always, if you have questions or need help with any of this please just email me or a leave a comment here.

Tuesday, 17 August 2010

If your project page loses its styling ...

There is a problem with the redirection the Oracc server currently does that
I can't fix for the moment, but there is a straightforward solution.

The problem only affects projects whose pages contains relative links.
In such pages, you will see a different behaviour depending on whether you
ask for:

http://oracc.museum.upenn.edu/dcclt/

or

http://oracc.museum.upenn.edu/dcclt

The first version, with the trailing /, works correctly; the second fails to find
styling, images and any other relative links.

The solution is to specify the URL base explicitly in the home page (and
any other pages this problem affects). This is quite straightforward: just
add the <base> tag to the <head> part of the page; in the href
attribute, give the path with trailing slash. Here is what the header of
the DCCLT home page now looks like:

<head>
<base href="http://oracc.museum.upenn.edu/dcclt/"/>
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />
<link rel="stylesheet" type="text/css" href="dcclt.css" />
<title>DCCLT - Digital Corpus of Cuneiform Lexical Texts</title>
</head>

I have already fixed this in several projects (HBTIN, SAA, DCCLT), but
I haven't checked all projects to see if they need the fix.