Hi,
Hope someone can help me find a solution to this problem.
I use Umbraco version 4.5.2
I have a main menu where I want each menu item to have its own color.
I have created two fields in a document type, where you can specify two colors.
My structure looks like.
front Page
- Item 1
- Item 2
- Item 3
- Item 4
All these menu items are made of a special document type named Top Menu.
My problem is currently that if I put a color on the menu item 1 gets all menpunterne the same color is not different colors. Ert second problem is that the color does not come on the front page, because color is put on Top Menu document type.
I have a small starting point and hope that someone can guide me in the right direction.
<xsl:template match="/">
<xsl:variable name="themeColor" select="$currentPage/themeColor" />
<xsl:variable name="gradientColor" select="$currentPage/gradientColor" />
a.mainMenu{
border: 1px solid <xsl:value-of select='$themeColor' />;
background-image: -webkit-gradient(linear, left top, left bottom, from(<xsl:value-of select='$gradientColor' />), to(<xsl:value-of select='$themeColor' />)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, <xsl:value-of select='$gradientColor' />, <xsl:value-of select='$themeColor' />); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient(top, <xsl:value-of select='$gradientColor' />, <xsl:value-of select='$themeColor' />); /* FF3.6 */
background-image: -ms-linear-gradient(top, <xsl:value-of select='$gradientColor' />, <xsl:value-of select='$themeColor' />); /* IE10 */
background-image: -o-linear-gradient(top, <xsl:value-of select='$gradientColor' />, <xsl:value-of select='$themeColor' />); /* Opera 11.10+ */
background-image: linear-gradient(top, <xsl:value-of select='$gradientColor' />, <xsl:value-of select='$themeColor' />);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='<xsl:value-of select='$gradientColor' />', EndColorStr='<xsl:value-of select='$themeColor' />'); /* IE6–IE9 */
}
</xsl:template>
The macro is inserted on the main.master in a style tag inside the head tag
/Dennis
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/23775-different-colored-menu-items