Recent Topics

1 Jan 11, 2008 20:09    

My b2evolution Version: 2.x

Hiya!

My client needs to have a static instruction text displayed with every blog. So I was thinking 'sticky' and searched on the forums. Turns out that the exisiting widget doesn't seem to work on the version I am using (2.2.0).

But a solution EdB came up with in the past seemed like a good solution: Use the Long description field and put in the text there.

Since I am using the evopress skin it actually looks great to have it in that sidebar instead of at the top of the blog.

But upon using that field it turns out that not all html tags are supported.
It doesn't seem to like <br> or <p>. Though <br/> it does seem to accept.
Anyway, with some creative html I still reached my goal.

But I am left with two questions:
1. Is it possible to have the Long description field accept more html tags? Like regular postings do? What would I need to change where to accomplish that?

and

2. Is it at all possible to this long description text automatically be included on all blogs that are created? Instead of copying the text in there out of a notepad file every time?

Hope so :)

Thanks in advance!

2 Jan 11, 2008 20:48

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

3 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 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 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 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 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.


Form is loading...