Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom urls and uploading #59

Open
kennethbrent opened this issue May 20, 2021 · 1 comment
Open

Custom urls and uploading #59

kennethbrent opened this issue May 20, 2021 · 1 comment

Comments

@kennethbrent
Copy link

kennethbrent commented May 20, 2021

Can we add custom urls similar to how we add custom socials? Something like vcard.url[custom] = 'http://mycustomurl.com'.
From what I can tell the only options right now are url and work url and in my scenario url is used by their website and 'work' is not the appropriate title or category for the additional url i want to add. Also, what if we had 3 urls?

@vijaysolankiii
Copy link

add this following code inside node_modules/vcards-js/lib/vCardFormatter.js
if (vCard.socialUrls) {
let index = 0;
for (var key in vCard.socialUrls) {
index++;
if (vCard.socialUrls.hasOwnProperty(key) && vCard.socialUrls[key]) {
formattedVCardString += "item" + index + ".URL:" + vCard.socialUrls[key] + nl();
formattedVCardString += "item" + index + ".X-ABLabel:" + key + nl();
formattedVCardString += "X-SOCIALPROFILE" + encodingPrefix + ";type=" + key + ":" + e(vCard.socialUrls[key]) + nl();
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants