Page Manager and Generic Content Issues
We are currently developing with the new Sitefinity 4.0 Beta. It seems very thorough, and we are looking forward to future releases. We have some questions about certain issues that we’ve run into while trying to use generic content, as well as the page manager.
1. Regarding the pages, we are having some trouble changing the order in which the pages appear in the menu. Using the UI, we have tried to move a page up or down in relation to the other pages, but when the site is previewed or edited, the page goes back to its old position. Is there any sort of Save functionality that perhaps we are missing? Or do you anticipate this coming in a future release?
Also, does the Beta support any breadcrumb functionality? We were having a hard time finding it in the API to create our own customized control, since it appears that a breadcrumb nav widget does not come with the existing controls.
2. As for generic content, we are creating a custom widget that populates with generic content that has a specific tag. However, we have noticed that when we create a generic content block using the UI, the same content is created twice with unique GUIDs. To clarify, when we perform a “get” on all content using the API, we receive two copies each of the content we’ve created, each with their own GUID. For now, we are just programmatically de-duplicating our list of content. We weren’t sure if you were aware that this duplication is taking place, or if there is a fix planned.
Lastly, we want our custom widget to link to the generic content items. We tried using the URL in the content object, but these urls don’t seem to point to an actual location. Is there a url pointing to each content item that will display a default or generic page with the content?
I know that the taxonomy system is still a work in progress, but we were just curious how this might be implemented in future releases. We would really like to see a function on the content manager that queries based on taxons, such as GetContentByTaxon(Taxon or TaxonList). Let me know if you can address any of these questions. Thank you for your time and help.
Thank you,
Ann
Hello Ann,
Thank you for using our services.
Let me try to address the above queries in my response.
1) We are aware of such issues when reordering pages and are going to resolve them in our next releases of the system. Unfortunately the breadcrumb control is not yet part of the release, however this one is a must. You can create a custom breadcrumb control using the Pages API. The bellow code gets your current page:
SiteMapNode currentNode = SiteMapBase.GetCurrentProvider().CurrentNode;
PageSiteNode node = (PageSiteNode)currentNode;
var page = App.WorkWith().Pages().Where(p => p.UrlName == node.UrlName).Get().First();
using
System;
using
System.Linq;
using
System.Web;
using
Telerik.Sitefinity;
using
Telerik.Sitefinity.Modules.Pages;
namespace
SitefinityWebApp
public
partial
class
TestPage : System.Web.UI.Page
protected
void
Page_Load(
object
sender, EventArgs e)
var contentPage = App.WorkWith()
.Pages()
.LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
.Where(p => p.Title ==
"content items"
)
.Get().First();
var pageUrl = contentPage.GetFullUrl();
App.WorkWith()
.ContentItems()
.Where(c => c.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live)
.ForEach(c =>
var cntUrl = c.Urls.FirstOrDefault();
Response.Write(
"<a href=\""
+VirtualPathUtility.ToAbsolute(pageUrl+cntUrl.Url)+
"\">"
+c.Title+
"</a>"
);
Response.Write(
"<br />"
);
);
In the Sitefinity 4.0 RC, is there functionality for a crumbtrail or do we still have to create a custom control to accomplish it?
Hello Rich,
Adding the BreadCrumb control is in our to do list, but we will not have it for the beta. You can use Menu / Show Path And BreadCrumb scenario or using the ASP.NET SiteMapPath control
Regards,
Ivan Dimitrov
the Telerik team
Hi Radoslav,
I'm trying to get the URL of the default blog page set when you create a new blog, this is what I have:
PageNode blogPage = App.WorkWith().Pages().Where(page => page.Id == blogPost.Parent.DefaultPageId && page.Page.Status == ContentLifecycleStatus.Live).Get().First();
string
sURL = blogPage.Urls[0].ToString();
Hello,
GetFullUrl is a static method of Telerik.Sitefinity.Modules.Pages.PageExtesnsions
Kind regards,
Ivan Dimitrov
the Telerik team