本文整理汇总了C#中ContentAPI.GetFolderIdForContentId方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.GetFolderIdForContentId方法的具体用法?C# ContentAPI.GetFolderIdForContentId怎么用?C# ContentAPI.GetFolderIdForContentId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentAPI
的用法示例。
在下文中一共展示了ContentAPI.GetFolderIdForContentId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPageBuilderEditAnchor
public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink, bool isPrimary)
{
//make popup window with link to this pageids wireframe, and pass in the id and an edit flag
ContentAPI capi = new ContentAPI();
FolderData fd = capi.GetFolderById(capi.GetFolderIdForContentId(Id));
AliasData aliasData = new AliasData();
string URL = "";
AliasSettings aliasSettings = ObjectFactory.GetAliasSettingsManager(this.m_refAPI.RequestInformationRef).Get();
if (aliasSettings.IsAliasingEnabled)
{
IAliasManager aliasManager = ObjectFactory.GetAliasManager(this.m_refAPI.RequestInformationRef);
aliasData = aliasManager.GetAlias(Id, languageId, EkEnumeration.TargetType.Content);
URL = aliasData.Alias;
}
// Note that the internal API changed, if a content items has a default alias it will be passed into this funciton as param quicklink.
// Keeping this code incase other places are calling this function without alias in quicklink param
if (String.IsNullOrEmpty(URL))
{
URL = quickLink;
}
// If it is a multi site, use the quicklink as the alias will not function in other domains. ALias is tied to domain.
if (fd.IsDomainFolder && aliasData != null && !string.IsNullOrEmpty(aliasData.TargetURL))
{
URL = aliasData.TargetURL.TrimStart('/');
}
else if (fd.IsDomainFolder)
{
URL = URL.TrimStart('/');
}
if (URL.Contains("?"))
{
URL = URL + "&ektronPageBuilderEdit=true";
}
else
{
URL = URL + "?ektronPageBuilderEdit=true";
}
if (URL.IndexOf("LangType=") == -1)
{
URL = URL + "&LangType=" + languageId.ToString();
}
URL = this.m_refAPI.SitePath + URL;
URL = GetButtonEventsWCaption(m_refAPI.AppImgPath + "layout_edit.gif", "#", m_refMsg.GetMessage("generic edit page layout"), m_refMsg.GetMessage("generic edit page layout"), "OnClick=\"window.open(\'" + URL + "\', \'CMS400EditPage\');return false;\"", EditButtonCssClass, isPrimary);
return URL;
}
示例2: EditEvent
void EditEvent(string settings)
{
try
{
tabTesting.Visible = _ShowTestingTab;
string webserviceURL = _api.SitePath + "widgets/contentblock/CBHandler.ashx";
// Register JS
JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronClueTipJS);
JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS);
JS.RegisterJSInclude(this, _api.SitePath + "widgets/contentblock/behavior.js", "ContentBlockWidgetBehaviorJS");
// Insert CSS Links
Css.RegisterCss(this, _api.SitePath + "widgets/contentblock/CBStyle.css", "CBWidgetCSS"); //cbstyle will include the other req'd stylesheets
Ektron.Cms.Framework.UI.Packages.jQuery.jQueryUI.ThemeRoller.Register(this); //cbstyle will include the other req'd stylesheets
JS.RegisterJSBlock(this, "Ektron.PFWidgets.ContentBlock.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.ContentBlock.setupAll('"+ ClientID +"');", "EktronPFWidgetsCBInit");
IsGoogleMultivariate = cbMultiVariate.Checked;
GoogleSectionName = tbSectionName.Text;
ViewSet.SetActiveView(Edit);
if (ContentBlockId > 0)
{
tbData.Text = ContentBlockId.ToString();
ContentAPI capi = new ContentAPI();
long folderid = capi.GetFolderIdForContentId(ContentBlockId);
tbFolderPath.Text = folderid.ToString();
while (folderid != 0)
{
folderid = capi.GetParentIdByFolderId(folderid);
if (folderid > 0) tbFolderPath.Text += "," + folderid.ToString();
}
}
}
catch (Exception e)
{
errorLb.Text = e.Message + e.Data + e.StackTrace + e.Source + e.ToString();
_host.Title = _host.Title + " error";
ViewSet.SetActiveView(View);
}
}
示例3: GetPageBuilderEditAnchor
public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink, bool isPrimary)
{
//make popup window with link to this pageids wireframe, and pass in the id and an edit flag
ContentAPI capi = new ContentAPI();
FolderData fd = capi.GetFolderById(capi.GetFolderIdForContentId(Id));
string URL = "";
Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon();
URL = u.GetAliasForContent(Id);
if (URL == string.Empty || fd.IsDomainFolder)
{
URL = quickLink;
}
if (URL.Contains("?"))
{
URL = URL + "&ektronPageBuilderEdit=true";
}
else
{
URL = URL + "?ektronPageBuilderEdit=true";
}
if (URL.IndexOf("LangType=") == -1)
{
URL = URL + "&LangType=" + languageId.ToString();
}
URL = this.m_refAPI.SitePath + URL;
URL = GetButtonEventsWCaption(m_refAPI.AppImgPath + "layout_edit.gif", "#", m_refMsg.GetMessage("generic edit page layout"), m_refMsg.GetMessage("generic edit page layout"), "OnClick=\"window.open(\'" + URL + "\', \'CMS400EditPage\');return false;\"", EditButtonCssClass, isPrimary);
return URL;
}