How to override standard module class in joomla 3 - helper

Tell me please how can i override the standart class ModArticlesCategoryHelper, located in /modules/mod_articles_category/ ?
I want customize this class, but i don't want modify a joomla core.

go to the module and click on the Advanced tab. Module Class Suffix - put some class here, make sure you put space before the class name. Like this " mycustomclass"
Then you can style anything withing that ul as you wish, for example:
ul.mycustomclass li a.ModArticlesCategoryHelper {your custom css}

Related

Unable to Create New MVC Widget in Kentico 12

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).
Any idea of what I'm doing wrong? How can I get my widget to appear in the list of widgets?
Additional information:
I've looked at various links, but here's one I was looking through: https://docs.kentico.com/k12sp/developing-websites/page-builder-development/developing-widgets-in-mvc/defining-widget-properties-in-mvc
I'm on the latest Kentico version, which I think is 12.0.77.
.
.
.
.
.
.
EDIT:
I just watched this video, hoping it would provide insight: https://www.youtube.com/watch?v=ljQO9on5lLM
It was more basic than I anticipated, but I did notice these two frames:
Note that it shows six available widgets to select from.
And then there was this frame:
It shows only two available 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)?
.
.
.
.
.
.
EDIT #2:
I researched widget constraints a bit and found this: https://docs.kentico.com/k12/developing-websites/page-builder-development/creating-pages-with-editable-areas-in-mvc
Specifically the section titled "Limiting widgets allowed in an editable area", which says the following:
Since my view is not passing a parameter with a whitelist of widgets, all widgets should (in theory) be allowed:
#* Index.cshtml *#
#using Kentico.PageBuilder.Web.Mvc
#using Kentico.Web.Mvc
<h1>Rhythm Agency</h1>
#Html.Kentico().EditableArea("main")
So there goes that theory. I'm still at a loss as to why my new widget isn't appearing as an option when adding new widgets to the page.
For the controller and widget to be recognized you need to put your controller in the '/Controllers' folder. I have my widget controllers located in the '/Controllers/Widgets' folder.
I had issues which included not having added the suffix 'Controller' in the class name and issues with the widget controller not being in the '/Controllers' folder.
Also you aren't working in an seperate project? Because this would need you to use the following in the 'AssemblyInfo.cs'
using CMS;
[assembly: AssemblyDiscoverable]
And make sure you have enabled the page builder feature in your kentico project. For example:
protected void Application_Start()
{
...
// Gets the ApplicationBuilder instance
// Allows you to enable and configure Kentico MVC features
ApplicationBuilder builder = ApplicationBuilder.Current;
// Enables the preview feature
builder.UsePreview();
// Enables the page builder feature
builder.UsePageBuilder();
...
}
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.
*** Updated ***
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.
\Models\Widgets\JobListingWidgetProperties.cs
namespace NameSpace.Models.Widgets.JobListingWidget
{
public class JobListingWidgetProperties : IWidgetProperties
{
// property definitions here
}
}
\Models\Widgets\JobListingModelView.cs
namespace NameSpace.Models.Widgets.JobListingWidget
{
public class JobListingWidgetViewModel
{
// properties here
}
}
\Controllers\Widgets\JobListingWidgetController.cs
[assembly: RegisterWidget("NameSpace.Widgets.JobListingWidget", typeof(JobListingWidgetController), "Job Listing Widget", Description = "Displays a listing of jobs for a given path", IconClass = "icon-heartshake")]
namespace NameSpace.Controllers.Widgets
{
public class JobListingWidgetController : WidgetController<JobListingWidgetProperties>
{
public ActionResult Index()
{
// code here
}
}
}

Add simple text/description to a page in Rails Admin

Is there a way to add text to a page in rails admin? I'd like to add a description to a page. I know the label can be edited, but I'd like to be able to add a description to a page underneath the label.
There's no builtin way to do that, but you can do it like this:
You have to override the file where rails admin puts that title but placing a copy of the original file on your own project
app/views/layouts/rails_admin/pjax.html.haml
Then you can access your model like this on that file:
.page-header
%h1= #page_name
%div
= #abstract_model.model.your_awesome_description
And in your model you just need to add a class method
class QualifiedUsers < ApplicationRecord
def self.your_awesome_description
'These users are greeeat'
end
end
If you want a description per object, you have #object available on pjax and you just add the instance method.
I know is not that maintainable to override default partials, but rails_admin give us no option to do this and i figured this is the lest intrusive you can do what you want.

How to override a class in liferay 7/DXP. the class inside the modules/ foundation?

Is there any way to override class inside the modules/foundation in liferay DXP?
Liferay 7 design is more over extensible than override. Instead of overriding something extend the functionality or replace with another module.
Here's are few samples which allow us to extend at different level.
https://github.com/liferay/liferay-blade-samples/tree/master/liferay-workspace/extensions
https://github.com/liferay/liferay-blade-samples/tree/master/liferay-workspace/overrides

Name of control for toggle boxes in sharepoint editor part

I'm trying to modify the EditorPart controller for my web part. Basically what I want is to have my custom controls inside a box like the standard properties that can toggle between visible and hidden.
I've been googling for a while, but I cannot seem to find an answer.
Just to clarify: I know I can use the Category property to accomplish this when adding web part properties directly to the web part, but I've extended the EditorPart controller and so I don't think I can simply add [Category("Feed settings")] to the TextBox and LiteralControls I'm creating (correct?).
What you'd need for a standard property is to mark it with the Category attribute:
[Category("My Category")]
public string FeedQuery { get; set; }
(You'll need to add the System.ComponentModel namespace to your class file).
For editor parts it is not so simple. It appears that you can't add them to the standard categories. It is possible to style the editor part to resemble the OOB panels as shown here

How do I hide an inherited __published property in the derived class in a VCL component?

I have created a new VCL component based on an existing VCL component. What I want to do now is set the Password and Username properties from an ini file instead of the property inspector.
Robert Dunn Link
I read on the delphi forum above you cannot unpublish a property and that the only workaround is to redeclare the property as read-only. I tried this but it all it does is make the property read only and grayed out in the object inspector. While this could work I would prefer if the property wasn't visible at all.
__property System::UnicodeString Password = {read=FPassword};
Thanks in advance for any help or links to c++ VCL component writing tutorials. I am using CB2010
Look up DesignIntf.UnlistPublishedProperty. See this tread.
The language as defined will not allow you to hide published properties.
I would make use of aggregation instead of inheritance i.e. Create a new VCL component that delegates its methods to the existing component, you then have full control over what properties to publish.
I know this is an old question, but there is still no good documentation on how to do this. I ended up here myself trying to figure this out and thought that others ending up here for the same reason deserve an explanation on how to do this.
In the writing moment, I'm using C++ Builder 10.4 (Sydney).
There is a package called designide that you need to add as a reference to your project.
In your package project, right click on "Requires" and select "Add Reference..."
Click the "Browse" button and go to your install folder look for designide.bpi in lib\win32\release or lib\win64\release depending on your target.
The include path must also be updated so it can find the header file.
Right click on your package project and select "Options"
Select "Shared Options"
For convenience, set "Target" to "All configurations - All platforms".
Select "Include path" and click on the "..." to edit the value.
Add the line $(BDSINCLUDE)\windows\vcl\design
Click the Ok button and then save the changes.
In your code add #include <DesignIntf.hpp> and use the function UnlistPublishedProperty() to unpublish properties in your package function Register().
void __fastcall PACKAGE Register() {
// Register components
TComponentClass classes[1] = {__classid(TMyVCLClass)};
RegisterComponents(L"MyComponent", classes, 0);
// Unpublish properties
UnlistPublishedProperty(__classid(TMyVCLClass),L"AlignWithMargins");
UnlistPublishedProperty(__classid(TMyVCLClass),L"Margins");
}

Resources