Mailing List Archive

template tag syntax
In video-ui.xml, I'd like to display the title and subtitle in the
same field, separated by a colon. If there is no subtitle, I don't
want to the colon to appear. (Unfortunately it doesn't appear that
video-ui.xml supports the titlesubtitle element like recordings-ui.xml
does. If that were available, I think it would work for me.)

I started off with a simple:

<template>%TITLE%: %SUBTITLE%</template>

That of course always displays the colon whether there is a subtitle
or not. The wiki doesn't describe any more advanced syntax, so I
thought I wouldn't be able to do what I wanted until I found these
threads that discuss the vertical bar syntax:

http://www.gossamer-threads.com/lists/mythtv/theming/453231
http://www.gossamer-threads.com/lists/mythtv/theming/453448

That looked promising. Even though I'm not entirely sure I understand
how it's supposed to work, based on the examples in those threads and
in other themes, it seems like this should work for me:

<template>%TITLE%%: |SUBTITLE|%</template>

However, what I get is something like this:

My Video Title%: |SUBTITLE|%

whether the video has a subtitle or not. What am I doing wrong?

Output of mythfrontend --version:

MythTV Version : v0.24-249-g4fe108c
MythTV Branch : fixes/0.24
Network Protocol : 63
Library API : 0.24.20101129-1
QT Version : 4.7.0
Options compiled in:
linux debug using_alsa using_oss using_pulse using_pulseoutput using_backend u\
sing_bindings_perl using_bindings_python using_dvb using_firewire using_fronten\
d using_hdhomerun using_hdpvr using_iptv using_ivtv using_joystick_menu using_l\
irc using_mheg using_opengl_video using_opengl_vsync using_qtdbus using_qtwebki\
t using_v4l using_v4l2 using_x11 using_xrandr using_xv using_bindings_perl usin\
g_bindings_python using_mythtranscode using_opengl using_vdpau using_ffmpeg_thr\
eads using_live using_mheg

_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://www.mythtv.org/mailman/listinfo/mythtv-theming
Re: template tag syntax [ In reply to ]
On Wed, Aug 31, 2011 at 8:35 PM, Joey Morris <rjmorris@nc.rr.com> wrote:
> <template>%TITLE%%: |SUBTITLE|%</template>

Your mistake is the extra unnecessary pipe, the last one.

| means "everything between this pipe and the percentage sign, but
only if this thing exists." It can work in either direction. So, to
do what you want (where the colon and space only appears if the
subtitle exists):

%TITLE%%: |SUBTITLE%

Or how about this, as an example in the opposite direction:

%DIRECTOR| was the director.%

So, in summary

%Some Stuff|

or

|Some other Stuff%

But never

%|

or

|%

Make sense?

Robert
_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://www.mythtv.org/mailman/listinfo/mythtv-theming
Re: template tag syntax [ In reply to ]
Robert McNamara <robert.mcnamara@gmail.com> wrote on Wed, Aug 31, 2011 at 08:54:24PM -0700:
> On Wed, Aug 31, 2011 at 8:35 PM, Joey Morris <rjmorris@nc.rr.com> wrote:
> > <template>%TITLE%%: |SUBTITLE|%</template>
>
> Your mistake is the extra unnecessary pipe, the last one.
>
> | means "everything between this pipe and the percentage sign, but
> only if this thing exists." It can work in either direction. So, to
> do what you want (where the colon and space only appears if the
> subtitle exists):
>
> %TITLE%%: |SUBTITLE%

Thanks! That works perfectly.
_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://www.mythtv.org/mailman/listinfo/mythtv-theming