Due to enormous amounts of spam, the forum has been set to read-only mode.



Reply to topic  [ 7 posts ] 
HTML Export with Search (New and Improved) 
Author Message
User avatar

Joined: Fri Nov 14, 2003 6:15 pm
Posts: 1425
Post HTML Export with Search (New and Improved)

Hi Folks,

Happy New Year! It seems like yesterday but it was nearly six years ago that I posted Example: How to add a search engine to HTML Export templates. Since writing CATweb I've relied far less on exporting from CATraxx however there are times when I still need to export to HTML. As was pointed out in a recent post the old templates don't work with the latest versions of CATraxx and the search engine has a few problems with some recent browsers. So I decided to update the whole lot, include a new search engine, and share it with you. I hope you find them useful.

Attachment:
HTML_ExportWithSearch.png

CATraxx now allows us to easily create custom export definitions so rather than just providing a set of templates the next post below explains how to add the search capability to a custom export definition. Use the set of sample templates to try it out before creating your own.

First a few notes about the search engine. It searches for strings rather than unconnected words so it works more like the search engine in CATraxx than a web search engine like Google. It does not support wild cards however. If you are looking to find a track called "See Spot Run" you would find it by entering "see", or "spot", or "spot run" but not "run spot". The number of results that get displayed is set by default to 15 so the results list is not too long (the results list is not paged as it was in the old templates). If you want to change the number of results displayed simply change "var td_show = 15;" to a different value in the file Search_MakeIndex.xsl. The search result pop up displays album covers so it is best to have a cover image included as a part of your export definition.

To install the sample templates copy all the files in the zip (except close.gif and search.gif) to your CATraxx\Export\HTML folder. Copy close.gif and search.gif to your CATraxx\Explorer Templates folder. In CATraxx open File ->Export ->HTML and select "Sample_ExportWithSearch". Make sure the Output Folder field is pointing where you want it to go and that the Root Template folder is pointing to the correct location for the file Sample_ExportWithSearch_index.xsl. You are now ready to start an export.

The file Search_MakeIndex.xsl controls which fields are indexed for the search engine. As supplied it indexes album title, album artist, album notes, released year, format, label, catalog number, track titles, track authors, and lyrics. You can add to or delete from those fields by editing Search_MakeIndex.xsl.

In the next post I'll describe how to add the search capability to your custom Export HTML definition.

Download the zip file with all you need from here.


You do not have the required permissions to view the files attached to this post.

_________________
Cheers,
Dave


Sat Dec 31, 2011 9:18 pm
Profile WWW
User avatar

Joined: Fri Nov 14, 2003 6:15 pm
Posts: 1425
Post Re: HTML Export with Search (New and Improved)

Follow these steps to add the search capability to an Export HTML definition you created

Step (1) - Copy Search_MakeIndex.xsl and SearchIndex.css from the HTML_ExportWithSearch.zip file to the CATraxx\Export\HTML folder.

Step (2) - Copy search.gif and close.gif from the HTML_ExportWithSearch.zip file to the CATraxx\Explorer Templates folder

Step (3) - Working in the Export to HTML window create an Overview template or a List template with an Index field set on the Index tab. Work with the Export to HTML definition until it is just the way you want it.

Step (4) - Create a code based clone of your Export to HTML definition by choosing "Clone - Create Code Based" from the "++" pull down menu. Choose a name for the cloned template set. For this tutorial we'll assume the name is "ExportWithSearch". The "ExportWithSearch" template set will be automatically stored in the CATtraxx\Export\HTML folder.

Step (5) - Edit the file ExportWithSearch_Index.xsl.

Change this code:
Code:
    <FRAMESET COLS="150,*">
      <FRAME NAME="titlelist" SRC="ExportWithSearch_overview.xsl"/>
      <FRAME NAME="details" SRC="ExportWithSearch_info.xsl"/>
    </FRAMESET>

To this code (modify frameset cols definition and add a new frame):
Code:
    <FRAMESET COLS="330,*">
      <FRAME NAME="titlelist" SRC="ExportWithSearch_overview.xsl"/>
      <FRAME NAME="details" SRC="ExportWithSearch_info.xsl"/>
      <FRAME NAME="index" SRC="Search_MakeIndex.xsl"/>
    </FRAMESET>

Step (6) - Edit the file ExportWithSearch_overview.xsl.

Change this code:
Code:
  <HEAD>
    <TITLE><xsl:value-of select="$doctitle"/></TITLE>
    <LINK REL="stylesheet" TYPE="text/css" HREF="ExportWithSearch_overview.css"/>
  </HEAD>
  <BODY>
    <xsl:apply-templates select="data/record"/>
  </BODY>

To this (the changes are just added lines):
Code:
  <HEAD>
    <TITLE><xsl:value-of select="$doctitle"/></TITLE>
    <LINK REL="stylesheet" TYPE="text/css" HREF="ExportWithSearch_overview.css"/>
    <LINK REL="stylesheet" TYPE="text/css" HREF="SearchIndex.css"/>
    <script type="text/javascript" src="searchindex.html"></script>
  </HEAD>
  <BODY>
    <div>
      <input type="text" id="tipue_drop_input" autocomplete="off" onkeyup="tipuedrop_show();"/>
    </div>
    <div id="tipue_drop_dropdown"></div>
    <xsl:apply-templates select="data/record"/>
    <img src="close.gif" style="visibility:hidden"/>
    <img src="search.gif" style="visibility:hidden"/>
  </BODY>

Step (7) - Go to the Export HTML window, select "ExportWithSearch" and be sure the
Output Folder is set properly. Click Export.

That's it. Let me know how it works for you.

_________________
Cheers,
Dave


Sat Dec 31, 2011 9:22 pm
Profile WWW

Joined: Wed Jul 06, 2011 10:38 am
Posts: 46
Location: Germany / Frankfurt a.M.
Post Re: HTML Export with Search (New and Improved)

Hi Dave,

thanks a lot for your great work. I just downloaded your zip-file and used the template "as it is". It works very well.
Unfortunately I'm not used in editing or creating reports. So I have to try step by step how I can change some fields in your template.
But maybe soon I will understand how it works :-)

Cheers from germany
Martin


Fri Jan 20, 2012 1:19 pm
Profile
User avatar

Joined: Sat Dec 23, 2006 11:33 pm
Posts: 183
Location: Karlsruhe, Germany
Post Re: HTML Export with Search (New and Improved)

Hi Dave ,

thank's again for your work. Last night I update my my collection with your search funtion and I looked at
my old versions. I see that there I had included your flag icons function in the artists overviews.
Is it possible to implement this again.
A second question is it possible to name the html sides by the real name (artist / artist album)
instead of record number also the album images.

_________________
Kind regards
Wolf

Windows 7 64-bit Home Premium and CATraxx 9.44


Tue Sep 18, 2012 2:17 am
Profile WWW
User avatar

Joined: Fri Nov 14, 2003 6:15 pm
Posts: 1425
Post Re: HTML Export with Search (New and Improved)

Hi Wolf,
Wolf wrote:
thank's again for your work. Last night I update my my collection with your search funtion and I looked at
my old versions. I see that there I had included your flag icons function in the artists overviews.
Is it possible to implement this again.

Templates with country flags that support the new look introduced in v9.40 are available in this post http://fnprg.com/forum/viewtopic.php?f=21&t=9056&p=65229#p65229.

Quote:
A second question is it possible to name the html sides by the real name (artist / artist album)
instead of record number also the album images.

Sorry, but I don't understand what you are asking or which template you want to see changed. Can you give an example?

_________________
Cheers,
Dave


Tue Sep 18, 2012 4:18 pm
Profile WWW
User avatar

Joined: Sat Dec 23, 2006 11:33 pm
Posts: 183
Location: Karlsruhe, Germany
Post Re: HTML Export with Search (New and Improved)

Hi Dave

thank's for your reply. The first question I found out of my own. After hours of trying I find the right code and the "right place". :grin:

The second question I think was asked sometimes before but I didn't find it.
Look at the picture. With real name I mean the artist name or record name.


You do not have the required permissions to view the files attached to this post.

_________________
Kind regards
Wolf

Windows 7 64-bit Home Premium and CATraxx 9.44


Wed Sep 19, 2012 3:07 pm
Profile WWW
User avatar

Joined: Fri Nov 14, 2003 6:15 pm
Posts: 1425
Post Re: HTML Export with Search (New and Improved)

Wolf wrote:
The second question I think was asked sometimes before but I didn't find it.
Look at the picture. With real name I mean the artist name or record name.

Now I understand but I don't know the answer. This is a question for Fredrik.

_________________
Cheers,
Dave


Thu Sep 20, 2012 6:58 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.