Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Changing the Page Meta Tags from a moduleChanging the Page Meta Tags from a module
Previous
 
Next
New Post
6/9/2006 3:50 PM
 

Here is what I have got.  I've been building a new web site for a online retailer, I'm using DotNetNuke and I've built a product catalog module.  I've got the project almost done and now I've found out that the customer now wants to set the page TItle and Meta Tags differently for each product displayed.

Therefore what I need to do is change the page Title, Keyword, and Description settings dynamicly in the module code.  Anyone have any idea how to do this?  Can it be done?

Thanks,
Daniel Clausen

 
New Post
2/4/2007 7:36 AM
 
Yes, you can change it.
Try the following from your DNN module's (VB) code:
CType(Page, DotNetNuke.Framework.CDefault).Title = "Your title"
CType(Page, DotNetNuke.Framework.CDefault).KeyWords = "Your keywords"
CType(Page, DotNetNuke.Framework.CDefault).Description = "Your description"

It doesn't work when you add multiple modules to a page with similar codes, because only the last module's changes will appear on the page. (But you can concatenate more text like this: CType(Page, DotNetNuke.Framework.CDefault).Title = CType(Page, DotNetNuke.Framework.CDefault).Title + " - Your title")

Peter Jenei
 
New Post
2/4/2007 10:23 AM
 

the page title can be changed - but not sure about the others

Me

.Page.Title = ""

Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
3/6/2009 10:21 AM
 

Anyone who get this working?
I need to change the META-keywords and META-description because of two reasons:

  • I'm working in multiple languages
  • I'm working with a dynamic page and the META-keywords and META-description needs to change when a user views another product.
protected void Page_PreRender( object sender, EventArgs e ) {
            Localization locale = new Localization();
            CantiMetaInfo objCantiInfo = objCantiMetas.GetCantiMeta(
                this.ModuleId,
                Localization.GetLocale( locale.CurrentCulture ).LanguageID
                );

            (( CDefault )this.Page).Title = "This page's new title";
            (( CDefault )this.Page).Description = "some description...";
            (( CDefault )this.Page).KeyWords = "some keywords";
        }

I used this code in my module (View) but it doesn't work...

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Changing the Page Meta Tags from a moduleChanging the Page Meta Tags from a module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out