Ektron PageBuilder - define default name for custom widget - ektron

I'm hoping this is a simple question. I have a custom widget. Let's say it is "SuperAwesomeWidget.ascx". When I'm editing a PageBuilder wireframe, I can see my widget in the little pulldown widget tray at the top of the screen. Thing is, the name under my icon is "SuperAwesomeWidget".
Now, I know that I can go to the widgets settings in the WorkArea and define a custom name, but what if I want Ektron to just "know" what the name should be? I'm hoping there is some config file somewhere that I can add my widget name to. I'd like to be able to drop this widget along with maybe a config file or something into a second Ektron install and not need to define the name via the workarea.

For anyone in the future googling this issue, there is a better answer than my previous one, particularly better than a workarea modification.
To update the display title of a widget in the widget bar:
Go to Workarea > Settings > Configuration > Personalization > Widgets
Find your widget in this list and click the edit icon to the left of its name
Modify the display title in the second text field in the modal that pops up.
Confirmed working in 8.6.1, likely works in all 8+ versions.

Edit: While this answer is still partially correct, I have discovered the actual way to do this. The correction has been marked as the accepted answer.
Set your IWidgethost's title property:
IWidgetHost _host;
...
_host.Title = "Hello World Widget";
From the esteemed eGandalf's tutorial on widget development:
http://www.ektron.com/Blogs/eGandalf/Break-it-down!-Widget-Development-How-To-(Part-1)/

Related

Display module fields in Sitefinity using conditions in the back end

I'm looking for a way to show module fields conditionally on the back end screen of Sitefinty.
For example, say I've created a module through module builder - and I have two fields: a checkbox and a text field.
I'd like the text field only to display to content editors only after they've checked the checkbox field. Ideally that checkbox could hide/show a handful of fields on the spot through the content entering process.
Is there a straightforward, maintainable way to go about this?
Currently using version 10.2, it'd be great to know how to accomplish
this via both the new and old UI.
Hoping there is an advanced setting I just don't know about, but
willing to go a JS approach as well.
Thanks!
After a little digging I've been able to find a working solution. Here's how I handled it:
Note: [module] and [section] assume your custom module name and section. If you didn't setup sections in backend screens and tweaks then all of the fields will be under MainSection
Step 1 - Add a custom script to the module in advanced settings.
Assuming this is a dynamic module...
Create a JS file in your project and reference it in advanced settings by going to:
Advanced settings > Dynamic Modules > Controls > [module] > Views > [Module]View > Scripts
Click Create New and point the script location to the JS file you created.
Step 2 - Add custom classes to your fields
Stay where you're at in advanced settings and navigate to the fields you've made. For example:
Advanced settings > Dynamic Modules > Controls > [module] > Sections > [Section] > Fields > [Field]
On this page scroll down to CSS Class and add a custom CSS class to this field
Step 3 - Add your custom Javascript
Sitefinity uses jQuery so I worked with that and set up some really basic JS based off the class names:
$(document).ready(function(){
$('.myTextBox').hide();
$('.myCheckbox input').on('change', function(){
var $this = $(this),
textBox = $('.myTextBox');
$this.is(':checked') ? textBox.show() : textBox.hide();
})
});
Note: the custom CSS class gets applied to the parent wrapper of the actual element
Now when a content editor goes to add a new content item to a module, checking that specific checkbox will show and hide the custom text box.
Besides the fact that this process seems a little over the top, there are a few other issues:
You have to set the call to your custom script on the edit and insert
view.
It doesn't take into account any validation.
With Sitefinity getting a backend UI upgrade, long term sustainability is questionable.
I'll leave this question unanswered for a while if there is a better/easier approach to this.

impresspages - 1) styling blocks 2) change background color as admin 3) plugins request

I am just playing around with ImpressPages and got three questions:
1)
Widgets can be styled.
There are options available, where you can adjust everything.
But what about the blocks?
Where can the style of blocks be edited in a graphical way? (without the need of knowing CSS!)
As an example, I just picked a design from oswd: (example!)
http://static.oswd.org/designs/1547/Greenday/
As you can see, there is a grey header and a green area below.
If this would be an impresspages website, all the widgets (images, texts, etc) could be edited.
But what's about the look and feel of the blocks?
Let's assume, the site's administrator (who does not know html, css, etc) wants to change the background-color or wants to set a background-image for the (formerly) green area.
*) What would he/she need to do? Any "click to edit" option?
*) Where would he/she need to click, to get the config options as GUI like for the widgets?
I'd expect a wheel-icon like for the widgets where the "skin" of the block can be changed.
Can blocks have skins? Beside skins, I'd need a real config dialogue window where the site admin can chose the color, background image, etc.
This is honestly very important - I hope there is a solution!
2)
What is the easiest way to create a plugin for the administration area where options can be set?
I want to show a javascript based color picker where the overall background color can be chosen.
The HelloWorld Plugin was a good start, and I was able to save a value:
ipSetOption('HelloWorld.backgroundcolor', 'ff0000');
I was also able to print the value in the frontend.
*) But, I was not able to add a form field
I tried it the ImpressPages like way:
$form = new \Ip\Form();
$field = new \Ip\Form\Field\Text(
array(
'name' => 'bgcolor',
'label' => __('bgcolor', 'Ip-admin', false),
));
$form->addField($field);
*) And I was not able to find out how to add a color picker.
3)
Are there simple widgets planned like the following ones?
*) Comments (per page)
*) Guestbook
*) Polls
*) Print page
*) Recommend page to a friend (mail)
etc...
Would I need to program them all myself, or will they come out in the next time?
Thank you very much in advance!
ImpresspPages is very new and agile tool. It lack many plugins you have mentioned. One day they will all come to the world. We have more and more plugins each day. I would say use ImpressPages for project where ImpressPages has everything needed.
Regarding the background. I would go for theme options. It is not suitable if you want to change background for particular widget. But should work great to change the background for the whole page.

Flag module - link's position change (Drupal)

I've just installed Flags module and it looks awful when on the bottom I see "Flag this item" link. The only thing I've found in configuration is enabling it to show as normal link. Still I haven't found how to change position of this link. Is it even possible to change link's place? I have installed CCK Blocks but it doesn't give me any option to get rid of it. If someone know or suspect what's possible - please help me.
Try the Display Suite module, this module is integrated with many modules like flag, title etc...
Display Suite allows you to take full control over how your content is displayed using a drag and drop interface. Arrange your
nodes, views, comments, user data etc. the way you want without having
to work your way through dozens of template files. A predefined list
of layouts (D7 only) is available for even more drag and drop fun!
https://drupal.org/project/ds
You can move and generate custom layouts for the fields/properties on the entity display formatter: teaser, full...

Mapping a widget template to a user control in SiteFinity 5

(Crossposted in SiteFinity's forums)
I'm using SiteFinity 5.0. I created a custom module, using the module builder, called Promos. It's content type is called Promo.
Next, I created a new widget template called PromoFlexSpace. I basically copied the auto-generated template for a single Promo display and changed it a bit.
What I would like to do is globally map this widget template to a user control, so that any time that template is selected, it actually uses my user control. I've found how to do this for an individual item:
http://www.sitefinity.com/documentation/documentationarticles/designer-s-guide/widget-templates/using-external-widget-template-file
http://www.sitefinity.com/blogs/joshmorales/posts/11-05-10/mapping_external_templates_for_sitefinity_4_widgets.aspx
And I found something that came close to explaining what I'm trying to do on a global level:
http://www.sitefinity.com/blogs/joshmorales/posts/11-07-26/customizing_sitefinity_4_controls_with_the_viewmap.aspx
But I haven't found a way to accomplish what I'm trying to do yet (apologies if that last link actually does explain it - I need a better breakdown if it does).
What I've tried so far is going into the advanced settings > controls > view map and adding an entry there, but I can't find a value for HostType that works.
If you go to Administration > Settings > Advanced > Toolboxes > ... > [Your Widget Control] there's a setting for "LayoutTemplate" where you can enter a path to an .ascx file.

Sitefinity 4.4 - Dynamically change page title and description at runtime

Does anyone know how to dynamically change the page title in Sitefinity from a regular user control?
Our scenario is simple. We have a real estate website with a search feature. On the search results page we have a control showing the search results, but we need to be able to change the Page title, description and keywords based on the search performed.
We posted on Telerik, but they gave vague answers and pointed us to incorrect objects or objects that didn't actually work.
?
Regards,
Jacques
The way I've usually done this in the past is by using an external widget template.
By mapping your widget template to an external file, you can use a full User Control (.ascx file) which means you can also run code behind.
From there it's just a matter of running something like
Page.Title = "whatever";
For more info on using an external template for Sitefinity Widgets, check out this post: http://www.sitefinity.com/blogs/joshmorales/posts/11-05-10/mapping_external_templates_for_sitefinity_4_widgets.aspx
Hope this is helpful!