I saw that already but why that shows another tree node call standard values under neeth Document types in settings section. is there any way to do this with a code plugin ?
What do you mean by code plugin? The reason it exists in settings section is that it corresponds exactly to your document types. What makes you not want to use this?
1) Create new Class Library project , create class.
2) Add this referance to project from some umbraco site bin folder - cms.dll, businesslogic.dll, umbraco.dll interfaces.dll
3) In your class use this code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.cms.businesslogic.web;
using umbraco.BusinessLogic;
namespace custom_events
{
publicclassassignName : umbraco.BusinessLogic.ApplicationBase
{
public assignName() {
Document.New += newDocument.NewEventHandler(Document_New);
}
void Document_New(Document sender, umbraco.cms.businesslogic.NewEventArgs e)
{
if (sender.ContentType.Alias == "page") /// your document type alias
{
sender.getProperty("pageTitle").Value = sender.Text;
sender.getProperty("menuTitle").Value = sender.Text;
}
}
}
}
4) Build your project and add referance in your umbraco project or copy the dll file to umbraco site bin folder.
on create page assign node name to a document property
I need to assign node name to PageTitle and Menu Title properties which are defined in document property.
how do I make this happen automatically, when type name for new page and press create.
please
This package lets you have default values for properties for different document types:
http://our.umbraco.org/projects/developer-tools/standard-values-in-umbraco
Is that what you want?
I saw that already but why that shows another tree node call standard values under neeth Document types in settings section. is there any way to do this with a code plugin ?
What do you mean by code plugin? The reason it exists in settings section is that it corresponds exactly to your document types. What makes you not want to use this?
1) Create new Class Library project , create class.
2) Add this referance to project from some umbraco site bin folder -
cms.dll,
businesslogic.dll,
umbraco.dll
interfaces.dll
3) In your class use this code :
4) Build your project and add referance in your umbraco project or copy the dll file to umbraco site bin folder.
thanks found the error , I have used sender.getproperty(name).Value; assuming that I can read page name like that.
once changed to sender.Text;
my code works, brilient...
thanks again
is working on a reply...