Dropdown with quicklinks from site pages

Posted by Community Admin on 04-Aug-2018 11:48

Dropdown with quicklinks from site pages

All Replies

Posted by Community Admin on 12-Mar-2012 00:00

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

Posted by Community Admin on 12-Mar-2012 00:00

Well I thought why not try the module builder.

Two things:

a) I did create the module online. Now when I want to bind data to my radcontrol in my local ascx I throws an error: 'The name 'CreateQuicklinkItem' does not exist in the current context

What do I need to download from the live site. Where are my created classes stored

b) I downloaded DynamicModulesConfig.config from App_Data/Sitefinity and noticed that in some part my developer URL was referenced:

How should I go about this once I go live with the site?

<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>


Markus

Posted by Community Admin on 13-Mar-2012 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 13-Mar-2012 00:00

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();
  

Thank's a lot
Markus

Posted by Community Admin on 14-Mar-2012 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed