New Template

If you made a template for printing or HTML export, you can offer it to the others here. You can also ask here for help about these templates
Willspo
Posts: 61
Joined: 2002-08-14 15:50:23

Post by Willspo »

It's a good idea aCCuReRaS. I might do a version with individual templates later.

An even better aproach for the Internet though would be to move the xslt-transformations (javascript) to the server side. That way you would would'nt need hundreds of xml files and the page would still only load as much data as it displays. And also you could make it work on Netscape and other browsers by just modifying the stylesheets. It would not be so much work because most of the code can be reused (at least on IIS).

Anyways I will not make any updates for at least 2 weeks. :cool:

/w
jan_hut

Post by jan_hut »

first of all I love this template! modified it a bit to my personal taste and it looks fabulous! The only thing really wanted to change was the inablity of using linebreaks in description.

Sometimes I have added a boxset to my catalog as being 1 item and I would like to be able to make a list what is on what CD. Somewhat like this:
Description:
All Season episodes of Blackadder
Season 1 (3 CD's)
The Foretelling, Born to be King
The archbishop
The queen of Spain's beard
The Witchsmeller Pursuivant
The Black Seal

I'm no XML wizard but looking at transform.xml got me a bit further. I added a similar template as commas_to_br and it looks like this:
<xsl:template name="puntcommas_to_br">
<xsl:param name="src" />
<xsl:if test="contains($src, ';')">
<xsl:value-of select="substring-before($src, ';')" />
<br />
<xsl:call-template name="puntcommas_to_br">
<xsl:with-param name="src" select="substring-after($src, ';')" />
</xsl:call-template>
</xsl:if>
</xsl:template>
It's displayed by using this:
<p class="infoView">
<b>Description:</b><br />
<xsl:call-template name="puntcommas_to_br">
<xsl:with-param name="src" select="description" />
</xsl:call-template>
</p>
Very similar to the commas_to_br template. And better yet, it works. My only problem is that though this works just fine. Descriptions for all other movies are not displayed at all! Anyone have any idea why?[/quote]
aCCuReRaS
Posts: 18
Joined: 2002-12-17 11:56:13
Location: Antwerp (Belgium)
Contact:

Post by aCCuReRaS »

An even better aproach for the Internet though would be to move the xslt-transformations (javascript) to the server side. That way you would would'nt need hundreds of xml files and the page would still only load as much data as it displays. And also you could make it work on Netscape and other browsers by just modifying the stylesheets. It would not be so much work because most of the code can be reused (at least on IIS).
and how should I do this?
jan_hut

Post by jan_hut »

as ANT exports linebreaks as <b> would it be possible to make it like this:

[quote]<xsl:template name="<br>_to_br">
<xsl:param name="src" />
<xsl:if test="contains($src, '<br>')">
<xsl:value-of select="substring-before($src, '<br>')" />
<br />
<xsl:call-template name="<br>_to_br">
<xsl:with-param name="src" select="substring-after($src, '<br>')" />
</xsl:call-template>
</xsl:if>
</xsl:template>[/quote]

Since I know nothinbg about xml and xsl does $src need to be 1 character?
Willspo
Posts: 61
Joined: 2002-08-14 15:50:23

Post by Willspo »

You want to change <br> to <br /> right?
It looks ok but i don't think that you can have <> symbols int the template name.

$src is just a variable that i made up and it can contain as many characters as you want. When you call the template you write:

Code: Select all

<xsl:call-template name="<br>_to_br"> 
<xsl:with-param name="src" select="substring-after($src, '<br>')" /> 
</xsl:call-template>
That is go to the template with the parameter src as select="substring-after($src, '<br>')" = a substring of src after the first <br>.

Since you have an if statement in the beginning (checkin if src contains <br>) you probably want an else statement also so that descriptions that don't contains <br> will be displayed as well. To do this in xsl you have to change it to:

Code: Select all

<xsl:choose>
   <xsl:when test="contains($src, '<br>')">
       your code
   </xsl:when>
   <xsl:otherwise>
      <xsl:value-of select="$src" />
   </xsl:otherwise>
</xsl:choose>
/w
Last edited by Willspo on 2003-01-01 18:21:44, edited 1 time in total.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Willspo wrote:You want to change <br> to <br /> right?
There is an option for that in AMC : Tools -> Preferences -> Export, there is a field where you can enter something else than <br> as separator.
Willspo
Posts: 61
Joined: 2002-08-14 15:50:23

Post by Willspo »

Sounds like a better idea :lol:
notebook

Post by notebook »

Looks WONDERFULL :-)))))

ist there any chance to run under opera ??

i dont like IE.xx :(
*Guest* - Frau Holle
Posts: 46
Joined: 2002-12-14 19:24:59

Post by *Guest* - Frau Holle »

I get your point. I love Opera. But in Version 6.05 there is no way. This version doesn't support xml. But Opera 7.0 should be support XML. I've tested the Opera 7.0 beta. But it doesn't function. Maybe it works with the final. I hope so.
Willspo
Posts: 61
Joined: 2002-08-14 15:50:23

Post by Willspo »

I LOVE IE! :hihi: and I don't have the time to make the template work with anything else.

:fish: /w
*Guest* - Frau Holle
Posts: 46
Joined: 2002-12-14 19:24:59

Post by *Guest* - Frau Holle »

Look at http://www.opera.com/whyopera/ why we love Opera. The most important thing is that IE is so fucking slow.

Hmm, time. I've got an idea: I can answer the questions about your template, then you don't have to look in this forum and you have more time for programming. Okay one disadvantage is, that because of my answers, in one month you are the most hated person all over the net. But that is no problem for me :) How do you feel about this nice idea? :)
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Please do not start a brower war, it is always and endless discussion since everbody has different preferences.

PS: we all know that Mozilla & Opera are better than IE :hihi:
kojiro

Post by kojiro »

est ce que quelqu'un pourrait m'expliquer en français comment installer ce templates.
parce que j'y arrive pas en anglais :/
merci beaucoup
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

kojiro wrote:est ce que quelqu'un pourrait m'expliquer en français comment installer ce templates.
parce que j'y arrive pas en anglais :/
merci beaucoup
Crée plutôt un nouveau sujet pour ça, pour ne pas encombrer celui-ci ;)
jan_hut

Post by jan_hut »

Hi ant...unfortunately that does not work (bug??).
"Line breaks will be automatically converted to:"
is what you meant right? I can change this to <br /> but if I click ok and go back into preferences it's set back to <br>.

Using version 3.4.1

gonna try willspo's suggestion for now :)
Jev
Posts: 3
Joined: 2003-01-07 07:52:41
Location: New York

Post by Jev »

Very nice template

I tried it works great but I have couple of movies in Russian
for some reason your template does not support Russian at all.
Do you have any idea what needs to be done to enable this support ?

thank you

Jev
jan_hut

Post by jan_hut »

hmmm getting a stylesheet error? weird
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I think that for that you have to change all the "encoding" values (xml header, html meta tags, etc.)
Guest

Post by Guest »

hello @all

english (bad english :o)
can a have a step by step guide for the template ...
i understand the readme.txt ...
i want to use it .. but i can`t

german
kann mir bitte jemand mal erklären wie ich das template benutze .. mit der readme.txt komme ich irgendwie nicht klar :o(

mfg
ich
RedScorpion

Post by RedScorpion »

Same story -- quite a few movies in Russian.
Very nice template

I tried it works great but I have couple of movies in Russian
for some reason your template does not support Russian at all.
Do you have any idea what needs to be done to enable this support ?

thank you

Jev
An easy work-around. Open your XML template that you use to export the DB to movies.xml -- at the top change the encoding to this

Code: Select all

<?xml version="1.0" encoding="windows-1251" ?>
that should take care of it. You don't have to change anything else.
Post Reply