[plugin] Conditional Placeholders

3rd party code for phpList

[plugin] Conditional Placeholders

Postby arnoldvl » 5:17pm, Thu 16 Jan, 2014

I have created a plugin to allow the use of conditional placeholders in messages, templates, and in the subject line. When such a placeholder is without a value for a particular subscriber, the section of text containing the placeholder is replaced by alternative text.

The plugin defines a new kind of placeholder. The standard square bracket placeholders are ignored by the plugin. See the Conditional Placeholder Plugin page for further information.
Last edited by arnoldvl on 2:28am, Mon 20 Jan, 2014, edited 2 times in total.
arnoldvl
PL Nut
 
Posts: 18
Joined: 4:06pm, Mon 30 Dec, 2013
Location: Texas

Re: [plugin] Conditional Placeholders

Postby arnoldvl » 5:19pm, Sun 19 Jan, 2014

This plugin has been updated to allow configuration of the placeholder syntax. You can configure the keywords serving the 'if', 'else', and 'endif' functions to be just one character if you wish. You can also select the form of the form of the brackets to appear around keywords and placeholders.

Using this plugin, you can have both standard placeholders and conditional placeholders in the subject line. You can also use conditional placeholders in a template.
arnoldvl
PL Nut
 
Posts: 18
Joined: 4:06pm, Mon 30 Dec, 2013
Location: Texas

Re: [plugin] Conditional Placeholders

Postby pob3444 » 8:43pm, Sun 26 Jan, 2014

Not sure I'm installing this correctly. Since the only function I want is placeholders in subject lines, I've looked into that plugin too, and couldn't figure out how to install that either : (

The subject placeholder plugin recommends using "Plugin Manager". I don't know what that is. I don't see anybody on the forums talking about it.

As for Conditional Placeholder, I followed your instructions. Put the .php file in phplist/admin/plugins and also put the subdirectory in that same folder, containing the config file in it.

I then edited the config file to replace the brackets with '{' '}'

And that's about as far as I get. I've tried new attributes with all upercase, lowercase, different types of brackets... Everything just comes through as it's typed. Not sure what I'm missing.

Is there some special way to name the attributes? Is this example correct: the Attribute is FIRSTNAME, and the subject is Hello {FIRSTNAME}
pob3444
phpList newbie
 
Posts: 3
Joined: 8:41pm, Sun 26 Jan, 2014

Re: [plugin] Conditional Placeholders

Postby pob3444 » 8:47pm, Sun 26 Jan, 2014

Forgot to mention I still get "The plugin root directory is not writable, please install plugins manually" when I click Config>Plugins.

Not sure if that's relevant
pob3444
phpList newbie
 
Posts: 3
Joined: 8:41pm, Sun 26 Jan, 2014

Re: [plugin] Conditional Placeholders

Postby Dragonrider » 9:02pm, Sun 26 Jan, 2014

pob3444 wrote:Forgot to mention I still get "The plugin root directory is not writable, please install plugins manually" when I click Config>Plugins.

Not sure if that's relevant

What version of phpList are you running please?

The "Plugin Manager" referred to is the plugins page in the admin pages.
My sites:- http://wharfedalefestival.co.uk, http://ilkleygardeners.org.uk, http://emergencyaid.net, http://dragonrider.co.uk
Latest phpList version is now 3.0.12 (3 February 2015) and requires a minimum of MySQL 5.0 and PHP 5.3.x
Dragonrider
Moderator
 
Posts: 3460
Joined: 6:58am, Sun 02 Jul, 2006
Location: Ilkley, West Yorkshire, United Kingdom

Re: [plugin] Conditional Placeholders

Postby pob3444 » 9:25pm, Sun 26 Jan, 2014

Fresh install of 3.05

Ok, got the plugin manager working by editing the config.php file, and installed "subjectlineplaceholders" and it is working.

Now to get conditional placeholders working, because I would like to use those features
pob3444
phpList newbie
 
Posts: 3
Joined: 8:41pm, Sun 26 Jan, 2014

Re: [plugin] Conditional Placeholders

Postby arnoldvl » 2:22pm, Wed 19 Feb, 2014

Sorry about not replying sooner. I was travelling for two weeks and off the net for most of the time.

Anyway, I would advise checking to make sure that the plugin is enabled. That happens automatically in my installation, but I don't know if that would be true for others.

There is a new version of the plugin, with greatly expanded capabilities. If any issues arise, I will be happy to work with you to fix them. Contact me directly at alesikar {AT} mac {DOT}com.

Mod Edit: Never post your email in "the clear" on ANY forum, or other website for that matter, for your own safety/prevent spam bot harvesting.
arnoldvl
PL Nut
 
Posts: 18
Joined: 4:06pm, Mon 30 Dec, 2013
Location: Texas


Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 1 guest