1 draxeiro Jan 11, 2008 20:09
3 draxeiro Jan 12, 2008 10:11
Thanks for the tip :)
Is it in any way possible to have the freeHTML widget automatically display a static text?
In other words define somewhere (in the code I assume), that it has to show a certain block of text, after you switch the widget on.
4 edb Jan 12, 2008 10:31
draxeiro your Free HTML widget is exactly that: a widget that automatically displays some sort of static text. As far as I know, if you put in valid html you will see it where you position that particular widget. As soon as you install the widget you will see that you get to give it a Block title and a Block content. In the content you can put your static text, or text enhanced with good old fashioned HTML markup. :D
5 draxeiro Jan 12, 2008 10:38
Hi Edb,
I know, but thanks for the explanation anyway :)
But I mean it slightly differently. I mean setting up freeHTML in such a way that if you switch on the widget the text will already be in there.
My client is not the most computer-literate person in the world and I want to make it as easy as possible for him. So that when he creates a new blog for one of his patients it will just be a matter of switching on the FreeHTML widget and voila: instruction text already filled into that field.
It probably isn't possible and in that case I will supply him with instructions how to add the text. But if it is it would be very cool indeed.
Although I assume it will involve a bit of an hack into that particular widget.
6 edb Jan 12, 2008 11:11
Yup. So try it! Open inc/widgets/widgets/_free_html.widget.php and find something that looks suspiciously like this, then make it be something even closer. In v230RC1 it begins at line 74.
function get_param_definitions( $params )
{
// Demo data:
$r = array_merge( array(
'title' => array(
'label' => 'Block title',
'size' => 60,
),
'content' => array(
'type' => 'html_textarea',
'label' => T_('Block content'),
'rows' => 10,
'defaultvalue' => '<strong>EdB</strong> totally <a href="http://b2evolution.net">rocks</a>!',
),
), parent::get_param_definitions( $params ) );
return $r;
}
When you find the right bit in your files, and by the way I hope ALL users of anything in the 2.* series are using 230RC1 because beta users really need to keep up with the developers, you will note that the only thing I added was a line for "defaultvalue". Groovy eh?
COMPLETELY UNTESTED SO DON'T BET THE CHILDREN ON IT WORKING!
7 draxeiro Jan 12, 2008 12:17
Hi Ed,
Well, the children are safe: works like a charm.
Thanks a lot! :)
I think this will most likely come in handy for other people too so it is good to have this info on the forum now.
I would suggest you use the freeHTML widget for 2.x. That will give you more creativity.
<br> is HTML4, for B2evo have a look at XHTML
Good luck