save new page [2]
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > save new page [2]




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    save new page [2]  
bill tie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-24-04 07:48 AM


As suggested we downloaded Stefan's "Save new Page without Name prompt".
OK, that effectively knocked the pop-up window out of commission and provide
d
data necessary to "complete" the save.

Now.  We'd like to up the ante and be friendly to authors, as well as,
readers by creating a sensible name and display name of the page.

In contrast to "CmsPosting_Creating", "CmsPosting_Created" implies the
creation process is completed.  We tortured "CmsPosting_Created" to no avail
.
It didn't do a thing for us.

Well, next we tried "CmsPosting_Changed".  Again, "changed" implies the
changing is over, so we should be able to make our modifications.  We got
something out of it but not much.

Our template has three custom HTML placeholders on it.

1. The following piece of code met with no complaints:

public void CmsPosting_Changed( Object sender, ChangedEventArgs e )
{
Posting newPage = e.Target as Posting;
}


2. This piece threw the method into recursion:

public void CmsPosting_Changed( Object sender, ChangedEventArgs e )
{
Posting newPage = e.Target as Posting;
newPage.DisplayName = "foo";
}


3. The next variation elicited an error saying the last placeholder in the
template could not be saved.

public void CmsPosting_Changed( Object sender, ChangedEventArgs e )
{
Posting newPage = e.Target as Posting;
Response.Write(newPage.DisplayName.ToString());
}


The objective is to read the contents of one of the placeholders and use it
for the name and display name of the posting.

We'll be immensely grateful if somebody helps us out of the predicament.






[ Post a follow-up to this message ]



    Re: save new page [2]  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-24-04 07:48 AM

Hi Bill,

to break the recursion just check if the DisplayName is already set to the
value you like it to be.
If not set it. Otherwise skip the change:

> public void CmsPosting_Changed( Object sender, ChangedEventArgs e )
> {
>   Posting newPage = e.Target as Posting;
>   if (newPage.DisplayName != "foo")
>       newPage.DisplayName = "foo";
> }
>

But I would suggest not to use a placeholder object but to implement this
method for what you are doing:
http://blogs.msdn.com/stefan_gossne.../25/119613.aspx

Cheers,
Stefan.

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

MCMS FAQ:
http://download.microsoft.com/downl...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"bill tie" <billtie@discussions.microsoft.com> wrote in message
news:DEB363BD-D861-46B5-92D9-4B8DEC22B676@microsoft.com...
>
> As suggested we downloaded Stefan's "Save new Page without Name prompt".
> OK, that effectively knocked the pop-up window out of commission and
provided
> data necessary to "complete" the save.
>
> Now.  We'd like to up the ante and be friendly to authors, as well as,
> readers by creating a sensible name and display name of the page.
>
> In contrast to "CmsPosting_Creating", "CmsPosting_Created" implies the
> creation process is completed.  We tortured "CmsPosting_Created" to no
avail.
>  It didn't do a thing for us.
>
> Well, next we tried "CmsPosting_Changed".  Again, "changed" implies the
> changing is over, so we should be able to make our modifications.  We got
> something out of it but not much.
>
> Our template has three custom HTML placeholders on it.
>
> 1. The following piece of code met with no complaints:
>
> public void CmsPosting_Changed( Object sender, ChangedEventArgs e )
> {
>   Posting newPage = e.Target as Posting;
> }
>
>
> 2. This piece threw the method into recursion:
>
> public void CmsPosting_Changed( Object sender, ChangedEventArgs e )
> {
>   Posting newPage = e.Target as Posting;
>   newPage.DisplayName = "foo";
> }
>
>
> 3. The next variation elicited an error saying the last placeholder in the
> template could not be saved.
>
> public void CmsPosting_Changed( Object sender, ChangedEventArgs e )
> {
>   Posting newPage = e.Target as Posting;
>   Response.Write(newPage.DisplayName.ToString());
> }
>
>
> The objective is to read the contents of one of the placeholders and use
it
> for the name and display name of the posting.
>
> We'll be immensely grateful if somebody helps us out of the predicament.
>







[ Post a follow-up to this message ]



    Re: save new page [2]  
bill tie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-25-04 01:48 AM


Stefan,

Thank you for a useful tip in your blog.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:25 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register