Removing/Changing the link from the SiteTitle

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.
1/6/2010 9:52:13 AM
Gravatar
Total Posts 8

Removing/Changing the link from the SiteTitle

Hello,

I am trying to remove/change the link on the SiteTitle.

In the markup I have <portal:SiteTitle id="SiteTitle1" runat="server"></portal:SiteTitle> - however, on the rendered page it is <h1 class='siteheading'><a class='siteheading' href='http://localhost/rick/Default.aspx'>Help Title</a></h1>

I need to remove the "Default.aspx".

This is my first post so go easy!

Thanks
Rick

1/6/2010 5:29:57 PM
Gravatar
Total Posts 5

Re: Removing/Changing the link from the SiteTitle

If you just want to change the link itself, you could set its OverrideUrl to whatever you want to link to. 

OR:

Well you could replace the SiteTitle control with a regular label control:

<asp:Label ID="MySiteTitle" runat="server" CssClass="siteheading"></asp:Label>

and then add the following code to the bottom of your page load event:

Label mySiteLabel = (Label)FindControl("MySiteTitle");
mySiteLabel.Text = siteSettings.SiteName;

 

John

1/7/2010 3:37:43 AM
Gravatar
Total Posts 8

Re: Removing/Changing the link from the SiteTitle

Thank you very much for your quick response John.

I've included the OverrideUrl property in the SiteTitle control, however it only seems to work in tandem with the OverrideTitle property. I don't want to hardcode the title of my site here as that would render a part of the CMS useless.

Unfortunately, I can't seem to locate the code-behind for my MasterPage as it seems to be pointing to CodeBehind="../../../../../App_MasterPages/layout.Master.cs" which doesn't appear to exist.

I have 4 websites using the same mojoportal setup but with different skins.

Thanks very much
Rick

1/7/2010 5:32:20 AM
Gravatar
Total Posts 18439

Re: Removing/Changing the link from the SiteTitle

Hi Rick,

Why do you want to change it from Default.aspx?

Are you using folder based multiple sites or host name based multiple sites?

Best,

Joe

1/7/2010 6:04:51 AM
Gravatar
Total Posts 8

Re: Removing/Changing the link from the SiteTitle

Hi Joe,

It's for SEO purposes ... I'm using host name based multiple sites. Even if I have to hardcode the web address onto the SiteTitle control that would suffice.

Many thanks for the hardwork Joe.

Rick

1/7/2010 6:14:07 AM
Gravatar
Total Posts 18439

Re: Removing/Changing the link from the SiteTitle

Hi Rick,

The best solution to the SEO issue is to override the canonical url on your home page. For example on this site the Home page is a page named "Home" and while it will also return the home page using the url /Default.aspx, mojoPortal by default uses the specific page url for the canonical url, so in my case it made the canonical url http://www.mojoportal.com/home.aspx. However, for SEO purposes I prefer my home page have a canonical url http://www.mojoportal.com/, so I specified this as the cannonical url override in Page Settings on the SEO tab. For pages other than the home page the page specific url is generally what you want for the cannonical, so this override setting was really added to solve the home page canonical issue.

By specifying the canonical url in the meta it doesn't matter if the link in SiteTitle has Default.aspx in it or not, google will treat the canonical url as the correct url.

Hope it helps,

Joe

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