Add Plugin Formatting
It would be great if either per variable you could specify text formatting (via available plugins) or in the templates be able to do something like {lv_this_var formatting="smarty_pants"}
It would be great if either per variable you could specify text formatting (via available plugins) or in the templates be able to do something like {lv_this_var formatting="smarty_pants"}
Replies
Low 21 Jun 2010 10:54
Hey Tim,
I've added formatting to the Textarea variable type (see docs), so you could do this with those types, using template tags like this:
{exp:low_variables:parse var="my_textarea_var" format="textile"}
If you want to add formatting to other vars, you'll need to either turn on early parsing or use the template tags, in combination with the formatting plugin tags, like this (using an early parsed var):
{exp:textile}{my_early_parsed_var}{/exp:textile}
or this (using template tags):
{exp:textile}{exp:low_variables:parse var="my_var"}{/exp:textile}
.
Tim Kelty 21 Jun 2010 11:08
Bacon Goodness.
Love it!
Kyle Batson 6 Jul 2010 14:54
This is a weird one. I used the formatting you have here on me EE2 installation. It works on my internal pages, but not on the home page.
When I load the home page it says:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: EE::$typography
Filename: low_textarea/vt.low_textarea.php
Line Number: 110
Fatal error: Call to a member function parse_type() on a non-object in /nfs/c01/h08/mnt/840/domains/bluestem.shinkadesign.com/html/bluesystem735/expressionengine/third_party/low_variables/types/low_textarea/vt.low_textarea.php on line 110
Low 6 Jul 2010 16:11
Hmm, looks like the Typography class isn't loaded in all cases, and I cannot duplicate the error, even in a completely empty template. Try this, if you will:
- Open up vt.low_textarea.php in a text editor
- Go to line #110 and add a blank line above it
- On that line add this code:
$this->EE->load->library('typography');
- Save the file.
Does that help?
Kyle Batson 6 Jul 2010 16:17
Yup, that did it! Thanks.