Author Topic: And Statements, Or Statements, etc...  (Read 10697 times)

0 Members and 2 Guests are viewing this topic.

Offline katleeh

  • User
  • ***
  • Posts: 55
    • View Profile
And Statements, Or Statements, etc...
« on: May 21, 2011, 03:20:03 am »
Is there any way to do If/Then/Else statements, And statements, etc in XML? I've been reading up on it and most of the information refers to using XSL, but I'm not sure that's even compatible in this instance. Is there a format guide for how and what can be done in the skin files?

What i'm tryin to do is make it so that the skin will display different general images depending on what the data in the record is. For instance, if its a DVD, then it would display a DVD image, etc.

- Katleeh

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #1 on: May 21, 2011, 06:07:31 am »
XML is just a standard for a document format. The fact skin data is stored in an XML-like format doesn't imply XSL is applicable to it. In fact, the data is for the exclusive use of the skin engine. AFAIK, everything the skin engine is capable of is documented in the Skin Engine Manual. I think it's fair to say it's capabilities are restricted to controls for specifying how fields from a given record will be displayed.

I'm not sure if this is what you mean, but it would be nice if there were a general way to associate attributes (i.e., the existing values of a list field) with images, and then have the ability to display the attribute and/or its associated image in the skin. Then Countries and Languages could be displayed as flags, Media Types and Codecs as icons, Studios and Distributions as trademarks, etc. 8)

Offline katleeh

  • User
  • ***
  • Posts: 55
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #2 on: May 22, 2011, 01:39:47 am »
*grumbles* That's exactly what I'm trying to do, to.

So as of yet, there's no way to do any of those things in the skins?

- Katleeh

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #3 on: May 22, 2011, 06:37:14 am »
Quote
So as of yet, there's no way to do any of those things in the skins?

Well, there's always a way. Just nothing very practical...

The screenshot shows how <imagelist> can be used to show additional posters. Posters, like screenshots, are all saved in the same container. Using this function, the one tagged as default appears as the poster, and the rest appear in this "flow section." If you only wanted one poster, it could be saved as the default, and the container could be used for "attribute icons." The imagelist could be formatted differently and placed anywhere in the skin. Unfortunately, you'd have to manually add the icons for each movie.

More clever but still impractical: Export attributes in the form of a batch file that would create one attributes image grouping or banner from a collection of attribute icons. Import the resulting image as a <cdcover> and place that in the desired location in the skin. This would be very cool, but you'd probably hate yourself when nostra implements a feature that automatically associates attributes with images. ;)

[attachment deleted by admin]

Offline katleeh

  • User
  • ***
  • Posts: 55
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #4 on: May 24, 2011, 12:56:24 am »
I've actually gone over the skin manual several times and its missing somethings. For instance, I've noticed that movies edited can sometimes show up in different places than planned but don't know how that is specified. Likewise when you are designing the skin how do you specify how things are laid out during editing and how they are laid out regularly? Also, how do you use seperate custom fields? Say I want to add custom fields in places other than the custom section, how would I do that?

- katleeh

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2714
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #5 on: May 24, 2011, 07:30:12 am »
Quote
Also, how do you use seperate custom fields? Say I want to add custom fields in places other than the custom section, how would I do that?

Here are some examples of custom fields, which can add to the various places in the skin according to your wishes.
Examples:

1.)
Code: [Select]
<row>
                <column>
                  <label permanent="false" width="95" halign="right">
                    <caption>Release by:</caption>
                    <font>
                      <size>10</size>
                      <color>$8000AE</color>
                      <bold />
                    </font>
                  </label>
                  <spacer width="-10" />
                  <custom field="Release by">
                    <color>$D7FDDD</color>
                    <font>
                      <size>11</size>
                      <bold />
                      <color>$cc6600</color>
                    </font>Release by</custom>
                  <spacer width="6" />
                </column>
              </row>

2.)
Code: [Select]
    <row>
        <column space="10">
          <label width="75" halign="right">
            <caption>In Collection:</caption>
          </label>
          <spacer width="7" />
          <custom field="In Collection"></custom>
          <spacer width="50" />
        </column>
   </row>

3.)
Code: [Select]
<row>
        <column>
          <label>
            <caption>In Collection:</caption>
          </label>
          <spacer width="7" />
          <custom field="In Collection"></custom>
          <spacer width="5" />
        </column>
   </row>

4.)
Code: [Select]
<row>
                <column>
                  <label width="90" halign="right" valign="center">
                    <caption>Top 250:</caption>
                    <font>
                      <name>Arial Black</name>
                      <size>10</size>
                      <color>$CC33CC</color>
                    </font>
                  </label>
                  <spacer width="-7" />
                  <custom field="Top 250:">
                    <color>$D7FDDD</color>
                    <font>
                      <size>11</size>
                      <bold />
                    </font>
                  </custom>
                  <spacer width="50" />
                </column>
                <column>
                  <label width="55" halign="right" valign="top">
                    <caption>IMDbID:</caption>
                    <font>
                      <name>Arial Black</name>
                      <size>10</size>
                    </font>
                  </label>
                  <spacer width="-7" />
                  <custom field="IMDbID">
                    <color>$D7FDDD</color>
                    <font>
                      <size>11</size>
                      <color>$006600</color>
                      <bold />
                    </font>
                  </custom>
                  <spacer width="10" />
                </column>
                <column>
                  <label width="86" halign="right">
                    <caption>IMDB Votes:</caption>
                    <font>
                      <name>Arial Black</name>
                      <size>10</size>
                      <color>$CC33CC</color>
                    </font>
                  </label>
                  <spacer width="-7" />
                  <custom field="IMDB Votes">
                    <color>$D7FDDD</color>
                    <font>
                      <size>11</size>
                      <bold />
                    </font>
                  </custom>
                  <spacer width="26" />
                </column>
              </row>

5.)
Code: [Select]
<row>
                        <column space="0" autosize="true" halign="center" valign="top">
                          <label>
                            <caption>Sinopis - </caption>
                          </label>
                          <customfieldlabel field="FilmAffinity" />
                        </column>
                      </row>
                      <row>
                        <column space="0" autosize="true" halign="center" valign="top">
                          <spacer width="5" />
                          <custom field="FilmAffinity">
                            <color>$D0ECFE</color>
                          </custom>
                        </column>
                      </row>

katleeh, here I have the latest skin pvd_movie_tabs_normal extra AllMovie where you can see more examples of custom fields.

There is also Rick.ca Theater View Skin , where you can see more examples of custom fields.

« Last Edit: May 24, 2011, 12:11:25 pm by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #6 on: May 24, 2011, 09:15:47 pm »
Say I want to add custom fields in places other than the custom section, how would I do that?

The default skin has a special customsection in which all custom fields are listed, but their placement and appearance cannot be modified. My recommendation is to explicitly include all custom fields elsewhere in the skin (per Ivek's examples), and then delete customsection so it doesn't conflict.

Unless you already have something you're comfortable editing XML with, I recommend using XML Notepad. Much of the placement of items is determined by the correct nesting of the statements. XML Notepad makes it easy to copy, move and modify branches without messing that up.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2714
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #7 on: May 25, 2011, 06:06:56 am »
Quote
The internal (appearance) look and edit the skin using Notepad + + Portable (very handy program, get it here.)

But I also use this, it is also fine.

BTW:If it is not immediately on the first page, Search enroll in Notepad and running an search and it will certainly also be found.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline katleeh

  • User
  • ***
  • Posts: 55
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #8 on: May 26, 2011, 12:02:36 am »
Ivek23 and Rick.ca, thanks for the help. I'll see what I can come up with using what you've told me. Right now I'm working on a skin that's designed specifically for anime lists. I'll also try those programs you suggested for xml editing.

Speaking of xml editing, I came across some freeware for xml editing that allows you to specify how the wysiwyg layout is for the file. I don't remember what its called but I'll let you know when I check my notes. It might be useful for visual editing of skins.

- katleeh

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #9 on: May 26, 2011, 12:12:46 am »
Quote
Speaking of xml editing, I came across some freeware for xml editing that allows you to specify how the wysiwyg layout is for the file.

XML is just a format for storing data. It doesn't imply anything about the data layout in a particular application. I suppose an XML editor might recognize Word or Excel data and display the layout accordingly, but none of them have the PVD skin engine built into them. But you don't need that. If PVD can't "preview" your skin, nothing else will. ;)

Offline katleeh

  • User
  • ***
  • Posts: 55
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #10 on: May 26, 2011, 12:40:53 am »
Actually it was more the case of trying to find something like a web editor so that you could lay things out visually like a web editor. Does pvd allow you to make changes in the skin while its loaded? The last few times I've tried I had to exit out of pvd and reload it before I could load the new version of the skin.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: And Statements, Or Statements, etc...
« Reply #11 on: May 26, 2011, 07:27:17 am »
You'll find the Refresh skin command in both Preferences > Appearance > Toolbar and Hotkeys.