Page 1 of 1

Bookpedia : Window template

Posted: Wed Oct 17, 2012 12:06 pm
by Izzy
Hi everyone,

First of all, I would like to thank Nora, Conor and the others that I miss for having created Bookpedia. :D It's a excellent program.
I also take a look at DVDpedia and I think it's also a great program.

A month ago, I discovered Bookpedia and now I try to create a new detail view template based on Window template.
This forum help me a lot. I have basic knowledge in html and CSS but I can make what I want to do.

For the moment, there is only two thing that I would like to know:
- First thing: I can't find is how to change the names of the tabs in that template. The tabs are : main, extra, selling and links.
I looked in the RealTitles.string file but I saw nothing similar even in French because I use this program in that language.
I'm afraid of putting a mess in the links. So, please, is it something I can do and how can I do?
- Second thing: Can I add tabs in that template if the necessary comes one day ? Is it also possible?

I apologize in advance for my english because it's not my mother language.
Thank you so much for your answer,

Re: Bookpedia : Window template

Posted: Thu Oct 18, 2012 3:40 am
by Nora
The tabbed template works by switching the template that is being used when you click on a new tab. As you might already know the template works with with four different HTML files (one for each tab). If you open all four files you will find that they are identical near the top that declares the tabs. Look for the section that declares the tabs, looks as follows:

Code: Select all

<div class="tabs">
	<div class="individual selected" style="margin-left: -3px;">[translate:Main]</div>
	
	<a href="pedia://bruji.com/changeInfoTemplate=Window_TabExtra">
		<div class="individual">[translate:Extra]</div>
	</a>
	
	<a href="pedia://bruji.com/changeInfoTemplate=Window_TabSelling">
		<div class="individual">[translate:selling]</div>
	</a>
	
	<a href="pedia://bruji.com/changeInfoTemplate=Window_TabLinks">
		<div class="individual" style="border-right: none;">[translate:links]</div>
	</a>
</div>
Here you can update the name of the tabs. You can remove the translation if it's only for personal use. For example "[translate:Extra]" could simply become "Extra - Favorites". The translate tag will work mainly for field names, all that is translated in realTitles.string. Repeat the change for all four files so that they are identical, otherwise the names will change with each tab that is selected.

Adding tabs is also possible, you would copy one of the tab sections and replicate it. You have to also update the CSS width of ".tabs .individual" to accommodate for the extra tab needed. Right now set at 25% since there are 4 tabs to occupy all the space. You would set the link to the name of the new tab after "changeInfoTemplate=", you could name it anything with the prefix "Window_". Also notice as you update each file that the selected tab changes and the link is no longer present for the selected tab and has a new class added called "selected". Via copy paste you should be able to create new tabs without much CSS or HTML knowledge.

The display fields can be anything. At the moment they use a generic template to generate what is on each tab in the add/edit window. But you could simply add each field that you want to see by creating the template:

Code: Select all

<div class="field">
	<div class="title">[translate:author]</div>
	<div class="text">[key:author]</div>
	<br />

        <div class="field">
	<div class="title">[translate:genre]</div>
	<div class="text">[key:genre]</div>
	<br />

       .....
</div>
If you later use the generic template in another tab you would need to exclude any field you don't want listed as the other template files are not loaded and the program does not know you have a special tab for author and genre in this case. It would simply be with the [exclude:] tag. So for example if you want to exclude author and genre from the tab, add the (commented) tag <!--[exclude:author,genre]-->.

Re: Bookpedia : Window template

Posted: Thu Oct 18, 2012 4:58 am
by Izzy
Thank you so much Nora for your answer. Really helpfull.
You said that translate tag will work mainly for field names. Is it possible to add myself some words in the realTitles.string and their translation? It's just for my personal use but I prefer to keep the translate tag.

Bookpedia has already plenty of fields but because I used all custom field, I also would like to know if it is possible to add fields by myself. If yes, where can I do that? If no, it could be a great thing to add that to the software.

Thank you again Nora. :)

Re: Bookpedia : Window template

Posted: Thu Oct 18, 2012 10:14 am
by Nora
Sure, you can add more strings to the realTitles.strings file to include other translations. Just make sure you make a copy of the file and keep it safe somewhere outside of the program because unlike the Templates folder kept in your database folder the realTitles.strings file lives inside the program and hence gets overwritten every time you download an update for the program.

The fields themselves are hard coded into the program, you cannot add your own (or take any away for that matter).

Re: Bookpedia : Window template

Posted: Sat Oct 20, 2012 12:14 pm
by Izzy
Thank you again Nora for your answer. I finished my detail view template as I wish. I'm very happy. :D

And I take note that I cannot change the fields. :)

Thank you.