1 bit Sep 11, 2007 19:25
3 laibcoms Sep 12, 2007 02:20
Yah. It says "Free HTML" to every instance of that widget.
Maybe something like the plugins, where we can rename, no, the "Block Title" reflects the widget title.
^^
4 bit Sep 12, 2007 21:23
It could (and I think it should) work this way: if I give the widget a title of "AdSense", for example, the backoffice could list it as "AdSense (Free HTML)". Maybe every widget should be listed that way (title first, then type).
5 yabba Sep 24, 2007 10:03
Crack open inc/widgets/widgets/_free_html.widget.php and change the following section of code ( approx 49 )
/**
* Get name of widget
*/
function get_name()
{
$this->init_display( array() );
$title = T_( 'Free HTML' );
if( $this->disp_params[ 'widget_title' ] )
$title .= ' ( '.$this->disp_params[ 'widget_title' ].' )';
return $title;
}
then meander down to line 72 ish and make the following change
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions( $params )
{
// Demo data:
$r = array(
'widget_title' => array(
'label' => 'Widget title',
'size' => 60,
'note' => T_( 'This is the name displayed in the widget list' ),
),
'title' => array(
'label' => 'Block title',
'size' => 60,
),
'content' => array(
'type' => 'html_textarea',
'label' => T_('Block content'),
'rows' => 10,
),
);
Hit save and hope it works ;)
¥
6 laibcoms Sep 24, 2007 14:14
It works.
Please add it to 2.0.2 :p hehehe... so don't have to edit again :p
To the curious, it will appear like this:
Free HTML ( NAMEHERE )
You will have a new field to place the name of your free HTML content:
Widget title (the new field)
Block Title
Block content
This way, you can leave your Block Title empty if needed, yet you will have a widget title so you can differentiate between your "Free HTML" widgets.
:D
Thanks ¥!
7 bit Sep 24, 2007 20:01
Yabba, I can't (and probably won't) wait to apply your patch.
I obviously think this should be permanently added to b2evo.
Thank you very much!
8 bit Sep 24, 2007 21:50
Well, yes, it definitely works. :)
9 waltercruz Sep 25, 2007 02:51
What about use Block title itself as the widget title? Makes sense to me :D
10 laibcoms Sep 25, 2007 05:02
Using the Block Title will have limitations, as I mentioned above, there are widgets you do not want to give a "Block Title". Leaving it empty will change nothing.
So having it separately is a better option, Y's once again showed us the future :p
I'm gonna move this to feature request, cos it kinda feels like it fits there.
Nice idea, not sure how easy it'd be to implement though
¥