editing details view templates

Talk to other Pedia users about the programs, share tricks and tips or ask questions about existing features.

editing details view templates

Postby davidagbr » Sat Aug 18, 2012 2:03 pm

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
davidagbr
Contributor
Contributor
 
Posts: 8
Joined: Wed Nov 02, 2011 12:48 pm

Re: editing details view templates

Postby FineWine » Sat Aug 18, 2012 5:30 pm

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
User avatar
FineWine
Addicted to Bruji
Addicted to Bruji
 
Posts: 557
Joined: Wed May 28, 2008 2:41 am
Location: Tauranga, New Zealand

Re: editing details view templates

Postby davidagbr » Sat Aug 18, 2012 7:39 pm

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

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

Re: editing details view templates

Postby Conor » Sun Aug 19, 2012 5:37 am

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]&nbsp; – &nbsp;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>
User avatar
Conor
Top Dog
 
Posts: 5272
Joined: Sat Jul 03, 2004 12:58 pm

Re: editing details view templates

Postby davidagbr » Sun Aug 19, 2012 4:39 pm

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
davidagbr
Contributor
Contributor
 
Posts: 8
Joined: Wed Nov 02, 2011 12:48 pm

Re: editing details view templates

Postby Conor » Mon Aug 20, 2012 4:12 am

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.
User avatar
Conor
Top Dog
 
Posts: 5272
Joined: Sat Jul 03, 2004 12:58 pm


Return to PediaTalk

cron