 |

MAGSGQ
User
May 16, 2003, 6:39 AM
Post #1 of 4
(1469 views)
Shortcut
|
|
You need to append special suffixes to placeholder names
|
Can't Post
|
|
Can someone explain this a bit more and where/why I would use it? You need to append special suffixes to placeholder names when using them in certain HTML constructs. In links, append _ue e.g. <a href="$lfield5_ue$"> In form values, append _he e.g. <input name="x" value="$lfield5_he$"> In javascript, append _je e.g. <script>document.write("$lfield5_je$");</script>
(This post was edited by MAGSGQ on May 16, 2003, 6:39 AM)
|
|
|  |
 |

Benjamin
Staff

May 16, 2003, 3:47 PM
Post #2 of 4
(1456 views)
Shortcut
|
|
Re: [MAGSGQ] You need to append special suffixes to placeholder names
[In reply to]
|
Can't Post
|
|
Hey Magsgq, The following is slated for inclusion in the online doc, but it wouldn't hurt to post it here. It's a lot more thorough concerning the three encoding options. The three following encoding options are available to you to convert the format of any listings and homepage fields. html encode: _he This renders all characters with their html-encoded equivalent; it enables you to enter in html tags into fields and have the exact string appear in your page, rather than having it automatically converted to html. This is useful in passing the information along in forms, for example. e.g. listing database field #10 contains the following value for a particular listing: <font color=”green”>This is an example<font> Compare the html-encoded versus regular placeholder on your published pages: $lfield10$: This is an example $lfield10_he$: <font color=”green”>This is an example<font> URL encode: _ue If you need to pass the value of a field into a URL string, you’ll need it to be properly URL-encoded, so that a browser knows how to correctly process it. e.g. listing database field #32 contains the following value for a particular listing. This is another “example!” Here is what would be outputted to your published page using that field’s placeholder: $lfield32$: This is another “example!” $lfield32$: This+is+another+%22example%21%22 Javascript Encode: _je (version 2.29+) This allows you to encode field values into javascript-friendly values. So, if you need to pass a field’s value into some javascript code, you should always add the _je suffix. Consider the following example. Sometimes you won’t have any data filled in for a particular field, but the name of the field will always be printed to the page. To get around this, you can do the following. Instead of having THIS in your template: Appliances: $lfield24$ (Which would always print out “Appliances” to your published page, regardless of whether or not listing field 24 contained any value), replace it with this: <script language=”javascript”> <!-- if (“$lfield24_je$” != “”) { document.write(“Appliances: $lfield24_je$”); } --> </script> <noscript> Appliances: $lfield24$ </noscript> [the <noscript> content is there for non-javascript enabled browsers]. Hope that's a bit clearer, but post me back if you have any further questions :-) Ben interactivetools.com
(This post was edited by Benjamin on May 16, 2003, 3:50 PM)
|
|
|  |
 |

MAGSGQ
User
Jun 28, 2003, 6:08 PM
Post #3 of 4
(1418 views)
Shortcut
|
|
Re: [Benjamin] You need to append special suffixes to placeholder names
[In reply to]
|
Can't Post
|
|
I think the Javascript is what I'm leaning towards. There are fields which do not contain data for every agent, so it looks as though I need a way to filter those fields out. They're getting picky and of course every freaking agent is an "INTERNET" self proclaimed GURU who thinks this site should do what Realtor.com does. My example is this: Office Phone / Office Fax / Mobile / Home Phone Not all agents are coughing up their mobile and home number so I need to remove it for those agents. The sample code should work correct?
|
|
|  |
 |

Benjamin
Staff

Jun 28, 2003, 7:58 PM
Post #4 of 4
(1415 views)
Shortcut
|
|
Re: [MAGSGQ] You need to append special suffixes to placeholder names
[In reply to]
|
Can't Post
|
|
Hi Magsgq, it's been a while! :-) Yes, the sample code should work fine - only do include the <noscript></noscript> content too, like in the example - that the content will appear on even javascript-disabled browsers. Post me back if you have any trouble with it. Ben interactivetools.com
|
|
|  |
|