Microsoft Content Management Server - Urgent: Changing links in CMS placeholder data

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > May 2005 > Urgent: Changing links in CMS placeholder data





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 Urgent: Changing links in CMS placeholder data
premalxyz@yahoo.com

2005-05-10, 5:55 pm

Hi,

Need some urgent help. We want to programmatically through PAPI change
html links in a CMS HTML placeholder.

Please let us know if this can be achieved and how.

Thanks.

Any help would be really appreciated.

regards,
Premal

Stefan [MSFT]

2005-05-11, 2:48 am

Hi Premal,

I would suggest to write a console application that iterates through all
placeholders in all postings in all channels and does the necessary changes.

Something like the code below:

static private void CollectChannel(Channel channel)
{
foreach (Posting po in channel.Postings)
{
foreach (Placeholder ph in po.Placeholders)
{
if (ph is HtmlPlaceholder)
{
htmlPh = (HtmlPlaceholder)ph;
htmlPh.Html = htmlPh.Html.Replace(....do your replace here...);
}
}
}

foreach (Channel ch in channel.Channels)
{
CollectChannel(ch,wXml);
}
}

// in the main routine
....
CollectChannel(cmsContext.RootChannel);
....

Cheers,
Stefan

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

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


<premalxyz@yahoo.com> wrote in message
news:1115745105.615151.45860@f14g2000cwb.googlegroups.com...
> Hi,
>
> Need some urgent help. We want to programmatically through PAPI change
> html links in a CMS HTML placeholder.
>
> Please let us know if this can be achieved and how.
>
> Thanks.
>
> Any help would be really appreciated.
>
> regards,
> Premal
>



Stefan [MSFT]

2005-05-11, 2:48 am

Btw: don't forget to Commit and approve the changes after each posting.
I missed this in the previous post.

Cheers,
Stefan

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

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


<premalxyz@yahoo.com> wrote in message
news:1115745105.615151.45860@f14g2000cwb.googlegroups.com...
> Hi,
>
> Need some urgent help. We want to programmatically through PAPI change
> html links in a CMS HTML placeholder.
>
> Please let us know if this can be achieved and how.
>
> Thanks.
>
> Any help would be really appreciated.
>
> regards,
> Premal
>



premalxyz@yahoo.com

2005-05-12, 2:55 am

Hi Stefan,

Thanks for your response.

We thought of this console application but the URL is apprearing as
follows in the HTML placeholder:

<A href="/NR/exeres/67A3F564-5F49-4CE6-B6E4-D916192805A1.htm?

How can we replace this? Basically we need to replace say
...../en-US/x.htm with ..../en-US/India/x.htm

Please help.

Thanks.

regards,
Premal

Stefan [MSFT]

2005-05-12, 2:55 am

Hi,

then you need two different CmsApplicationContexts.
One in published mode and one in updated mode.

Retrieve the content from the published mode part and then replace it and
write it back using the context in update mode.

Cheers,
Stefan

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

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


<premalxyz@yahoo.com> wrote in message
news:1115883065.493512.131800@f14g2000cwb.googlegroups.com...
> Hi Stefan,
>
> Thanks for your response.
>
> We thought of this console application but the URL is apprearing as
> follows in the HTML placeholder:
>
> <A href="/NR/exeres/67A3F564-5F49-4CE6-B6E4-D916192805A1.htm?
>
> How can we replace this? Basically we need to replace say
> ..../en-US/x.htm with ..../en-US/India/x.htm
>
> Please help.
>
> Thanks.
>
> regards,
> Premal
>



premalxyz@yahoo.com

2005-05-14, 1:16 pm


Stefan [MSFT] wrote:
> Hi,
>
> then you need two different CmsApplicationContexts.
> One in published mode and one in updated mode.
>
> Retrieve the content from the published mode part and then replace it

and
> write it back using the context in update mode.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no

rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS:

http://tinyurl.com/6zj44[vbcol=seagreen]
> ----------------------
>
>
> <premalxyz@yahoo.com> wrote in message
> news:1115883065.493512.131800@f14g2000cwb.googlegroups.com...

premalxyz@yahoo.com

2005-05-14, 1:16 pm

Hi Stefan,

Thanks.

We got the GUID, did a reverse lookup to a channel and then did a
replace and inserted the new GUID.

Thanks for your help.

regards,
Premal

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com