No bug Problem displaying buttons

More
1 year 5 months ago - 1 year 5 months ago #2305 by Hervé
Problem displaying buttons was created by Hervé
Hello Ruud
On blog pages like
clibre.eu/alternatives-aux-gafam
or clibre.eu/infos-sur-le-libre

There are articles with
a) the login buttons and
b) the whole article of "LoL, une affaire sérieuse".

I don't want the buttons on the blog pages and I would like to truncate the article like the others with
Code:
<?php if (stripos($this->item->introtext, 'iframe') !== false) { echo $this->item->introtext; }// INIT ou obligé pour avoir la vignette vidéo avec le plugin ochFitvids else {echo JHTML::_('string.truncate', strip_tags($this->item->introtext, ['br','img','iframe','b','strong']), 300, true, true) ;} ?>


Regards 
Last edit: 1 year 5 months ago by Hervé.
The topic has been locked.
More
1 year 5 months ago #2308 by Ruud van Lent
Replied by Ruud van Lent on topic Problem displaying buttons
Hi Herve,

I do not understand completely. This is what I think I am seeing:

on the blog pages there are articles with and without jssocials buttons. The ones WITH the buttons (I think) have a read more, the ones WITHOUT do not have a read more in the text.
that would also explain why the truncate code you have is not working: you are truncating the introtext but on the articles without a read more this is empty and instead the full text is displayed (which is not truncated / stripped by your code).
The topic has been locked.
More
1 year 5 months ago #2309 by Hervé
Replied by Hervé on topic Problem displaying buttons
Hi Ruud
There is no different structure between the articles.
If I remove :
<p><ii src=" www.YTTT.com/embed/JwEOx_zZLnw" width="560" height="314" allowfullscreen="allowfullscreen">



I don't have the buttons displayed anymore and the truncation is correct (see picture)
If you want I can give you access and send the overload file by mail to understand.


I sent the image by mail because I can't insert it here!
Regards

 
The topic has been locked.
More
1 year 5 months ago #2310 by Ruud van Lent
Replied by Ruud van Lent on topic Problem displaying buttons
Hi Herve,
I do not understand what the issue is. do you mean login buttons or social share buttons (jssocials). Can you 'draw' on the image you send me what is missing or what needs to be removed?
The topic has been locked.
More
1 year 5 months ago #2311 by Hervé
Replied by Hervé on topic Problem displaying buttons
Hi
I want the same type of display whether there is a video or not!
I have sent the image just as I want it.
To compare with clibre.eu/infos-sur-le-libre
The topic has been locked.
More
1 year 5 months ago #2312 by Ruud van Lent
Replied by Ruud van Lent on topic Problem displaying buttons
Hi,
in the  ochJSsocials plugin tab "auto buttons" you can configure to not display the buttons in featured / categories views.
If you set this to 'No' they will not show on the page you provided.

Could you try that?
 
The topic has been locked.
More
1 year 5 months ago #2314 by Hervé
Replied by Hervé on topic Problem displaying buttons
Hi
Ok for hiding the buttons on the blog page (sorry, it was simple, but strange because hidden if there was no video!?)
Otherwise the conflict remains with the video preventing truncation on the blog page.
I sent the file (blog_item.php)  to see if you could solve this problem
Regards
The topic has been locked.
More
1 year 5 months ago #2316 by Ruud van Lent
Replied by Ruud van Lent on topic Problem displaying buttons
Hi,
can you add a readmore in article "LoL, une affaire sérieuse"?

Because there is no read more, there is also no introtext so your truncation logic doesn't work.
The topic has been locked.
More
1 year 5 months ago #2317 by Hervé
Replied by Hervé on topic Problem displaying buttons
Hello Ruud
This bothers me, because on this site and another with the same architecture, other people (collaborative site) can add a video from time to time.
They will have trouble understanding the input variants.

I know it comes from my IF ... ELSE (which I had found, last time in another thread, to see the video thumbnail).
Would you see a solution to have the thumbnail AND the beginning of the article text by adapting blog_item.php a bit?
The topic has been locked.
More
1 year 5 months ago #2318 by Ruud van Lent
Replied by Ruud van Lent on topic Problem displaying buttons
What you could do is get the iframe from the text and replace it with e.g. '[.]'. then truncate the text. then replace the '[.]' with the iframe.
That way the text is truncated without the iframe that counts as length.

or
you now truncate on 300. You can also get the length of the iframe in the text and add that to the 300. So if the length is 100 then truncate on 400

I think the last is easiest
The topic has been locked.