I am trying something so I am interested if somebody knows answer. I am developing plugin that is currently calling hello_world 😊 because it is just a test.
So, problem is here. Can I do this in template?
{exp:hello_world:search tekst={maintext}}
so to have plugin that checks text of weblog that is currently displaying…
and to get that text and find some specific string in it … for example “””
any idea? can it be done this way? is there a better way? Since, data are displayed already, it seems stupid to do SQL query based on data to get that text from database, since it is already done ….
P.S.: anyone have any simple plugin that works? I need the most basic one, like hello world.
The example in the user guide is also very straightforward, and discusses what each portion of a plugin class is for. ExpressionEngine also comes with 4 very simple plugins pre-installed: Character Limiter, Randomizer, Word Limit, and XML Encode.
All attributes must be quoted:
{exp:hello_world:search tekst="{maintext}"}
However, if that content could contain quotes itself, say if {maintext} were that’s “super”!, then you’d end up with an invalid tag:
{exp:hello_world:search tekst="that's "super"!"}
When processing content from custom fields, it’s best to not use single-tag plugins, and to use paired tags and access the tagdata.
{exp:hello_world:search}{maintext}{/exp:hello_world}
The full contents of {maintext} would then be available to your template with $TMPL->tagdata.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.