How do you get the output of a custom field as input into a javascript? Thanks, probably a dumb question.
Reported on Movable Type 5
How do you get the output of a custom field as input into a javascript? Thanks, probably a dumb question.
Reported on Movable Type 5
You will have to add the modifier:
encode_js="1"
Sample:
<mt:If tag="EntryDataCustomField"><mt:EntryDataCustomField encode_js="1"></mt:If>
Kind Regards,
Mihai Bocsaru
----------------------------------
Daily Movable Type Consultant
Web Development
Movable Type Consulting
Six Apart Partner
http://www.pro-it-service.com/
----------------------------------
Movable Type Demo
http://www.movabletypedemo.org/
Mihai, I think you left off the sample code.
Here is the script that I want to use:
Each of our authors has a custom field for their website. I would like to replace the reference to the http with the custom field tag - because I don't want to hard code each author's website.
I've stripped the angle brackets above...
Sorry, didn't strip out the brackets. Here is the relevant part of the java script. I want the http reference to come from the Custom field I created for the user. So, what should I replace CUSTOMFIELD with in this script?
script type="MemberProfile" data-id="http://CUSTOMFIELD" data-format="inline" data-related="false"
I am assuming from Mihai's answer that I should use:
script type="IN/MemberProfile" data-id="" data-format="inline" data-related="false"
You could use something like this:
<script type="IN/MemberProfile" data-id="<CUSTOM_FIELD_TAG encode_js="1">" data-format="inline" data-related="false"></script>
Well, here is what I used:
script src="//platform.linkedin.com/in.js" type="text/javascript"/script
script type="IN/MemberProfile" data-id="" data-format="inline" data-related="false">/script
But, data-id isn't passing the value of the custom field.
You can see it here:
http://www.franchise-info.ca/cooperative_relations/2012/04/balanced-standards-and-bill-ab-2305.html
You're missing the mt: prefix for the custom field tag.
Thanks for pointing out that error. Appreciate it. Now it is working: http://www.franchise-info.ca/cooperative_relations/2012/04/balanced-standards-and-bill-ab-2305.html
You're welcome!