I want tables in two styles; 'table.current' and 'table.outdated' so I can list future lecture on one page and previous lectures on another. I have used extra page attribute 'extra1' on the two content pages: 'current' in one, 'outdated' in the other.
In 'main style' stylesheet I have designed two styles with different fonts, colours, background-colours. These work in isolation. E.g.:-
Code: Select all
table.current {
color: #000066;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1.5vw;
width: 100%; }
table.current, table.current td, table.current th {border:2px solid #000099;
border-collapse: collapse;
padding: 8px;}
table.current tr:nth-child(even){background-color: #ebd6ad;}
table.current tr:nth-child(odd){background-color: #d6ebe0;}
table.current tr:hover {background-color: pink;}
In template 'main template' I have:
Code: Select all
{$p_attr={page_attr key='extra1'}}
{if $p_attr=="outdated"}
<table class="outdated">
{/if}
{if $p_attr=="current"}
<table class="current">
{/if}
<p>(The content of the Extra 1 field is: {page_attr key='extra1'})</p>
Code: Select all
<table class="{page_attr key='extra1'}">