Kentico Icon List

1 view
Skip to first unread message

Domenec Reynolds

unread,
Aug 3, 2024, 3:54:38 PM8/3/24
to quigasete

since the release of Kentico 12 I've tried some experiments with the MVC version. Right now I would love to build a widget where the editor can decide how many Icons should be displayed/editable, ranging from one to undefined.I've been building the following model:The widget exists out of the "Amount" of icons and "Columns" as well as a list of "icons". The icons themselves are 2 strings "ClassName" and "DescriptionText". Based on the "Amount" the editor should be able to decide how many icons he desires. I've been able to display the model dynamically but somehow I can't save the changes to the properties. Where did I go wrong?

Anyways, I've noticed you missed a properties retriever and current page retriever in your controller. You might want to write an empty constructor that accepts the above two objects and pass them onto the constructor of the base class. Like so:

Hi Jan, as mentioned before, I have the following Idea in mind:Based on the integer in the Amount property the Editor can display and edit more or less Icons as he desires, i.e amount = 5 thus the editor can edit the properties of 5 icons that should be displayed, if amount = 1 only one icon can be displayed/modified. As of now the Columns property has no function, that is for future usage.

Regarding your properties retriever, I do not understand why I would need it as my controller is using the WidgetControllerIconWallWidgetProperties> Interface which allows me access to the GetProperties Method based ona TPropertiesType and return the Type TPropertiesType. That means I already have the properties accessible in my controller. If I indeed would need the IWidgetPropertiesRetriever why is this nowhere mentioned in the documentation/example?

As for the answer from Juraj,thank you for your help unfortunately this has nothing to do with the sample widget from the documentation. More or less it's the basic setup of a widget I require and that means dynamically increase the properties. As I was saying, right now I'm able to work this out with the standard Model via a List. The Problem I have right now is saving the properties correctly (when the editor want to save his changes).

My advice to get an instance of the properties retriever was driven by the fact that the WidgetController.GetProperties method in turn uses the property retriever. Without the retriever instance at hand, the WidgetController would have no means of getting the properties off of route data or request body.

I'm very new to Kentico and just started using Kentico 11 for my companies CMS and have run into a lot of issues...most of which I've figured out by trial and error. The issue that comes up most often for me is that each time I create a new website with the wizard in the Admin page, no icons appear in either the dashboard or the applications list or on the top menu bar. It doesn't look like anyone has had this issue before, and I'm curious about how to fix it. I'm using IE 11.

Talking with Kentico support is what tipped me off to this fix:In IE 11, Go to Internet Options > Security Tab > Click Custom level > Scroll down until you get to Downloads > Under Font download check Enabled.

I'm trying to create a new widget called "Image Summary Section". I'm at the very beginning stages and I'm just trying to get the widget to appear in the list of widgets when adding widgets to the page. Instead, I just get existing widgets that I didn't create:

You can see that I've created a class that implements IWidgetProperties and that I've called RegisterWidget for it. I've also created _ImageSummarySection.cshtml (though, I wouldn't expect that to be necessary just for the widget to appear in the widget selection dialog).

The top solution is for the MVC website, and the bottom solution is for the Kentico CMS. Both are running, and the browser shown is the Kentico CMS (I'm trying to add my new widget in this screenshot, but it's not in the list of widgets).

From that, I infer that sections may have some feature that allows developers to constrain which widgets are allowed in them. Is there perhaps something I need to do in order to allow my widgets to appear as options in the default section (the one shown below)?

You're almost there. You need to create another class and register your widgets in the App_Start folder. Check out the documentation here on that. It's the section on widget registration. Be sure to enable Page builder as well.

Based on your update and not being able to see the image well on my mobile device, I was able to see you're defining/registering your widget in your Properties model. This needs to be done in the Controller. See the example below.

[assembly: RegisterWidget("NameSpace.Widgets.JobListingWidget", typeof(JobListingWidgetController), "Job Listing Widget", Description = "Displays a listing of jobs for a given path", IconClass = "icon-heartshake")]

Interested in Xperience by Kentico but you recently started using macOS? Maybe even one of the super optimized M1 or M2 processors? No problem! Xperience by Kentico runs great on macOS. Read on to see how to get your environment set up.

This post was written for Xperience by Kentico v27.0.1. Please consult the documentation for any feature or API changes when using a different version. Be sure to check the System Requirements in the product documentation.

To get started developing with Xperience by Kentico on a modern Mac, we'll need to first install all the toolchain dependencies. We'll start with the list and then we'll cover any details for each one.

Why are we talking about containers? Well, Xperience by Kentico depends on Microsoft SQL Server and the best way to run it on a modern Mac is using the SQL Server 2022 container, which runs on Linux, and Linux is what containers run in, even on MacOS.

In VS Code, along the right side icon list, you should see an icon for the SQL Server extension. When you click it you will see a new Connections panel appear with a + Add Connection link. Click that and a dialog will appear where you can start entering the connection details above.

You can leave the optional database name value blank. For the login type you want to select SQL Login. The credentials are the ones listed above and you can save the password for convenience when prompted.

Now press the green button to the right of the tab name and you should see a new tab with the query results appear. If everything has worked so far, you're all set to setup the Xperience by Kentico project.

You will want to get a license key for Xperience by Kentico which you will put into a text file named license.txt in your DancingGoat.Web folder. You can follow the instructions from the documentation to get a license key, which will be used in the next step.

In VS Code, switch to the Explorer tray by clicking the Explorer icon in the left side icon list.Collapse the DancingGoat tray and expand the Solution Explorer tray. You should see a solution hierarchy DancingGoat -> DancingGoat.Web.

I'm Lead Product Evangelist at Kentico. I work in the Product Marketing department at Kentico along with Matej Stefanik, Miroslav Jirku, and James Turner. My responsibilities include helping partners, customers, and the entire Kentico community understand the strategy and value of Xperience by Kentico. I'm also responsible for the Kentico MVP Program.

When troubleshooting an issue, do you ever have that feeling of, "well...this should just work, it always just works..." ? Yeah, I get that a lot. In fact, today's quick tip on Kentico MVC gave me this feeling at least 3 times during a project I was recently on. I was tasked with figuring out why page content in our upgraded Kentico EMS 12.0 site was not publishing automatically when the publish from date was set in the future and that time had passed.

The thing is, the ability to have content scheduled to be published in the future has been in the Kentico platform for ages. I'd guess it was probably there all the way back in version 4 or version 5 of the CMS (maybe even earlier). The feature hasn't really changed in any version I can remember. It should. just. work. I didn't think it had anything to do with MVC vs. Portal engine either, because this feature is only really part of the Kentico Administration tool, and not the MVC live site. My head immediately went to the fact it could be a caching issue (it's almost always a caching issue right?), or server side time zone issue, or heck, in the US we just went through the daylight savings time zone change, maybe it was that. But I was wrong on all accounts.

Then the system is supposed to automatically publish the content when that time arrives. And it will flip the page status icon to green, meaning published. The way this works is through an out of the box scheduled task called Content Publishing. But what is a bit strange is that it is not a global scheduled task, but instead a site specific scheduled task. That means it needs to be associated and running for each site in your Kentico installation. That scheduled task looks like:

Basically it runs every single minute to determine if something should be published or not. However, you have a problem if your site specific task list looks like this. Remember to change the site dropdown from (global) to your specific site.

Also, a quick side note, you might be asking, well how did a site get created with no site specific scheduled tasks in the first place? Well, that comes down to the fact that we start our projects at BizStream following the Kentico documentation for Starting with MVC Development as any good developer should. And if you follow those steps to create a new blank MVC site, this will be the result every time in Kentico 11 (and I'm guessing v10 as well).

The solution comes down to number 1, fixing the scheduled task situation. You have two options for that. You can either simply look at another instance or site that has the correct set of scheduled tasks for a specific site, and manually create the tasks that point at the right namespace and classes to create the fix, or the much better way, would be to export a set of site objects that represent the set of scheduled tasks from a good instance and import them into your instance that has the issue. You can follow the linked documentation there to do this if you are not sure how.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages