HTML In Posts | General Support | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
HTML In Posts
Avatar
Cesar
Member
Members
Forum Posts: 12
Member Since:
December 12, 2018
sp_UserOfflineSmall Offline
1
December 24, 2018 - 5:27 am
sp_Permalink sp_Print

I have been trying to get Twitter embeds in the description but it wont work.

There is a script in embed but I added it to the snippets module so it loads with each page now.
script async src="https://platform.twitter.com/widgets.js" charset="utf-8"script

I added those tags and allowed html.
The code works if I enter it as a comment but not if I put it in the description.

In addition there is a bug.
If I submit the comment as admin the embed works. If I come back as an anonymous to view the html comment submitted by admin (not logged in user) the embed does not work only a broken text shows up. If I log in then everything works as normal. So it appears plikli is stripping the tags even though I am not posting just viewing the page.

Avatar
redwine
Admin
Forum Posts: 341
Member Since:
February 21, 2018
sp_UserOfflineSmall Offline
2
December 24, 2018 - 6:44 pm
sp_Permalink sp_Print

"There is a script in embed but I added it to the snippets module so it loads with each page now.
script async src="https://platform.twitter.com/widgets.js" charset="utf-8"script"

1- where is the script from?
2- have you wrapped the script with {literal}CODE{/literal} as instructed at the top of the snippets module?

"I added those tags and allowed html.
The code works if I enter it as a comment but not if I put it in the description.

In addition there is a bug.
If I submit the comment as admin the embed works. If I come back as an anonymous to view the html comment submitted by admin (not logged in user) the embed does not work only a broken text shows up. If I log in then everything works as normal. So it appears plikli is stripping the tags even though I am not posting just viewing the page."

1- did you allow HTML for the 3 levels: Amins, moderators and normal?
If you don't allow it for the 3 levels, only the level that is allowed will be able to see the execution of the script in the snippets module.

IMPORTANT: There is note in red for every HTML tags to allow and it says:
NEVER ALLOW OTHER THAN THESE TAGS, ESPECIALLY FORM, SCRIPT, IMG, SVG AND IFRAME TAGS!

Please provide me with more information to be able to figure out what is happening:

1- htnlentity encode the script that you entered in the snippets module (if you don't the tags will be striped) and send it to me in a private message from the profile, along wiformation that will help assist you.

Avatar
Cesar
Member
Members
Forum Posts: 12
Member Since:
December 12, 2018
sp_UserOfflineSmall Offline
3
December 28, 2018 - 3:50 am
sp_Permalink sp_Print

1. Script is just a simple twitter embed.
2. Code was wrapped properly as I mentioned I added it in the snippets and verified the source code. In addition it displayed properly utilizing my admin login.

----
1. I did allow it for all three levels although normal would be considered someone that has already created an account wouldnt it?
What I am getting from this situation is that there are four html levels and the last one is for someone that is casually browsing the site and will not register. Plikli stripped all the tags from this last group. It's already something that was posted so I dont see why it plikli would still strip it. I understand if the user was posting to the site but that was not the case.

htmlentity
----
{literal}
<script async src="https://platform.twitter.com/widgets.js&#x22; charset="utf-8"></script>
{/literal}

Avatar
redwine
Admin
Forum Posts: 341
Member Since:
February 21, 2018
sp_UserOfflineSmall Offline
4
December 28, 2018 - 1:09 pm
sp_Permalink sp_Print

Firstly, let me explain to you the allowed HTML setting. (I mentioned to you earlier to remember to allow the three levels, so that all levels will have this capability)
1- When you allow HTML, for one level or all levels, you are providing them the capability to post content with HTML tags. If you allow just one level or two, the level that is not allowed won't be able to POST content with HTML tags but surely will still be able to see the rendered HTML in the content posted by other levels. NOTE THAT VISITORS (not logged in) always are able to see the rendered HTML in the content!!!

How it works:

Let's say that only Admins are allowed to use HTML in the content. Admin posted an article with HTML. The content, including the aloowed HTML tags are saved and inserted in the links table.

This means that the HTML tags are already saved in the content. When this article is displayed, any viewer, logged in or not will see the rendered HTML.

See the demonstration on the first articles titled "Explaining how allowed HTML tags works" at

https://mymonalisasmile.com/plikli/

The Snippets Module, works differently. It does not modify the content (that is saved in the database), or any static content; it just inserts what it is instructed to do in certain places (hooks).

Example:

I used this Twitter embed code in a new snippet. I selected the placement to be tpl_plikli_story_start - Very beginning of link_summary.tpl

The code is:

<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Plikli CMS is the Phoenix that rose from the ashes of Pligg and Kliqqi! Being a developer on both, I fixed many bugs, enhanced features and created modules! To pursue the project away from the &quot;Business&quot; mentality, and just working for the users' best interests, Plikli was born!</p>&mdash; Plikli CMS (@PlikliCMS) <a href="

>February 19, 2018</a></blockquote>
{literal}<script async src="https://platform.twitter.com/widgets.js&quot; charset="utf-8"></script>{/literal}

It displayed properly, and viewed by visitors and all users levels.

You can check it yourself by following the same link I provided above.


NOTE: if you have content blocking in your browser, the embedded widget or any other script won't display properly until you disable the content blocking.

Avatar
Cesar
Member
Members
Forum Posts: 12
Member Since:
December 12, 2018
sp_UserOfflineSmall Offline
5
December 29, 2018 - 2:49 am
sp_Permalink sp_Print

Ok your way is loading the same twitter post on every story link thats on the website.

Ok this may clear this up.
Go to the article you made in regards to my questions.
- Edit the article
- Go to your Twitter page and select the code for another post you have and get the embed code
- Paste that code into the description and save it.

We should see that new twitter post embedded in the site right? Did it work for you?

Avatar
redwine
Admin
Forum Posts: 341
Member Since:
February 21, 2018
sp_UserOfflineSmall Offline
6
December 29, 2018 - 4:19 pm
sp_Permalink sp_Print sp_EditHistory

You are really confusing me!!!

Let's recap:

1- You started the topic about an issue with the twitter embed not working in the snippet module and also the HTML allowed tags are only working for the users but not visitors.

For this, I demonstrated to you that the Twitter embed is working in the snippets module and that HTML allowed tags are rendered for users and visitors, and that the user level that the HTML tags are allowed will be the ONLY ONE WHO CAN USE THEM, HOWEVER THEY WILL BE RENDERED TO ALL!

*******************************************************
"

Ok your way is loading the same twitter post on every story link thats on the website.

Ok this may clear this up.
Go to the article you made in regards to my questions.
- Edit the article
- Go to your Twitter page and select the code for another post you have and get the embed code
- Paste that code into the description and save it.

We should see that new twitter post embedded in the site right? Did it work for you?"

1- It is not my way, it where you choose the placement (hook) to display the snippet code!
2- The Twitter embed code is working properly in the snippet.
3- When using the snippet and the links modules, YOU DO NOT NEED TO ALLOW HTML FOR THAT!
4- HTML allowed tags are strictly for the content (article description and comments) THAT ARE SAVED IN THE DATABASE. ONLY the allowed tags will be accepted and the rest will be stripped!
5- Snippets and Links modules work this way:

a- They do not alter, add or delete any content.
b- When the content is loaded, a hook specific hook is called to check if the content needs to be processed by a module or widget.
c- If the snippet or the links modules are installed, THEY APPEND to the content, but just on the screen; the content remains the same in the database.

Now let's discuss the fact that you want are insisting on adding the Twitter embed to the content, thus it will be saved with the content in the database.

1- There is a security issue here because you will have to allow script, iframe, embed, etc tags, which by the way are NOT TO BE ALLOWED AND THE NOTE ABOUT THAT IS IN BOLD RED!
2- We proved so far that the snippet code is working and loading the embedded tweet properly, however embedding it with the content will not work (do some research and you will find that the Twitter embed will not work when loaded with dynamic content; it needs extra API JavaScript to load the widget first.

What I did not understand so far, is what is the issue that you really want to discuss and solve if it's in fact an issue!!!
The snippet module code is loading the twitter embed properly, the ultimate proof is that when it is loaded on its own by the snippet, it works but not when it is saved and loaded with a dynamic content, which by the way is not a problem from Plikli CMS, but rather from twitter!

Please enlighten me!

Avatar
Cesar
Member
Members
Forum Posts: 12
Member Since:
December 12, 2018
sp_UserOfflineSmall Offline
7
December 30, 2018 - 4:42 am
sp_Permalink sp_Print

I apologize for the confusion but I felt I made it clear in the first sentence of my initial post.
“I have been trying to get Twitter embeds in the description but it wont work.”

I then went on to say I put the required script in the site using the snippets module. So the user will never have to include the script tag since it will already be loaded.

Using this method I was able to use the twitter embed and have it load when I posted the code in a comment but I want to have this functionality in the description.

Avatar
redwine
Admin
Forum Posts: 341
Member Since:
February 21, 2018
sp_UserOfflineSmall Offline
8
December 30, 2018 - 3:34 pm
sp_Permalink sp_Print

I am surprised you say that it works in the comment but not in the article description!

I pasted the embed code in the description and in the comment, and in both, only the part of the blockquote was displayed and the widget script was not executed.

Could you please write step by step:
1- what did you enter in the snippet, is it the whole embed code or just the widget script part?
2- what is the placement you selected?
3- what did you paste in the description and in the comment?

If you have a live site, could you provide it so that I check it?
If you don't want to mention here the steps, you could send them in a private message from your profile, along with the live site URL if you have one?

Avatar
Cesar
Member
Members
Forum Posts: 12
Member Since:
December 12, 2018
sp_UserOfflineSmall Offline
9
December 30, 2018 - 5:23 pm
sp_Permalink sp_Print

No problem I will message you shortly with the site info.
1. Snippet only has one line that loads the script https://platform.twitter.com/widgets.js.
2. tpl_pikli_head_start - After head tag.
3. Description - I copied and pasted everything from Twitter and plikli filtered out the script portion of it. I verified by viewing source code. The interesting part is that if I am not logged in I only see it at html text. If I login with my admin and new test account with no admin/mod rights I can see it as intended by Twitter.

Forum Timezone: Asia/Beirut

Most Users Ever Online: 28

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

john: 47

Nishant kumar: 33

Mosage: 25

Punk: 23

Martin Gold: 22

Felipe: 21

StaticMove: 13

Hiro: 13

yami: 13

Cesar: 12

Newest Members:

Kajal Raj

Nik

Mannes

sandeep

Vityola

alex

larkpeyton

Mohi Uddin

Sandeep Verma

sansui

Forum Stats:

Groups: 1

Forums: 8

Topics: 118

Posts: 690

 

Member Stats:

Guest Posters: 0

Members: 144

Moderators: 0

Admins: 1

Administrators: redwine