Dropdown with quicklinks from site pages
Any tips on how to make a dropdown that will contain some quicklinks to the site.
Backend users should be able to add/remove pages from the dropdownlist.
Markus
Well I thought why not try the module builder.
<sidebar title="Verwalten Quicklinks" wrapperTagKey="Unknown"> <sections> <section title="Quicklink filtern" titleWrapperTagKey="Unknown" wrapperTagKey="Unknown" cssClass="sfFirst sfWidgetsList sfSeparator sfModules" visible="True" name="Filter"> <items> <item commandName="showAllItems" commandButtonType="SimpleLinkButton" isFilter="False" buttonCssClass="sfSel" text="Alle Quicklink" wrapperTagKey="Unknown" widgetType="Telerik.Sitefinity.Web.UI.Backend.Elements.Widgets.CommandWidget" isSeparator="False" name="AllItems" type:this="Telerik.Sitefinity.Web.UI.Backend.Elements.Config.CommandWidgetElement, Telerik.Sitefinity" /> <item commandName="showMyItems" commandButtonType="SimpleLinkButton" isFilter="False" text="Meine Quicklink" wrapperTagKey="Unknown" widgetType="Telerik.Sitefinity.Web.UI.Backend.Elements.Widgets.CommandWidget" isSeparator="False" name="MyItems" type:this="Telerik.Sitefinity.Web.UI.Backend.Elements.Config.CommandWidgetElement, Telerik.Sitefinity" /> </items> </section> <section title="Settings" titleWrapperTagKey="Unknown" wrapperTagKey="Unknown" cssClass="sfWidgetsList sfSettings" resourceClassId="ModuleBuilderResources" visible="True" name="Settings"> <items> <item text="<a href=http://develping.myserver.mydomain.com/Sitefinity/Administration/Modul-Generator/Modul/Typ/6eb418ca-dbfa-49d2-82a9-8da30a188df0>Inhaltstypen</a>" wrapperTagKey="Unknown" widgetType="Telerik.Sitefinity.Web.UI.Backend.Elements.Widgets.LiteralWidget" isSeparator="False" name="NavigatetoContentTypes" type:this="Telerik.Sitefinity.Web.UI.Backend.Elements.Config.LiteralWidgetElement, Telerik.Sitefinity" /> <item commandName="permissions" commandButtonType="SimpleLinkButton" isFilter="False" text="Permissions" resourceclassid="ModuleBuilderResources" wrapperTagKey="Unknown" widgetType="Telerik.Sitefinity.Web.UI.Backend.Elements.Widgets.CommandWidget" isSeparator="False" name="Permissions" type:this="Telerik.Sitefinity.Web.UI.Backend.Elements.Config.CommandWidgetElement, Telerik.Sitefinity" /> </items> </section> </sections> </sidebar>Hello Markus,
Please check the code reference of your module. You can find it on the right hand side of you module setting screen. There you can find an example on how to obtain a collection of your module items. Please use the specified code to obtain the collection and to specify it as a data source for your rad grid.
Point b) is a known issue which we are working on and the work around it is to export the module from your development project and import it in your live one. This will create the correct links in the live environment.
Regards,
Lilia Messechkova
the Telerik team
Dear Lilia
Thank's I got an open ticket. I did use the example on how to obtain a collection of my module items.
a) I comented the line which was causing the error
b) It collected double entries (support is helping me)
QUTOE
The double entries are coming from the fact that you are not filtering the collection by Status. You should only get Live items. Actually in the database, there are two records for each item - one Live and one Master and when you use the GetDataItems method, it returns both - the Live and Master items. Here's what filter you should add to your method:
dynamicModuleManager.GetDataItems(releaseType).Where(item => item.Status == ContentLifecycleStatus.Live);
UNQUOTE
If this Master and Live is standard then it would be nice if the code sample created (which I such a huuuuuugggggghhhh help - thank' s a whole heap) would take this into consideration.
I would never have know that there are two item (live and master)
public void RetrieveCollectionOfQuicklinks() DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(); Type quicklinkType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Quicklinks.Quicklink"); //THIS LINE CAUSED THE ERROR -> CreateQuicklinkItem(dynamicModuleManager, quicklinkType); // This is how we get the collection of Quicklink items var myCollection = dynamicModuleManager.GetDataItems(quicklinkType); myCollection.OrderBy("Sortierung"); // At this point myCollection contains the items from type quicklinkType RadComboBox1.DataSource = myCollection; RadComboBox1.DataBind(); Hello Markus,
I am glad that you have solved the problems. Thank you for your feedback. We will update the code reference to remove the confusion.
Greetings,
Lilia Messechkova
the Telerik team