src/WebBundle/Resources/views/Common/social-block.html.twig line 1

Open in your IDE?
  1. {# do not remove classes "item" "facebook,instagram etc" and "count", it works 
  2.    for realtime update counters!
  3.    strategy: static nums - 1 in a 24h grabber gets static num. 
  4.    +every user open this page, it will receive updated via api's engine (3-60 sec !!!) #}
  5. <div id="social-te"
  6.      style="display: none;"  
  7.      class="hide js-social-te-config"  
  8.      data-social="{ 
  9.         'facebook_user':'{{ social.fb is defined ? social.fb.login }}',
  10.         'facebook_token':'{{ social.fb is defined ? social.fb.token }}',
  11.         'instagram_user':'{{ social.in is defined ? social.in.login }}',
  12.         'instagram_token':'{{ social.in is defined ? social.in.token }}'
  13.         'pinterest_user':'{{ social.pn is defined ? social.pn.login }}',
  14.         'twitter_user':'{{ social.tw is defined ? social.tw.login }}',
  15.     }" {# use js to convert this string to object #}
  16. ></div>
  17. {% if social.fb is defined %}
  18.     <div class="pics">
  19.         <a target="_blank" rel="noopener" href="{{ social.fb.link }}" class="fb item facebook">
  20.             <span class="img"></span>
  21.             <span class="num count">{{ social.fb.val }}</span>
  22.         </a>
  23.     </div>
  24. {% endif %}
  25. {% if social.tw is defined %}
  26.     <div class="pics">
  27.         <a target="_blank" rel="noopener" href="{{ social.tw.link }}" class="tw item twitter">
  28.             <span class="img"></span>
  29.             <span class="num count">{{ social.tw.val }}</span>
  30.         </a>
  31.     </div>
  32. {% endif %}
  33. {% if social.pn is defined %}
  34.     <div class="pics">{% set pinlink = social.pn.link ~ '/pins/' %}
  35.         <a target="_blank" rel="noopener" href="{{ pinlink | replace({ '//pins' : '/pins'}) }}" class="pn item pinterest">
  36.             <span class="img"></span>
  37.             <span class="num count">{{ social.pn.val }}</span>
  38.         </a>
  39.     </div>
  40. {% endif %}
  41. {% if social.in is defined %}
  42.     <div class="pics">
  43.         <a target="_blank" rel="noopener" href="{{ social.in.link }}" class="in item instagram">
  44.             <span class="img"></span>
  45.             <span class="num count">{{ social.in.val }}</span>
  46.         </a>
  47.     </div>
  48. {% endif %}
  49. {#total:<div class="total"></div>total followers AS IS 100000  100000000 etc (new)
  50. <a title="Total Followers">
  51.     <div class="pics">
  52.         &sum;:&nbsp;<span class="num total_k">...</span>
  53.     </div>
  54. </a>{# total followers like 529k or 8.5m etc, (new) #}