Umbraco入门教程 - 常用Umbraco内置函数

by 亿答案 21. 十月 2009 12:41

通常需要引用的命名空间:

using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.web;
using umbraco.presentation.nodeFactory;
using umbraco.presentation;
using umbraco.cms.businesslogic.media;

 

获取当前文档:

Document currentDocument = new Document(Convert.ToInt32(UmbracoContext.Current.PageId));

获取文档的某个属性:

currentDocument.getProperty("AdvertTwoTitle").Value.ToString();

通过文档id生成URL:

umbraco.library.NiceUrl(yourId);

获取文档内设置的图片(media)路径:

Media image;


image = new Media(Convert.ToInt32(currentDocument.getProperty("AdvertTwoImage").Value));

return image.getProperty("umbracoFile").Value.ToString();

 

获取配置数据: umbraco.GlobalSettings.DbDSN

Tags:

Umbraco 入门系列

评论

2010/4/15 11:58:18 #

football jersey

信息是非常有用的..感谢分享

football jersey People's Republic of China

2010/4/15 12:02:10 #

cheap mlb Jerseys

This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.

cheap mlb Jerseys People's Republic of China

2010/4/15 12:02:19 #

cheap mlb Jerseys

This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.

cheap mlb Jerseys People's Republic of China

2010/4/15 12:03:52 #

pandora charms

You should really moderate the comments here

pandora charms People's Republic of China

2010/6/7 4:51:06 #

pee

A different excellent post, usually awesome to examine a fantastic post on the topic you in reality care about.

pee Taiwan

添加评论


(将显示你的Gravatar图标)

  Country flag

biuquote
  • 评论
  • 在线预览
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

RecentComments

Comment RSS