Before the end of 2017 the board will be down for a brief period of time for an upgrade.
Past experience says less than 30 minutes but I can't predict the future.
Also, there is a high probability that the forum will move to a different host, but that will not happen in 2017.
Thanks,
Doug

Need help with customize HTML Export

Discuss the powerful Explorer Templates used in the CAT programs
User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Need help with customize HTML Export

Postby DougWilliams » Wed Sep 02, 2015 2:15 am

Hi gang,
I'd like to make a change for the HTML Export for the track information. Currently the track time is display after the track title. I'd like it before. And I would like to italicize the songwriter credits (in parentheses). I could probably figure out individual field but the Album.Tracks field in HTML Export is a collection of fields so it's a little out of my league.

From this:
Capture.JPG
Capture.JPG (46.53 KiB) Viewed 704 times


To this:
A1. (6:04) Nordic Winds
(Peter Maunu)
A2. (2:50) Double Your Pleasure
(Peter Maunu)
A3. (5:30) Shadow Play
(David Luell/R. Phillipe)
A4. (2:47) Chariot Race
(Victor Feldman)
B1. (3:03) Dance The Night Away
(Victor Feldman)
B2. (4:15) Velvet Lady
(John Guerin)
B3. (3:50) Vortex
(Peter Maunu)
B4. (5:26) Mad Drums And Englishman
(John Guerin)
B5. (1:20) Silhouette
(Kenny G.)

Thanks for any help!
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

User avatar
LotsOCds
Posts: 169
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: Need help with customize HTML Export

Postby LotsOCds » Wed Sep 02, 2015 2:57 pm

Hi Doug,

To make the changes you need we had to make a code based clone of your export definitions file. Way back in time all HTML export definitions were done with XSL code. Then Fredrik changed how export works making it much easier to use. However, for some fine grained control we still need to revert back to XSL.

Give this a try. Unzip the files into a folder. It can be your Export\HTML or anywhere else. If you do put them in a different folder you will need to copy in the Common.xsl file from Export\HTML. In CATraxx open File>Export>HTML and use the gear pull down to navigate to the appropriate folder if necessary. Check that the settings on the General tab of TheRecordRoom-Code are properly set. You should be all set to go now.
Attachments
TheRecordRoom-Code.zip
(9.51 KiB) Downloaded 49 times
Cheers,
Dave

User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Need help with customize HTML Export

Postby DougWilliams » Wed Sep 02, 2015 5:52 pm

Thanks Dave!

I was thinking I might have to revert to "old school".
I'll kick the code around later tonight.

Thanks again!
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Need help with customize HTML Export

Postby DougWilliams » Thu Sep 03, 2015 2:07 am

PERFECT Dave!! Thank you!
Now.. Can you make the third pixel of the second letter of every word the color mauve? :o jk
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Need help with customize HTML Export

Postby DougWilliams » Thu Sep 03, 2015 2:21 am

Okay.. couple more.

The Title at top of the page, in my case "The Record Room". Can I change that to be a link to a URL?
Also, Album Custom 01, 02 and 03 do not appear as the renamed fields, "Cover Description", "Label Description" and "General Description" respectively. Can the Export handle the name change on the fly or does it need to be hard coded?
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

User avatar
LotsOCds
Posts: 169
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: Need help with customize HTML Export

Postby LotsOCds » Thu Sep 03, 2015 4:32 am

DougWilliams wrote:PERFECT Dave!! Thank you!

You are certainly welcome.

Now.. Can you make the third pixel of the second letter of every word the color mauve?

I'm sure that can be arranged. :wink:

Okay.. couple more.

How did I know there would be more?! No worries, happy to help.

The Title at top of the page, in my case "The Record Room". Can I change that to be a link to a URL?

I made my best guess at the URL you would want. Take a look in TheRecordRoom-Code_topmenu.xsl and you'll find where I changed the title to a link. The link is set to open in a new tab otherwise it would open into the top frame.

Also, Album Custom 01, 02 and 03 do not appear as the renamed fields, "Cover Description", "Label Description" and "General Description" respectively. Can the Export handle the name change on the fly or does it need to be hard coded?

No need to hard code, we just need to change the XSL a little. When the export template is cloned it creates the templates with hard coded names. Take a look in TheRecordRoon-Code_detail.xsl. I replaced

Code: Select all

<xsl:text>Custom 03</xsl:text>
with

Code: Select all

<xsl:value-of select="/data/fld/album/custom03/@name"/>
Similar change for Custom 02. In my file there is no Custom 01 but if you add it you'd do the same thing for that (or any other) field name.
Attachments
TheRecordRoom-Code-2.zip
(2.6 KiB) Downloaded 43 times
Cheers,
Dave

User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Need help with customize HTML Export

Postby DougWilliams » Thu Sep 03, 2015 12:29 pm

Thanks again Dave!
I don't know how you knew but the link was dead on. :)
However... the custom fields didn't work, at least with what I saw that had a custom 03. I checked the code and compared to other explorer templates and it appears to be the same. Is there something at the head of the file that needs to be defined?
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

User avatar
LotsOCds
Posts: 169
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: Need help with customize HTML Export

Postby LotsOCds » Thu Sep 03, 2015 2:49 pm

DougWilliams wrote:However... the custom fields didn't work, at least with what I saw that had a custom 03. I checked the code and compared to other explorer templates and it appears to be the same. Is there something at the head of the file that needs to be defined?

Strange. It works fine here with my test case. What exactly is it doing wrong? And did you make any modifications to the code I sent?

Screenshot - 9_3_2015 , 7_45_36 AM.png
Screenshot - 9_3_2015 , 7_45_36 AM.png (4.96 KiB) Viewed 663 times

Screenshot - 9_3_2015 , 7_43_55 AM.png
Screenshot - 9_3_2015 , 7_43_55 AM.png (21.32 KiB) Viewed 663 times
Cheers,
Dave

User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Need help with customize HTML Export

Postby DougWilliams » Thu Sep 03, 2015 5:29 pm

Running it again on a different PC it came out as you designed. I'll take a look at the other PCs setup as I must have messed something up.

I do appreciate your time.

Now about that third pixel.... ;)
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

User avatar
DougWilliams
Site Admin
Posts: 213
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: Need help with customize HTML Export

Postby DougWilliams » Thu Sep 03, 2015 11:23 pm

I figured out my problem.
I had checked the "Only generate detail page if record is modified" while working on another segment of the project.
The record hadn't been modified so the export didn't update. Hmmm computers doing what we telling... go figure!

Thanks again Dave!
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"


Return to “Explorer Templates”

Who is online

Users browsing this forum: No registered users and 1 guest