XF 2.2 Social Share

ChrisTERiS

Well-known member
  1. What's the template syntax that I can use to show Social Share icons in a specific part of a page?
  2. How I can set a default image for og:image?
Thank you
Chris
 
The template is share_page_macros but it really depends what you are trying to do and on which page.

Search for metadata to locate where to set the share image.

1605804715350.webp
 
I want to show this block
1605804895617.png
to page header and footer. My theme has some blocks there which support html. If it does not works that I'll modify XF templates.

Have found before something doing this with "include XXXXXX template". But it was for XF1, and worst of all, can't find that article again.

Thank you for the reply.
 
You want to use something like this:
HTML:
<xf:macro template="share_page_macros" name="buttons" arg-iconic="{{ true }}" arg-label="{{ phrase('share:') }}" />
and these are the currently available arguments for that macro with their defaults:
Code:
arg-iconic="{{ false }}"
arg-hideLink="{{ false }}"
arg-label=""
arg-pageUrl=""
arg-pageTitle=""
arg-pageDesc=""
arg-pageImage="
Refer to share_page_macros template to make more sense.
 
This is how that template is embedded on various pages:

HTML:
<div class="blockMessage blockMessage--none">
    <xf:macro template="share_page_macros" name="buttons" arg-iconic="{{ true }}" arg-label="{{ phrase('share:') }}" />
</div>
 
I'm grateful to both of you. I must accept the fact that I became too old and my mind is not working properly :rolleyes: I wasted a full day trying to make it to work in a page node where I've added at the top:

CSS:
.shareButtons {
    display:none
}

And I was wondering why it does not works.
 
Top Bottom