Attributes dependent on other attributes?

Questions about phpList features (the answer is probably 'Yes!')
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

Attributes dependent on other attributes?

Postby spidersilk » 2:12am, Thu 07 May, 2009

Does PHPlist offer any way to make certain attributes dependent on other attributes -- i.e. to have a list of US states show up if a subscriber selects US as their country, a list of Canadian provinces if they select Canada, etc?

Or failing that, is there at least some way not to have any particular state or province automatically selected if I have to display all of them for everyone? Having lists of states and provinces for several different countries all displayed at once is awkward enough, without having it default to everyone being simultaneously in Alabama, Alberta, etc. by showing the first entry in each list as selected. (I'm using the predefined country/state/etc. lists). I really don't want to have it include all the non-Canadians if I were trying to do an e-mail to everyone in Alberta, for example...

Without that, it would seem that the predefined attributes aren't very usable... :(

Oh, and a second question: is there any way to generate a small subscribe box that could be placed on the main page of a site, or in a sidebar on all pages or something, rather than have people have to go to a separate page?

From what I've read, requiring people to click through to separate page usually cuts your subscription rate down to a fraction of what it would otherwise be... There are always going to be a small number of people who are determined enough to subscribe that they'll do it no matter how many hoops they have to jump through, and a larger number that aren't interested no matter how easy you make it, but in between those two extremes there are a whole lot of people with varying levels of interest, most of whom are more like to subscribe the easier you make it.
spidersilk
phpLister
 
Posts: 6
Joined: 8:32am, Tue 25 Apr, 2006
Location: Toronto, ON, Canada

Re: Attributes dependent on other attributes?

Postby H2B2 » 2:54am, Thu 07 May, 2009

To start with your last question: yes you can place a custom subscribe form on an existing page of your site. Please see http://docs.phplist.com/CustomSubscribeForm

I don't think phpList has a feature to conditionally display select lists on your subscribe form. However, using the above method to build a subscribe form may possibly open the way to include a javascript solution to achieve what you want, that is, if you can get javascript to conditionally display the select lists. I suppose you should find a number of usable javascript examples on the web.

In order to avoid having select type values preselected, you can use the EMPTY_VALUE_PREFIX setting in config.php:
Code: Select all
# empty value prefix. This can be used to identify values in select attributes
# that are not allowed to be selected and cause an error "Please enter your ..."
# by using a top value that starts with this string, you can make sure that the
# selects do not have a default value, that may be accidentally selected
# eg. "-- choose your country"
define('EMPTY_VALUE_PREFIX','--');
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: Attributes dependent on other attributes?

Postby spidersilk » 4:28am, Thu 07 May, 2009

Thanks for the reply!

It sounds like the method to get the selects to show up in a semi-useful manner is basically the same as the method to create a custom subscribe box to be used on other pages -- i.e. use the subscribe pages PHPlist generates as raw material for creating a new one. At least, I can't think of any way to add the Javascript to the selects on the automatically generated page... The bits of HTML that it lets you edit don't include the code for the actual selects. Probably wouldn't be too hard to do, though.

The only problem I can think of with that solution is that subscribers also have a details page they can log in and edit, correct? That seems like it would be harder to create a custom version of, since it needs to draw data from the database. So I'm not sure how I would stop all the state and province selects from showing up at once there... I am starting to think that maybe the idea of being able to send out targetted event announcements to people in specific areas may not be feasible after all. It's not absolutely critical that I be able to do that, but I had thought it would be nice for people to just get the announcements that are relevant to where they are... Someone in Vancouver or London probably doesn't care much about an exhibition opening in New York. But even if I just included country and left out state and province, it'd still allow at least a little bit of targetting.

Oh, one other question, while I'm on attributes -- I've created a subscribe page, but the attributes on it seem to be showing up in reverse order. I set the display order to what I wanted it to be (first name, last name, country, Canadian province, US state) both in the global attributes settings and in the subscribe page settings (though it doesn't appear to save them there), but it kept displaying them backwards. So I tried reversing the numbers, putting 5 for the one that was supposed to be first and so on down to 1 for the last, but that didn't make any difference. Am I doing something wrong, or is the display order feature just not implemented yet or something?
spidersilk
phpLister
 
Posts: 6
Joined: 8:32am, Tue 25 Apr, 2006
Location: Toronto, ON, Canada

Re: Attributes dependent on other attributes?

Postby H2B2 » 8:57pm, Thu 07 May, 2009

Attribute deletion issue split from this thread and moved to the bug discussion section: viewtopic.php?f=17&t=24505&start=0
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: Attributes dependent on other attributes?

Postby H2B2 » 9:00pm, Thu 07 May, 2009

H2B2 wrote:Attributes order of listing issue split from this thread and moved to the bug discussion section: viewtopic.php?f=17&t=24505&start=0
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: Attributes dependent on other attributes?

Postby Bigrad » 9:15am, Sat 10 Oct, 2009

yes you can place a custom subscribe form on an existing page of your site.

You realy can do it?
Bigrad
phpList newbie
 
Posts: 1
Joined: 6:56pm, Tue 06 Oct, 2009


Return to Does phpList do this?

Who is online

Users browsing this forum: No registered users and 2 guests

cron