How to check page title length in sharepoint 2010?

To help navigate, we would prefer our users to create pages with less than or equal to 30 characters. Is there a relatively easy way to do this? I saw a javascript solution that uses the PreSaveAction method, but this is not exactly what I am looking for since it got a job on the site (regardless of whether they are in the site settings or in the gui interface using the feed).

We are currently deploying our content types with a feature in visual studio, if that helps.

edit: in addition, should this also limit the length of the url too correct? For example, we would prefer that our users do not create very long pages-names-this-non-user-friendly-etc-etc-etc-etc-etcaspx

+3
source share
3 answers

I think your best bet is to implement a list item event receiver. You can use events ItemAdding, ItemUpdatingand ItemFileMovingto sanitize a URL for a shorter length or discard errors. The item event receiver is reliable because it runs on the server regardless of the client, whether it is Office, Windows Explorer, SOAP, or the web interface.

. , , , . ​​ , . , , . , .

, , JavaScript, MaxLength ; .

!

+2

, , , , SharePoint 2007, 2010 . , , , /_ layouts/CreatePublishingPageDialog.aspx /_ layouts/CreatePublishingPageDialog_new.aspx . , 30 Char. Click URL .

, , . , . , SiteAction.xml, , . C:\Program \ \Microsoft Shared\ -\14\TEMPLATE\LAYOUTS\EditingMenu\SiteAction.xml

: , CreatePage.aspx(MOSS)

+1

, , , , :) Pages, "" > " ". =LEN(Title)<=30, , .

- , , , :/ .

0

Source: https://habr.com/ru/post/1756147/


All Articles