Where to save meta keywords and description?

Topics: Administration, General
Sep 30, 2011 at 3:15 PM

Where in admin panel I can save meta keywords and description for my website?

Coordinator
Sep 30, 2011 at 6:18 PM

You can use the Meta feature from the Vandelay Industries module.

Sep 30, 2011 at 7:16 PM
Edited Sep 30, 2011 at 7:21 PM

Thank You

Just for curiosity, if I don't want to install any additional module, is there any inbuilt or default place or location where I can define meta keywords and description ?

Coordinator
Sep 30, 2011 at 7:21 PM

No. Well, you could override document.cshtml and hard-code it in there but tht would be kind of dirty.

Sep 30, 2011 at 7:37 PM

thanks

Developer
Oct 14, 2011 at 9:17 AM

I am using the Vandelay Industries module for rendering meta keywords & description.
I have found that when I include a Container widget on a page where each item is a Content Item that also have the Meta parts, the last rendered content item "wins" and sets the meta description.

However, that is not the desired behavior. Instead, the meta keywords & description of the content item that is currently in Detail mode should be rendered.
I am not sure that this is an issue with your module or that it is an issue within Orchard itself, as the same issue applies to the Title.

What I think should happen is that only when a content item with DisplayType = "Detail" is being rendered, it should set the Meta keywords & description.
One other approach might be that both keywords & description are concatenated. Or perhaps that should be configurable.

 

Coordinator
Oct 15, 2011 at 6:46 AM

Ooooh, I see. Please file a bug on Vandelay for this.

Developer
Oct 15, 2011 at 9:37 AM
Edited Oct 15, 2011 at 2:55 PM

http://vandelay.codeplex.com/workitem/7

The bug report also contains a link demonstrating the issue online.

Oct 15, 2011 at 2:46 PM
bertrandleroy wrote:

No. Well, you could override document.cshtml and hard-code it in there but tht would be kind of dirty.

how to override it ? could you please specify the location of this document.cshtml ?

Is this the master page ?

 

Can't we specify meta keywords and description in the master page ? in <head> tag ?

Developer
Oct 15, 2011 at 2:54 PM

@codeplex_user you can override Document.cshtml by copying it from /Core/Shapes/Views/Document.cshtml and pasting it into the Views folder of your own theme.

Document.cshtml can indeed be viewed as the master page (Layout.cshtml will can be viewed as the nested master page)

Developer
Oct 15, 2011 at 3:04 PM
codeplex_user wrote:

Can't we specify meta keywords and description in the master page ? in <head> tag ?

You could do so easily by modifying the copied Document.cshtml. Make sure that you are not using Vandelay Meta then, as it would cause duplicate <meta name="keyword" /> entries.

Oct 16, 2011 at 12:24 PM
Edited Oct 16, 2011 at 12:30 PM

I copied the document.chtml file and pasted in the "view" folder of my theme.

Now I see document.chtml file includes this code too plus I keep getting error in visual studio that could not find HTML5.JS ?

 

@{
    RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico")});
    Script.Include("html5.js").AtHead();

    string title = Convert.ToString(Model.Title);
    string siteName = Convert.ToString(WorkContext.CurrentSite.SiteName);
}

 

what about the html5.file and orchard.ico ? The document.chtml file will also look for both things and won't find it because it doesn't exist here.

Should I copy / paste both files too ? if yes. please specify what exactly to copy/paste..just the file or complete folder along with the specified location above ?

Coordinator
Oct 16, 2011 at 5:22 PM

Dear codeplex_user,

You say "The document.chtml file will also look for both things and won't find it because it doesn't exist here."

Then "If yes. please specify what exactly to copy/paste"

Well you answer to yourself, it's pure common sense, if some file will get missing, then the files to copy to prevent them missing are the missing files. Isn't it 100% logical ?

However, if you really read what the filenames are, you'll see they contain the path where they are located, even though they are specified from another directory. And by the way if you did it, you must have opened a browser on this page, and seen in the dev tools that thoses files where actually requested.

Copying this Document.cshtml file makes sense if you want to modify it. If you don't understand how it works and how to modify it, you should maybe read some tutorials on asp.net, razor, and MVC before jumping into Orchard.

Sebastien

Oct 17, 2011 at 1:59 PM

Thank you Sebastien for being so polite and gentle...

I am a newbie in ASP.NET MVC..so I am working on Orchard and side by side I am trying to learn MVC..

I think Orchard is a great application which will help me in learning MVC.