[英]AddThis need to share custom url generated by js
我需要使用facebook / twitter / email按鈕與加載的照片共享頁面。 照片表格的腳本是幾年前由一位離開的同事編寫的,我得出的結論是我無法自定義此內容。 我已經包含了盡可能多的信息。 謝謝!
編輯:我可以為任何想為此刺死的人提供wp登錄詳細信息。 非常感謝!
社區事件照片表單使用兩頁:
1]頁面,格式為:etncal.staging.wpengine.com/community-event-photos/
添加到此頁面正文的代碼:
[js]varUnique=new Date().getTime() //will always be unique
function CheckForm() {
var photoID = document.photoForm.photoID.value;
var numericExpression = /^[0-9]+$/;
var eightdigit = /^\d{8}$/;
if(photoID.match(eightdigit)) {
var urlID = (photoID.concat(varUnique));
var newURL = 'http://etncal.staging.wpengine.com/download-your-community-event-photos/?photo=';
location.href=(newURL.concat(urlID));
return false;
} else {
alert('Please enter the eight digit number for your photo ID.');
return false;
}
}[/js]
2]加載圖像的頁面:etncal.staging.wpengine.com/download-your-community-event-photos/
添加到此頁面正文的代碼:
<div class="clear-mg"></div>
<div class="photo">[js]
displayPhoto();
[/js]</div>
同一wordpress頁面的標題中包含指向以下js文件的鏈接(單擊“添加媒體”右側的第二個按鈕,使用插件添加):etncal.staging.wpengine.com/wp-content/themes/canvas_child/js/ photos.js
照片位於此處:etncal.staging.wpengine.com/wp-content/themes/canvas_child/images/community/photos/
問題是您將addthis:url參數設置為與地址欄不同的值。 這是您頁面上的代碼:
<div addthis:url='http://etncal.staging.wpengine.com/download-your-community-event-photos/' addthis:title='Download Your Community Event Photo ' class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
</div>
您需要將addthis:url參數設置為圖片頁面的URL 或將標簽設置為圖片頁面的URL。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.