簡體   English   中英

AddThis需要共享由js生成的自定義URL

[英]AddThis need to share custom url generated by js

我需要使用facebook / twitter / email按鈕與加載的照片共享頁面。 照片表格的腳本是幾年前由一位離開的同事編寫的,我得出的結論是我無法自定義此內容。 我已經包含了盡可能多的信息。 謝謝!

編輯:我可以為任何想為此刺死的人提供wp登錄詳細信息。 非常感謝!

  1. 轉到此頁面:etncal.staging.wpengine.com/community-event-photos/
  2. 輸入ID#09070073,單擊獲取照片按鈕
  3. 加載新頁面,URL將顯示為:etncal.staging.wpengine.com/download-your-community-event-photos/?photo=090700731381779074495
  4. 參數已傳遞到url,輸入的照片代碼為前8位數字
  5. 共享此按鈕鏈接到不帶參數的頁面網址-因此,共享沒有加載圖像的空白頁面。 需要使用唯一的網址和照片共享頁面。

社區事件照片表單使用兩頁:

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM