Adding custom links in layout.master

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/16/2008 9:11:51 AM
Gravatar
Total Posts 10

Adding custom links in layout.master

Hi,

Am trying to add some custom link using images from the layout.master page. But doesn't work out.

Here is what i did.

I created a class in stylelayout.css and styleimages.css of my skin folder named "whoweare"

I now code like this in layout.master:

<a href="whoweare.aspx"><div id="whoweare"></div></a>

I then got this error: <div> tag cannot be nested in  <a> tag

How do i go about it. Please help out.

Thanks

7/17/2008 11:05:29 AM
Gravatar
Total Posts 18439

Re: Adding custom links in layout.master

The error message is very clear, its not valid in html to put a div inside an anchor, you can put an img element there instead to show an image.

Html has a lot of rules, especially xhtml. The first step is to understand what the correct xhtml output should be. There are quite a few good html reference books out there as well as many online resources to learn how to structure html. In a way ASP.NET is bad because it makes people think they can be web developers without any knowledge of html, because in many ways ASP.NET shields you from having to know html because it produces the html for you. ASP.NET is just a tool for producing html, it will generally produce correct html markup but it is still possible to produce incorrect markup especially when you are entering html fragments directly in a page or master page. Its trying to help you by throwing this error and telling you your html markup is incorrect.

Hope it helps,

Joe

7/17/2008 12:06:22 PM
Gravatar
Total Posts 10

Re: Adding custom links in layout.master

Hi,

Thanks for the reply.

I earlier tried this in the layout.master of my skin

 <a href="#"><img src="products_services2_button.jpg" alt="" /></a>

 but the image didn't show, neither is the link as well.

 Am aware that it works in asp.net and dreamweaver, but is not working in layout.master of mojo.

 Please help

7/17/2008 12:12:29 PM
Gravatar
Total Posts 18439

Re: Adding custom links in layout.master

Hi,

Read the part of this article about url rebasing in master pages:

http://www.odetocode.com/Articles/419.aspx

Hope it helps,

Joe

7/18/2008 11:33:25 AM
Gravatar
Total Posts 10

Re: Adding custom links in layout.master

 Great!

 Thanks for your help.

 Am voting mojo 4 cms 2008 award

You must sign in to post in the forums. This thread is closed to new posts.