Bookpedia : Window template and links

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
Izzy
Addicted to Bruji
Addicted to Bruji
Posts: 29
Joined: Wed Oct 17, 2012 11:35 am

Bookpedia : Window template and links

Post by Izzy »

Hi everyone,

I try to explain the problem I have. I wanted to customize the tab Links of the template Window. In that template when you want to add a link you have a table with the name, the type and the url. But when you click on ok, you can only see the name. I would like to add a column for comments.

I tried everything I could on my customize the template but I failed and in the process I can't reach the mentioned links anymore.
I explain : for one entry, I have one external link to a website and one link to a picture on my computer. Now when I roll over, the link doesn't open and I can see below that it refers to the file name (MyWindow_TabLinks). I also have the problem with the original template in the program after I did a copy paste without saving from the original to my template in order to arrange the problem.

I don't know what I did wrong but I can't find a solution. :(
Could you help me ?
I hope my explanations are clear. :)

Thank you very much in advance.
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Bookpedia : Window template and links

Post by Conor »

You can download Bookpedia again from our website to get a refresh copy that includes the original template. The Window template is a bit complex in that it relies on several files, be sure to copy all four files inot your Library/Application Support/InfoTemplates/ and rename all of them to a new name with the same format (i.e change only the "Window" bit of the file name). Also need to update the links inside each file to reflect the new name look for "Window_" and update as necessary.

Once the new template is installed correctly you can then modify the working template to add the new information into the links tab. Must likely you want to add a tag [link:type] into the links section of the template as this would be the only place you would be able to add some comments per link.
Izzy
Addicted to Bruji
Addicted to Bruji
Posts: 29
Joined: Wed Oct 17, 2012 11:35 am

Re: Bookpedia : Window template and links

Post by Izzy »

Thank you Conor for your answer.

I downloaded and installed Bookpedia again. I immediately went to the program to see if the Window template from the program is ok.
I opened it : in the Link tab of my entry, I found the name link and when I rolled over it, it refers to : /Applications/Bookpedia.app/Contents/Resources/InfoTemplates/%3Cspan%20class=
So the new installation changed nothing to the problem.

About the complexity of the Window template, Nora had already told me where to save my own template. And I did it, all four files. I renamed it and changed the links inside each file in order to have the same customization. But I also have the same problem with my template: when I roll over the external link, it refers to : /Library/Application%20Support/Bookpedia/InfoTemplates/%3Cspan%20class=

So I don't know what I did wrong and more importantly I don't know how to fix it.

Have you an idea?

Thank you so much for your help.
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Bookpedia : Window template and links

Post by Conor »

Thank you for the extra detail and all the help in finding that bug that I introduced in a recent version update. I have now fixed the bug and it's in the beta of Bookpedia. However, so you can fix your version directly the link line (normally line number 94) in the Window_inks file should be:

Code: Select all

<a href="[link:url]">[link:name]</a></span><br />
The href bit was incorrect.
Izzy
Addicted to Bruji
Addicted to Bruji
Posts: 29
Joined: Wed Oct 17, 2012 11:35 am

Re: Bookpedia : Window template and links

Post by Izzy »

Thank you Conor. Your explanation was very clear and I changed the line 94 in the Window_link file of the program and in the same file but in my template.

It results:
- No change in the Window_link file of the program. I still have the mention : /Applications/Bookpedia.app/Contents/Resources/InfoTemplates/%3Cspan%20class=
- On the other hand, the change was successful in my template. Now I can reach the external link or the link to a file.

As it didn't work in the program's template, I just tried without the </span> because I didn't see the open tag <span> even if it work with it for my templates. The result is that it didn't work either.

Is there something else I have to do ? Just because you said that you fixed the problem. Is it possible that there is a problem with my program only ?

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

Re: Bookpedia : Window template and links

Post by Conor »

Glad it worked for your template. Should have worked for the built in template as well, you can try downloading the beta again, as I have updated it to include the fix.
Izzy
Addicted to Bruji
Addicted to Bruji
Posts: 29
Joined: Wed Oct 17, 2012 11:35 am

Re: Bookpedia : Window template and links

Post by Izzy »

I downloaded the beta and it worked. I can see now the external link. So thank you. :D
Izzy
Addicted to Bruji
Addicted to Bruji
Posts: 29
Joined: Wed Oct 17, 2012 11:35 am

Re: Bookpedia : Window template and links

Post by Izzy »

Conor wrote:Once the new template is installed correctly you can then modify the working template to add the new information into the links tab. Must likely you want to add a tag [link:type] into the links section of the template as this would be the only place you would be able to add some comments per link.
I try what you told me here over. But I have some question because I can't reproduce it or there is something I don't understand :

For comments, I add a tag [link:type] in the template "Links". Do I have to write literally like that ? On what this tag is based ? Do I have to create a field in preferences ?

If I want to use the information I put in the table of the add window, is there a way to retrieve those infos and put them in the template Links. I could do it with the name but not with the others (type and url).

Thank you in advance.
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Bookpedia : Window template and links

Post by Conor »

Both [link:type] and [link:url] will be replaced in the template with the information in those columns in the links table from the add/edit window. The only requirement is that the tag appear within [linksBegin] and [linksEnd] tags. Because there can be are several links, the template needs to know what section of code to repeat. In fact the [link:url] tag is how the link href property is created, if you'd like to display the URL as well you have to add a copy of that tag in the text area of the HTML, next to [link:name].
Izzy
Addicted to Bruji
Addicted to Bruji
Posts: 29
Joined: Wed Oct 17, 2012 11:35 am

Re: Bookpedia : Window template and links

Post by Izzy »

Thank you Conor.

I think I will abandon the whole idea.

I wanted to display a table in the Link tab, like in the add/edit window. But I can't find a way to do that.

The table would have three columns with :
- the name of the link,
- the type of the link (for example I tried with : external link, internal link (photo, document, music,...),
- the comments.

Code: Select all

if you'd like to display the URL as well you have to add a copy of that tag in the text area of the HTML, next to [link:name]
To display the url, it's too complicated. I don't want to change the template each time I have a new link.

To display the type of link, I tried again and did what you said. It's displayed like this : [linksBegin][link:type][linksEnd] in the program.
It didn't work. It doesn't refer to the information I inserted in the add/edit window. The only data I can display is the name.

As for the comments, I tried everything to insert it but nothing works. I tried with [link:type] and with two different custom fields. As there is no other field in the add/edit window, I don't know where to insert the comment and how it could be related to the right link if there are several.

Anyway, thanks again for your explanation.
Post Reply