How to change the canonical link tag

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
10/12/2009 5:25:06 AM
Gravatar
Total Posts 2

How to change the canonical link tag

I don't like the www.example.com/home.aspx url which is displayed in Google instead of www.example.com due to the canonical <link> tag. How do I change this tag?

10/12/2009 2:04:17 PM
Gravatar
Total Posts 18439

Re: How to change the canonical link tag

Hi Michael,

I don't have a immediate solution for you but I will come up with something to solve this for the next release. Probably I will have to add a canonical url override in page settings. 

I will probably make a preview release available before the next official release and I will post again here when that is available to reduce your wait time.

Best,

Joe

10/13/2009 2:54:31 AM
Gravatar
Total Posts 2

Re: How to change the canonical link tag

Hi Joe,

Thanks for your quick response. I personally prefer to work without the canonical <link> tag rather than /home.aspx as the preferred version. If we would be able to change the tag tag would be great. I'll keep an eye on this topic for the preview release.

Thanks,
Michael

10/17/2009 9:47:18 AM
Gravatar
Total Posts 18439

Re: How to change the canonical link tag

Hi Michael,

I've put a up build for MS SQL, mojoportal-mssql-build-2009-10-17.zip on our Novell Forge download page. It has a new setting in Page settings under the SEO tab where you can override the canonical url.

Best,

Joe

10/19/2009 6:15:52 AM
Gravatar
Total Posts 5

Re: How to change the canonical link tag

On the same lines, how do I add custom new meta tags, for example dublin core meta tags, meta tags needed for site verification in google yahoo bing etc.

10/19/2009 10:06:19 AM
Gravatar
Total Posts 18439

Re: How to change the canonical link tag

Hi,

Support for Dublin Core is a long term (low priority at the moment) goal but it will require quite a bit of work to implement it in a user friendly way to validate the meta tags and vocabularies.

You could put verification meta tags in the layout.master file of your skin but I recommend using the alternate verification where you just put a file in the root of the web. To me this is better than adding junk meta data to the content.

Best,

Joe

10/19/2009 11:33:04 PM
Gravatar
Total Posts 5

Re: How to change the canonical link tag

Why would you want to 'validate' the meta tag contents (Be it dublin core meta data or other OWL/RDF metadata). Why not just provide a way to add/delete as many lines of meta tags as possible. The input boxes would only be like this:

meta name field: fill

meta content field: fill

10/20/2009 6:01:27 AM
Gravatar
Total Posts 18439

Re: How to change the canonical link tag

I'm speaking only in terms of ensuring the validity of the structure of the meta elements not the content of them. Allowing users to enter invalid markup can easily break a page.

10/20/2009 6:23:13 AM
Gravatar
Total Posts 5

Re: How to change the canonical link tag

But having meta name and meta content fields will not break the markup of the page. users will just fill in the parts X and Y. The generated code will look like this:

<meta name="X" content="Y"> You would just ensure there are no "< >" characters in the inputs for X and Y (to protect against invalid markup).

Or you could just provide a single huge textarea where people can enter custom markup that goes into the head section of the page.

example

<meta name="DC.Title" content="Mathematical Finance: Theory, Modeling, Implementation"/>

<link rel="SCHEMA.dc" href="http://purl.org/metadata/dublin_core_elements#title"/>

<meta name="DC.Creator" content="Christian Fries"/>

<link rel="SCHEMA.dc" href="http://purl.org/metadata/dublin_core_elements#creator"/>

<meta name="DC.Type" content="Interactive"/>

<link rel="SCHEMA.dc" href="http://purl.org/metadata/dublin_core_elements#type"/>

<meta name="DC.Format" scheme="IMT" content="text/html"/>

10/20/2009 6:32:02 AM
Gravatar
Total Posts 18439

Re: How to change the canonical link tag

The textarea approach is the dangerous one that would need to be validated or the page can be broken easily.

The safer approach of allowing key value pairs for meta or links requires more development effort. Ideally we would store those key value pairs in a related table for easy user management of them but then pre-compile the markup into a single field on the mp_Pages table so we don't have to make extra db hits to render the page. This is my plan, I actually already have the field on the mp_Pages table but have not yet built the related table(s) for managing the meta data. Actually it would be more than key value pairs since there is also scheme.

Best,

Joe

10/20/2009 7:05:35 AM
Gravatar
Total Posts 5

Re: How to change the canonical link tag

Regarding this:

"You could put verification meta tags in the layout.master file of your skin but I recommend using the alternate verification where you just put a file in the root of the web. To me this is better than adding junk meta data to the content."

I dont have ftp access to a site, i only have access to the mojo cms part of it. How do I upload the webmaster verification files using the Cms alone? There is a 'File Manager' option in the root. But there is no file visible named or called layout.master in it.

I also want to be able to add a custom meta tag of my own saying something like this:

<meta name="SEO-By" content="My name and email address">.

I would like this meta to appear in all the pages of the site.

10/20/2009 8:33:25 AM
Gravatar
Total Posts 18439

Re: How to change the canonical link tag

The skins used by the site are located at /Data/Sites/[SiteID]/skins and each skin is basically a sub folder beneath that. Typically [SiteID] is 1 for a single site installation.

Each skin has a layout.master file. You could download this file using the File Manager, edit it locally and then upload it.

So the path will be /Data/Sites/[SiteID]/skins/[skinname]/layout.master

[skinname] can be determined from Administration > Site Settings

be careful, if you put some malformed tag it can break the layout.master and in this case mojoPortal will fallback to a failsafe layout.master file and log an error.

Hope it helps,

Joe

10/21/2009 7:16:32 AM
Gravatar
Total Posts 5

Re: How to change the canonical link tag

Thanks I was able to alter/edit the layout.master file to add custom meta site verification and signature tags.

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