Microsoft Content Management Server - HowTo generate META tags from custom properties

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > January 2005 > HowTo generate META tags from custom properties





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author HowTo generate META tags from custom properties
Robert

2004-02-04, 10:48 am

MCMS 2002:

I have created two custom properties on a template:
Keywords and Description.

How do I get these custom properties to be generated as
META tags in the <HEAD> section using the code behind
window with VB?
Stefan [MSFT]

2004-02-04, 10:48 am

Hi Robert,

a code sample is included in the CMS 2002 documentation:

/Developing Your MCMS Site
/Coding with the Publishing API
/Coding in Template Files
/Programmatically Creating Meta Data from Custom Properties

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Robert" <anonymous@discussions.microsoft.com> wrote in message
news:726301c3e74a$30ea1830$a001280a@phx.gbl...
quote:

> MCMS 2002:
>
> I have created two custom properties on a template:
> Keywords and Description.
>
> How do I get these custom properties to be generated as
> META tags in the <HEAD> section using the code behind
> window with VB?




Alan Taylor

2004-02-04, 10:48 am

Hi,

I'm using a an XmlPlaceholder to store my metadata; I'm not using the
suggested method of a Custom Property. Is there really a difference
between using one or the other?

I'm not keen on using the Literal server control, as my Placeholder
generates the metadata string I want to put into the header, i.e.
<meta name=n1 content=c1 /><meta name=n2 content=c2 /><....>


On Fri, 30 Jan 2004 17:20:38 +0100, "Stefan [MSFT]"
<stefang@online.microsoft.com> wrote:
quote:

>Hi Robert,
>
>a code sample is included in the CMS 2002 documentation:
>
>/Developing Your MCMS Site
> /Coding with the Publishing API
> /Coding in Template Files
> /Programmatically Creating Meta Data from Custom Properties
>
>Cheers,
>Stefan.



Stefan [MSFT]

2004-02-04, 10:48 am

Hi Alan,

I think you would have to create a user control that reads the content of
the XmlPlaceholder and renders the relevant Metatag.
The code in the user control would need to look as follows:


protected override void Render( HtmlTextWriter writer)
{
XmlPlaceholder xmlPh =
(XmlPlaceholder)CmsHttpContext.Current.Posting.Placeholders["XmlPhName"];
for (...)
{
writer.Write("<meta ...>");
}
}


Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Alan Taylor" <alan_taylor@nospam.uk.ibm.com> wrote in message
news:c52l10d083kposnrukbfu16t4p64eu6o9o@
4ax.com...
quote:

> Hi,
>
> I'm using a an XmlPlaceholder to store my metadata; I'm not using the
> suggested method of a Custom Property. Is there really a difference
> between using one or the other?
>
> I'm not keen on using the Literal server control, as my Placeholder
> generates the metadata string I want to put into the header, i.e.
> <meta name=n1 content=c1 /><meta name=n2 content=c2 /><....>
>
>
> On Fri, 30 Jan 2004 17:20:38 +0100, "Stefan [MSFT]"
> <stefang@online.microsoft.com> wrote:
>
>




Alan Taylor

2004-02-04, 10:48 am

Thanks.

This is similar to what I've done. I've had to put it into a seperate
placeholder, as the meta edit placeholder that renders html controls
based on an XML files, doesn't work if I use your suggested method.

Is there any particular reason why I shouldn't use placeholder content
to store my meta string, as opposed to using a custom property?


On Fri, 30 Jan 2004 18:00:32 +0100, "Stefan [MSFT]"
<stefang@online.microsoft.com> wrote:
quote:

>Hi Alan,
>
>I think you would have to create a user control that reads the content of
>the XmlPlaceholder and renders the relevant Metatag.
>The code in the user control would need to look as follows:
>
>
> protected override void Render( HtmlTextWriter writer)
> {
> XmlPlaceholder xmlPh =
>(XmlPlaceholder)CmsHttpContext.Current.Posting.Placeholders["XmlPhName"];
> for (...)
> {
> writer.Write("<meta ...>");
> }
> }
>
>
>Cheers,
>Stefan.



Stefan [MSFT]

2004-02-04, 10:48 am

Hi Alan,

no there is no specific reason.
You could use both.
Using custom properties might be easier as the developer can define the tags
dynamically using VS.NET without recompiling the solution.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Alan Taylor" <alan_taylor@nospam.uk.ibm.com> wrote in message
news:qh3l1052mj3pdikcin4lmrr5irpa42qno1@
4ax.com...
quote:

> Thanks.
>
> This is similar to what I've done. I've had to put it into a seperate
> placeholder, as the meta edit placeholder that renders html controls
> based on an XML files, doesn't work if I use your suggested method.
>
> Is there any particular reason why I shouldn't use placeholder content
> to store my meta string, as opposed to using a custom property?
>
>
> On Fri, 30 Jan 2004 18:00:32 +0100, "Stefan [MSFT]"
> <stefang@online.microsoft.com> wrote:
>
>




Robert

2004-02-04, 10:48 am

Perfect. Thanks.
quote:

>-----Original Message-----
>Hi Robert,
>
>a code sample is included in the CMS 2002 documentation:
>
>/Developing Your MCMS Site
> /Coding with the Publishing API
> /Coding in Template Files
> /Programmatically Creating Meta Data from


Custom Properties
quote:

>
>Cheers,
>Stefan.
>
>--
>This posting is provided "AS IS" with no warranties, and


confers no rights.
quote:

>
>
>"Robert" <anonymous@discussions.microsoft.com> wrote in


message
quote:

>news:726301c3e74a$30ea1830$a001280a@phx.gbl...
>
>
>.
>


ryanpurvis

2005-01-04, 1:56 am

quote:
Originally posted by Robert
Perfect. Thanks.

Custom Properties
confers no rights.
message




Hi

I'm doing the same thing and everything works, BUT only when the screen is fully sized - fits the screen as the screen gets smaller you cannot get focus on the text box - if you double click on it the the highlight covers some of the textbox - this highlighted section doens't allow for editing...

Any one got any ideas? or want more info let me know...

Many thanks
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com