by-expession

Expression Web Resources

Variables

Latest post 08-23-2007 11:46 AM by cdwise. 12 replies.
  • 02-10-2007 2:22 PM

    Variables

    I have a page called Staff on my site that list club staff members and their email addresses as mailto: links so users can send them email. On other pages in the web site I also have references to staff members with their email addresses as links.

    The problem comes when a staff member changes their email address. I have to go to each page and change it. If i happen to miss one, I have a bad link.

    I would like to be able to set variables somewhere and then use that variable in the mailto: link. That way I could make one change in the variable definition that would update all the mailto: links on all pages on the site.

    Is this possible? If yes, how would it be done? 

    Bob Crawford
  • 02-10-2007 2:54 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 532

    Re: Variables

    I'd suggest a form with a dropdown to select the person to send the form to.  If you use a server side processing script you will cut way down on spam when new addresses are used. mailto links get harveste pretty quicly

     

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

    Filed under:
  • 02-10-2007 3:23 PM In reply to

    Re: Variables

    I agree that spam can be a problem when email addresses are harvested from web pages. For that reason if replace a letter or two in the address with code so when it is harvested it won't work. For example mailto:username@ezwebz.com would become mailto:username@ezwebz.com. The a becomes an a when you click on the link to send email but the harvested address username@ezwebz.com is useless and won't go to anyone.

     Using a dropdown and server side processing script still won't solve the problem of updating multiple instances of the mailto: link.
     

    Bob Crawford
  • 02-10-2007 4:07 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 532

    Re: Variables

    User server side processing and on the form you don't have a mailto link. You have a name and a value. The value then looks to your list of variable and sends the form from the server not from the individual's email client.

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 02-10-2007 4:43 PM In reply to

    Re: Variables

    That's really neat! Would the more universal change using @ for the @ work well too?

  • 02-10-2007 5:06 PM In reply to

    Re: Variables

    I understand what you are saying. You are most likely 100% correct. However I am not asking about using forms, server side anything, or ...

    I am asking if you can store variables somewhere on the web site and them use them on multiple pages so that if you need to change the value of the variable you can do it in one place and not have to update every page?

     

     

    Bob Crawford
  • 02-10-2007 5:16 PM In reply to

    Re: Variables

    Not sure if @ to replace the @ would work because I have never attempted it although I don't see why not. 

    It could be an interesting experiment. If you replaced the @ maybe the BOTs would just pass the code on by. I am sure the mining programs are looking for keywords line mailto: and then parsing the address. It is quite possible that if they don't find the @ it would just move on figuring it to be an invalid email address. I don't know how the mining bots work but maybe someone else does and can let us know.

    Bob Crawford
  • 02-10-2007 5:20 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 532

    Re: Variables

    Not as variables per se but you can use an include file if you just want a list of addresses.

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 02-10-2007 5:39 PM In reply to

    Re: Variables

    Thanks that answers my question on variables. I can see where includes would be very useful in some cases however it would seem to be cumbersome for what I need. I have one page that includes all staff and other pages that have only one or two of the staff. Using includes for that would mean having to have a separate page for each staff member.

    I think what I will do is put a note in my Website book noting were every reference to staff members is located so I won't miss one when an update is needed.

     

    Bob Crawford
  • 02-10-2007 7:34 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 532

    Re: Variables

    Why not just use find/replace with the old email address for the new?

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 02-10-2007 7:41 PM In reply to

    Re: Variables

    I'm sure that would work but can you do that for the whole site (all pages at once)? Or, would I need to open each page and repeat the find/replace function?
    Bob Crawford
  • 08-23-2007 1:54 AM In reply to

    • ColRam
    • Top 50 Contributor
    • Joined on 04-04-2007
    • Posts 3

    Re: Variables

    Hi Bob,

    I realise that this thread dates from February, but as I see you are still posting this week, I figure it'll be alright to add my suggestion to this, as you'll still receive it.

    When it comes to variables, you can indeed use Javascript to update things such as email links, and do it on the client.

    I had a similar conundrum to your situation where I used glossary popup descriptions for specific words in the topics. After much consternation with scripting, it became much simpler to link to the term in the glossary, than to script its definition into every use of the word throughout the site.

    Perhaps this solution will be suitable for you too? Just link from each person's name throughout the site, to that person's details in a common email list topic. Then you only need to maintain just one central repository list of email addresses.

    Food for thought.

    Colin Ramsden

    www.lotechsolutions.com

  • 08-23-2007 11:46 AM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 532

    Re: Variables

    You can't use variables without using scripting either server side or javascript.

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

    Filed under:
Page 1 of 1 (13 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems Sponsored by: Start to Web
@ 2005-2008 Cheryl D Wise