Due to enormous amounts of spam, the forum has been set to read-only mode.



Reply to topic  [ 5 posts ] 
Add new values to a field in CATVids 
Author Message

Joined: Tue Nov 21, 2006 9:03 pm
Posts: 17
Post Add new values to a field in CATVids

Hello
In CATVids, how can I
- add other pre-defined values to the "Video Standard" field (ex: "MPG", "MP4"... in addition to the existing "NTSC", "PAL", "SECAM" values).
- make the "Video Standard" field appear in the "Video preview" pane, under the "Format" field.
Many Thanks!


Mon Apr 30, 2012 7:10 am
Profile
User avatar

Joined: Fri Nov 14, 2003 6:15 pm
Posts: 1425
Post Re: Add new values to a field in CATVids

jcgalland wrote:
In CATVids, how can I
- add other pre-defined values to the "Video Standard" field (ex: "MPG", "MP4"... in addition to the existing "NTSC", "PAL", "SECAM" values).

From the menu View> Lookup View. Then click on the pulldown arrow and choose Video Standard. Here you can add additional video standards.

Attachment:
topic64499.png

jcgalland wrote:
- make the "Video Standard" field appear in the "Video preview" pane, under the "Format" field.

Add this code to VideoBrowse.xsl immediately after the code for the Format field (which is immediately before the code for Type field that begins with the line "<!-- Type -->").
Code:
          <!-- Video Standard -->
          <xsl:if test="videostandard!=''">
          <TR CLASS="fieldrowprevpane">
            <TD CLASS="fieldnameprevpane" NOWRAP="">
              <xsl:value-of select="/data/fld/video/videostandard/@name"/>
            </TD>
            <TD CLASS="fieldvalueprevpane" WIDTH="100%">
              <A HREF="VideoList.xsl?videostandard={videostandard}@xslparam:doctitle=Video Standard: {videostandard}" TARGET="_BLANK">
                <xsl:value-of select="videostandard"/>
              </A>
            </TD>
          </TR>
          </xsl:if>


You do not have the required permissions to view the files attached to this post.

_________________
Cheers,
Dave


Mon Apr 30, 2012 7:57 am
Profile WWW

Joined: Tue Nov 21, 2006 9:03 pm
Posts: 17
Post Re: Add new values to a field in CATVids

Fantastic thanks!
One last question: I have associated some entries with video files on my hard drive.
Now, I can see a TV icon on the first field of the preview pane which will start the video when clicked on.
Is there any way I can also have a folder icon which will open the directory where the video file is located (or a link, if the icon is hard to create)?
Thanks again


Mon Apr 30, 2012 11:01 am
Profile
User avatar

Joined: Fri Nov 14, 2003 6:15 pm
Posts: 1425
Post Re: Add new values to a field in CATVids

jcgalland wrote:
Fantastic thanks!
One last question: I have associated some entries with video files on my hard drive.
Now, I can see a TV icon on the first field of the preview pane which will start the video when clicked on.
Is there any way I can also have a folder icon which will open the directory where the video file is located (or a link, if the icon is hard to create)?
Thanks again

Open Common.xsl and replace the format-videosample template code with this:
Code:
<xsl:template name="format-videosample">
  <xsl:param name="videosample"/>
  <xsl:param name="contentsid"/>
  <xsl:variable name="videofolder">
    <xsl:call-template name="substring-before-last">
      <xsl:with-param name="input" select="$videosample/filename"/>
      <xsl:with-param name="substr" select="'\'"/>
    </xsl:call-template>
  </xsl:variable> 
  <xsl:if test="$videosample/type>0">
    <xsl:text> </xsl:text>
    <A HREF="PLAYVIDEO:{$contentsid}"><IMG SRC="PlayVideo.gif" BORDER="0"/></A>
    <xsl:text> </xsl:text>
    <A HREF="CMD:GOTOFOLDER:{$videofolder}"><IMG SRC="folder.gif" BORDER="0"/></A>
  </xsl:if>
</xsl:template>


Also in Common.xsl add this code immediately above the last line in the file, which is </xsl:stylesheet>.
Code:
<xsl:template name="substring-before-last">   
  <xsl:param name="input"/>
  <xsl:param name="substr"/> 
  <xsl:variable name="mid" select="ceiling(string-length($input) div 2)"/>
  <xsl:variable name="temp1" select="substring($input,1, $mid)"/>
  <xsl:variable name="temp2" select="substring($input,$mid +1)"/>
  <xsl:choose>
    <xsl:when test="$temp2 and contains($temp2,$substr)">
      <xsl:value-of select="$temp1"/>
      <xsl:call-template name="substring-before-last">
        <xsl:with-param name="input" select="$temp2"/>
        <xsl:with-param name="substr" select="$substr"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains(substring($input,$mid - string-length($substr) +1),$substr)">
      <xsl:value-of select="substring($input,1, $mid - string-length($substr))"/>
    </xsl:when>
    <xsl:when test="contains($temp1,$substr)">
      <xsl:call-template name="substring-before-last">
      <xsl:with-param name="input" select="$temp1"/>
      <xsl:with-param name="substr" select="$substr"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise/>
  </xsl:choose>
</xsl:template>

_________________
Cheers,
Dave


Mon Apr 30, 2012 2:42 pm
Profile WWW

Joined: Tue Nov 21, 2006 9:03 pm
Posts: 17
Post Re: Add new values to a field in CATVids

Absolutely brilliant! :wink: :wink: :wink:
Many thanks for your help!


Mon Apr 30, 2012 5:31 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.