会場のリストを表示するサイトで作業しており、リスト内の各会場にFoursquareの「保存」ボタンを追加したいと思います。1つのページに複数のFoursquareの「保存」ボタンを表示することは可能ですか?複数のvCardブロック(会場ごとに1つ)を作成し、各ブロックに「保存」ボタンを挿入しようとしましたが、場所が選択されていません。
3 に答える
2
のソースを調べた後widgets.js
、 「SavetoFoursquare」ボタンの属性をVCardのIDにwidgets.asyncbundle.js
設定すると、これら2つがリンクされることがわかりました。data-context
そのようです:
<div id="hcard-Station-Amsterdam-Centraal" class="vcard">
<span class="fn">
<span class="given-name">Station Amsterdam Centraal</span>
</span>
<div class="adr">
<div class="street-address">stationsplein 15</div>
<span class="locality">Amsterdam</span>,
<span class="region">Amsterdam</span> ,
<span class="postal-code">1012AB</span>
</div>
</div>
<div id="hcard-Jaarbeursplein" class="vcard">
<span class="fn">
<span class="given-name">Jaarbeursplein</span>
</span>
<div class="adr">
<div class="street-address">Jaarbeursplein</div>
<span class="locality">Utrecht</span>,
<span class="region">Utrecht</span>,
<span class="postal-code">3521AL</span>
</div>
</div>
<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-context="hcard-Station-Amsterdam-Centraal" data-variant="wide">Save to foursquare</a>
<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-context="hcard-Jaarbeursplein" data-variant="wide">Save to foursquare</a>
ただし、これが文書化されていないため、近い将来変更される可能性があります。
于 2012-02-16T10:03:26.407 に答える
0
「data-vid」でこれを試してください:
<!-- Place this anchor tag where you want the button to go -->
<br />
All In PartyRadio Studio<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="50575a55e0e27c7feb062116">Save to foursquare</a>
<br />
Sing Sing Music Hall<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4d47d1fe2165721ebe9ac0d7">Save to foursquare</a>
<br />
Retro Klub<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4d437d813616b60c2764dac2">Save to foursquare</a>
<br />
Tisza Dokk<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4f73231de4b0e3a99689cc61">Save to foursquare</a>
<br />
Zöld Zsiráf Kultúrpart<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4ffad97ef13633933ececa5f">Save to foursquare</a>
<!-- Place this script somewhere after the anchor tag above. If you have multiple buttons, only include the script once. -->
<script type='text/javascript'>
(function() {
window.___fourSq = {"uid":"606"};
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'http://platform.foursquare.com/js/widgets.js';
s.async = true;
var ph = document.getElementsByTagName('script')[0];
ph.parentNode.insertBefore(s, ph);
})();
</script>
于 2013-04-25T22:29:14.643 に答える
-1
save-to-foursquareウィジェットの進行中のドキュメントには、https: //developer.foursquare.com/overview/widgetsからアクセスできます。それらは時間の経過とともにクリーンアップされますが、これと将来のウィジェット関連の質問を支援するのに十分なはずです=)。
特に、必要な「data-context」属性に関するドキュメントは、まもなくリンク先のページにプッシュされます。
于 2012-02-23T20:10:25.957 に答える