Currently I am implementing an existing layout already implemented in MVC4 project.
I am struggling with how to implement a custom menu in the latest Orchard (using the source version so Orchard runs in Visual Studio).
The problem is where does the CSS get applied? The only thing I could find with google was changing the Menu.cshtml (one in core/shapes one in admin theme, clueless which one is the proper one). I cannot see any sign of css anywhere.
The html version of my menu has the following look:
<div id="cssmenu" class="fixedContentSize">
<ul>
<li class='active '><a href='index.html'><span>Home</span></a></li>
<li class='has-sub '><a href='#'><span>Dojo</span></a>
<ul>
<li class='has-sub '><a href='#'><span>Test</span></a>
<ul>
<li><a href='#'><span>Sub Item</span></a></li>
<li><a href='#'><span>Sub Item</span></a></li>
</ul>
</li>
<li class='has-sub '><a href='#'><span>Test2</span></a>
<ul>
<li><a href='#'><span>Sub Item</span></a></li>
<li><a href='#'><span>Sub Item</span></a></li>
</ul>
</li>
</ul>
</li>
<li><a href='#'><span>Media</span></a></li>
<li><a href='#'><span>Links</span></a></li>
<li><a href='#'><span>About</span></a></li>
<li><a href='#'><span>Contact</span></a></li>
</ul>
</div>
It gets applied in the theme's CSS. Look at site.css in the theme machine theme for an example.
Related
I need to click on tab "Pis/Cofins" in my application
<ul class="nav nav-tabs" id="tabs">
<li class="">
Dados Gerais
</li>
<li class="active">
Pis/Cofins
</li>
<li>
Combustíveis
</li>
<li>
Modo de Servir
</li>
<li>
Imagens
</li>
<li>
Informações
</li>
</ul>
You may simply use the following xpath:
//a[text()='Pis/Cofins']
You may use extension like Firebug in firefox to easily find locators and use them in your test scripts
As per the HTML you have shared to click on tab with text as Pis/Cofins you can use either of the following solutions:
LinkText:
driver.FindElement(By.LinkText("Pis/Cofins")).Click();
CssSelector:
driver.FindElement(By.CssSelector("ul.nav.nav-tabs#tabs a[href$='pisCofins']")).Click();
XPath:
driver.FindElement(By.XPath("//a[contains(#href,'pisCofins') and contains(.,'Pis/Cofins')]")).Click();
I am using bootstrap tabs. There are 6 tabs and the 1st tab is active on page load.
<ul class="nav">
<li class="nav-link active"><a data-toggle="tab" href="#menu1">People</a></li>
<li><a data-toggle="tab" href="#menu2">Current Performance</a></li>
<li><a data-toggle="tab" href="#menu3">Tools</a></li>
<li><a data-toggle="tab" href="#menu4">Collaboration Enablers</a></li>
<li><a data-toggle="tab" href="#menu5">Infrastructure</a></li>
<li><a data-toggle="tab" href="#menu6">Practices</a></li>
</ul>
Now i have a grid-view for with some labels, radio buttons and Next and previous buttons.
So i want the active tab to change every time i click next button. How to do that?
Initially PEOPLE tab is active. On next click CURRENT PERFORMANCE should be active.
I have just created a link to route in Site.Master but it have created a weird error
For example, when it was clicked, instead of http://localhost/Admin/ManageType it became http://localhost/~/Admin/ManageType.
I have tried to solve it myself by removing ~/ and it works but it come with a flaw. Once click it work and bring you to the page but when click again, it become http://localhost/Admin/Admin/ManageType instead of http://localhost/~/Admin/ManageType.
<ul class="nav navbar-nav">
<li><a runat="server" href="~/">Home</a></li>
<li><a runat="server" href="~/About">About</a></li>
<li class="dropdown">
Manage <b class="caret"></b>
<ul class="dropdown-menu">
<li>Recipe</li>
<li class="divider"></li>
<li>Type</li>
</ul>
</li>
<li><a runat="server" href="~/Recipe/Recipe">Recipe</a></li>
</ul>
Use Control.ResolveUrl method instead.
And you need to change:
<li>Recipe</li>
To:
<li><a href="<%= Page.ResolveUrl("~/Admin/ManageType") %>" title="ManageType" >ManageType</a></li>
Try this:
<li>Type</li>
Didn't work dropdownlist Risk Content in master page after change page to the setting page. The dropdown just work after go back to home page again
MasterPage.master
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav custom_nav">
<li class="">Home
</li>
<li class="dropdown">Risk Context
<ul class="dropdown-menu" role="menu">
<li>Objective (KPI)
</li>
<li>Risk Limit & Expected Residual Risk
</li>
<li>Impact Scale Tables
</li>
<li>Probability Scale Tables
</li>
</ul>
</li>
<li>Settings
</li>
<ul>
</div>
What I miss from my code?? help me. thank before..
I don't know how to apply CSS for a HTML generic control like <UL> and <LI> given runat="server" in ASP.NET. I am finding the <li> in a master page from a content page. Once I found that control I want to apply CSS.
<ul id="mainMenu" runat="server" style="width:350px;">
<li id="mainHome" runat="server"><a title="Home" href="#" class="home">Home</a></li>
<li id="mainManage" runat="server"><a title="Manage" href="#"
class="manage">Manage</a></li>
<li id="mainEnquiry" runat="server"><a title="Enquiry" href="#"
class="enquiry">Enquiry</a></li>
<li id="mainReport" runat="server"><a title="Report" href="#"
class="report">Reports</a></li>
</ul>
Please try this,
ull.Style.Add("background-color", "Red");
Or, I have tested this, will definitely work, please check
ull.Attributes.Add("class", "yourClass");
Edit:
To test this solution I have provided you:
make new blank master page and put <ul runat="server" id="ull">
then add a new page and use the above master page.
make findcontrol ul and put in CSS as I have mentioned in the answer.
then run your page, and view source of your HTML page and you will find what you are looking for. Like