Graham
Mwebvendor I think they still get redirected to xtgem at some point if only for the confirmation
Mwebvendor
Graham how to add total count of comment inside {% block entry_comments_list %}
Graham
Mwebvendor The total comments is not in the data array.
You can do it but it involves creating a twig template switcher and adding a extra blog function on the page then inserting the value with javascript
plus it can be a bit slow as basically it loads the
entire post list and totals the comment counts and if you put the extra blog function above the main blog it changes the value of
__xtblog_block_id to 2 (that's what it's for, to identify multiple blog functions on a single page)
so the javascript needs to go below the main blog function
Rename xtblog.twig to blog.twig and create a new xtblog.twig with this code
{% if 'counter' in data.translations.t_no_entries_found%}
{%include 'com_count.twig'%}
{%else%}
{%include 'blog.twig'%}
{%endif%}
Copy code Create a new file in
_xtgem_templates called
com_count.twig{% if view == 'entries_list' %}
{% set count=0 %}
{% for entry in data.entries %}
{% set count = count+entry.comments_count %}
{% endfor %}
{{ count }}
{% endif %}
Copy code Then use this to provide the value to js
<xt:blog entries_per_page="0" version="2" t_no_entries_found="counter" />
Copy code
Mwebvendor
I know it is prohibit, but i want to ask,
It is possible to remove the xtgem ads in embed code?
If i add sub-link in embed code and the xtgem ads will appear. and if i view the whole code of my page its showing like this.
<embed src="http://mysite.com/embed/sub-link.html" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="500" height="400"></embed>
Copy code
but if i use the XT:INCLUDE instead of embed.
the all code of my sub link will show in my page..
In that point, it is possible to hide the ads if ever i used embed?
Graham
Mwebvendor In a word 'no' it won't work ( i have tried) its the same as trying to add iframes with a xtgem html page as a source the xtgem parser rears it's head and inserts all the usual code like headtags headers the analytics scripts meta tags and ads
Consider using a XHR in javascript or jquery as unlike embed you can manipulate the data before it is output but support is not 100% and it's probably quite a bit slower
Mwebvendor
Graham ok graham,, a understand...
Mwebvendor
Good day graham,,, can i add default thumbnail for guest? in xtblog comment?
Graham
Mwebvendor just add your image tag in front of
{{ comment.nick }}
in the
{% macro comments_list (comments, ctx) %}
Mwebvendor
Mwebvendor {% if comment.author_profile %}
<img class="img-responsive" src="/img/user.jpg" />
<a href="{{ comment.author_profile.link }}">
<figcaption class="text-center">{{ comment.author_profile.name }}</figcaption>
</a>
{% else %}
<figcaption class="text-center">{{ comment.nick }}</figcaption>
{% endif %}
like this?