Hi, as I am a newbie to umbraco i have the fallowing scenario: I have a website with 4 pages. (the website address is www.hotelopro.com, in case you want to see it)
If i am on features page I must add an extra css class to a link.
<div id="menu"> <table cellpadding="0" cellspacing="0"> <tbody> <tr> <td> <a !Here insert a class! href="/features-ro.aspx"> <umbraco:Item field="#Features" runat="server" /> </a> If current page selected is features then I must say: <a class="active_page" ....
however in the meaning time I created a web user controler which sets a Litteral to 'class="active_page"' case when the view name is the same as a parameter sent by me.
How to run a c# script in a template?
Hi, as I am a newbie to umbraco i have the fallowing scenario: I have a website with 4 pages. (the website address is www.hotelopro.com, in case you want to see it)
If i am on features page I must add an extra css class to a link.
Masterpage begins like this:
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"[]>
<!--[if IE 9 ]><html class="ie9" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html xmlns="http://www.w3.org/1999/xhtml">
<!--<![endif]-->
<head id="head" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
<umbraco:Item field="pageTitle" stripParagraph="true" runat="server" />
<umbraco:item id="Item2" runat="server" field="siteName" recursive="true">
</umbraco:item></asp:placeholder>
</title>
<umbraco:Item field="keywords" insertTextBefore="<meta name="keywords" content="" insertTextAfter="" />" runat="server">
</umbraco:Item>
and then i have the menu:
<div id="menu">
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<a !Here insert a class! href="/features-ro.aspx">
<umbraco:Item field="#Features" runat="server" />
</a>
If current page selected is features then I must say: <a class="active_page" ....
How can I do this?
Thanks.
I would create a Macro with your logic in either XSLT or Razor, whichever you prefer.
Rich
can you please provide me some examples or something? i haven't yet created any xslt. I see that xslt is only for output html code ...(which then i don't see the reason why should I use it) ( i read this: http://blog.percipientstudios.com/2009/4/11/anatomy-of-an-umbraco-xslt-file.aspx )
i have only used macros (usercontrollers made in c#)
thanks in advance...
however in the meaning time I created a web user controler which sets a Litteral to 'class="active_page"' case when the view name is the same as a parameter sent by me.
So problem solved.
thanks.
is working on a reply...