editing details view templates

Talk to other Pedia users about the programs, share tricks and tips or ask questions about existing features.
Post Reply
davidagbr
Contributor
Contributor
Posts: 8
Joined: Wed Nov 02, 2011 12:48 pm

editing details view templates

Post by davidagbr »

Hi,

I would like to try my hand at editing one of the details view templates. However, I don't know HTML, and so I was wondering if anyone can help me.

Basically, this is what I am wanting to do:

Using the basic "Collection" template in CDpedia, I'm wanting to add track numbers to the tracklisting, so that tracks are listed like this:

1. Track Title
2. Track Title
3. Track Title

and so on. Then for compilation albums, I want the tracklisting to be like this:

1. Track Artist: Track Title
2. Track Artist: Track Title
3. Track Artist: Track Title

So, adding leading numbers, a colon after the track artist, and the removal of the hyphen that automatically appears.

Any advice would be most gratefully received!

David
User avatar
FineWine
Site Admin
Posts: 902
Joined: Wed May 28, 2008 2:41 am
Location: Tauranga, New Zealand

Re: editing details view templates

Post by FineWine »

Have a look at Bruji's excellant tutorial on creating editing a Template http://bruji.com/howto/creating_templates/ then come back. No question too dumb.

Cheers
davidagbr
Contributor
Contributor
Posts: 8
Joined: Wed Nov 02, 2011 12:48 pm

Re: editing details view templates

Post by davidagbr »

Thanks FineWine, I had already read that page, and sadly was none the wiser!!

David
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: editing details view templates

Post by Conor »

You want to find the tracks section of the collection template that looks like this:

Code: Select all

<!--IFtracks
<div class="tracks">
	<table width="100%">
		[tracksBegin]
			<tr>
				<td>IF_Tartist[track:artist]  –  END_Tartist[track:name]</td>
				<td align="right">[track:duration][durationSeparation: (*)]
				</td>
			</tr>
		[tracksEnd]
	</table>
</div>
ENDtracks-->
Update the track line format right in the middle (between the TR tags) to the following:

Code: Select all

			<tr>
				<td>[track:position]. IF_Tartist[track:artist] : END_Tartist[track:name]</td>
			</tr>
davidagbr
Contributor
Contributor
Posts: 8
Joined: Wed Nov 02, 2011 12:48 pm

Re: editing details view templates

Post by davidagbr »

That's worked like a charm... many thanks Conor!!

Maybe you could help me with another one?

I would like to (if possible), have the tracklisting separate multi disc sets into individual discs, with a disc number header. Like this:

Disc One (in bold)
1. Track title
2. Track title

Disc Two (bold again)
1. Track title

Is this possible? I would ideally prefer the numbers in the disc headers to be words, but at a push I could cope with digits! In between discs, I would like either a blank line (as in the above example), or a single hyphen.

If you can help, again, I would be very grateful.

David
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: editing details view templates

Post by Conor »

Glad you were able to implement that and modify the default template. CDpedia has slowly grown to handle multiple discs and the system had to be compatible with the previous version's templates; hence, the template system is not capable of breaking the tracks export by disc. Unfortunately, there is no extra discs loop inside the tracks loop that would allow for a disc header in the template. I have written down your suggestion and will keep it in mind when updating the template system in the future.
Post Reply