How to change the header?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I want in a header between currencies and the unit of links to insert a phone number. Or there to move the unit of search. But I can't understand as to make it.
So far only it turns out to insert the text over the unit of links:)
6 years ago
trofimovda wrote:
I want in a header between currencies and the unit of links to insert a phone number. Or there to move the unit of search. But I can't understand as to make it.
So far only it turns out to insert the text over the unit of links:)


I assume you want to display something like below image.



Here is the way to add same as screen:

Goto Presentation > Nop.Web > Views > Shared > Header.cshtml

Add style:

<style type="text/css">
    .header-phone {
        width: auto;
        min-width: 100px;
        margin: 0 12px 0 0;
        line-height: 43px;
        float: left;
    }

    .header-phone .PhoneNumber {
        height: 25px;
        padding: 4px;
        font-size: 12px;
    }
</style>


Add your div after header-selectors-wrapper.


<div class="header-phone">
  @Html.Label("phonenumber", "Call us on: +1-541-754-3010", new { @class = "PhoneNumber"})      
</div>


PS: I've given quick example, please follow best practices.
6 years ago
Thank you very much! Everything is great!
6 years ago
If I do so:

<div class="header-phone">
  @Html.Label("phonenumber", "<a href="tel:+1234567890"> TEXT </a>", new { @class = "PhoneNumber"})      
</div>

that I receive an error
6 years ago
trofimovda wrote:
If I do so:

<div class="header-phone">
  @Html.Label("phonenumber", "<a href="tel:+1234567890"> TEXT </a>", new { @class = "PhoneNumber"})      
</div>

that I receive an error


Yes, it's razor!
You cannot add anchor tag inside label directly, you can use ActionLink either,


<div class="header-phone">
    @Html.ActionLink("Call us on: +1-541-754-3010", "action", "controller", null)
</div>
  

Or use simple HTML label.

<div class="header-phone">            
      <label class="PhoneNumber"><a href="~/contactus">Call us on: +1-541-754-3010 </a></label>      
</div>


Again, I've given simple fix, you could follow best practices to use resource string and routing!

Hope this helps you!
6 years ago
Thanks for detailed responses! Everything works perfectly!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.