I am trying to allow, via the admin section, the ability to change the background colours of a table.
The problems I am having is as follows;
- I have 4 of these sections on a dynamic template page
- not all the sections are used each time the template is called
- I want to either make the colours default to a specific colour if used or if not used, then to display a set colour
I see 2 ways for this to happen;
1 - if statements for the colours
- or -
2 - SQL statement to disallow the table to be shown unless content is posted in the database
I am new to SQL and 'if' statements.
I am using dreamweaver MX 2004 with access 2000.
This is the code want to be able to hide, I have 4 of these section on a page.
Code:
Code:
<table width="150" border="0" cellpadding="1" cellspacing="0" bgcolor="#<%=(rs_pages.Fields.Item("S_SideHeading4_ColourBG").Value)%>">
<tr>
<td>
<table width="150" border="0" cellspacing="0" cellpadding="4">
<tr>
<td align="center" bgcolor="#<%=(rs_pages.Fields.Item("S_SideHeading4_ColourBG").Value)%>"><strong><%=(rs_pages.Fields.Item("S_SideHeading4").Value)%></strong></td>
</tr>
<tr>
<td bgcolor="#<%=(rs_pages.Fields.Item("S_SideContent4_ColourBG").Value)%>">
<%Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
objFile = Request.ServerVariables("SCRIPT_NAME")
ImagePath = Server.MapPath("../site_images\")
ImagePath = ImagePath & "\" & (rs_pages.Fields.Item("S_SideImage4").Value)
If objFileSystem.FileExists(ImagePath) then%>
<img src="../site_images/<%=(rs_pages.Fields.Item("S_SideImage4").Value)%>" alt="ADC KRONE" border="0" align="right" /><%=(rs_pages.Fields.Item("S_SideHeading4").Value)%>
<%End If%>
<%= CI_Preserve((rs_pages.Fields.Item("S_SideContent4").Value)) %>
</td>
</tr>
</table>
</td>
</tr>
</table>
The speed of light is faster than the speed of sound. Thats why some people look good before they speak.