Hello,
I am building an extension and I want to ask:
I have a "description" field where I want to appear the description of a note. The description variable is stored in the database with its html tags for bold, paragraphs, etc.
What is happening now:
It appears the text of the decription with the html tags, so as a result I take "This is a <b>description</b>"
What I want is:
I want the printed result to be without the html tags but the tags to be applied in the description like this: "This is a description"
And ofcourse this goes further with all tags (b, p, img, links etc.)
Any help on how to do this?
I am building an extension and I want to ask:
I have a "description" field where I want to appear the description of a note. The description variable is stored in the database with its html tags for bold, paragraphs, etc.
What is happening now:
It appears the text of the decription with the html tags, so as a result I take "This is a <b>description</b>"
What I want is:
I want the printed result to be without the html tags but the tags to be applied in the description like this: "This is a description"
And ofcourse this goes further with all tags (b, p, img, links etc.)
Any help on how to do this?
Last edited by Ariskos on Fri Nov 09, 2012 3:14 am, edited 1 time in total.
Web Developer specialized in Opencart. Visit my extensions:
(1)SKU Generator 1.5.x / (2) Opentasks
I don't want to just remove the html tags.
I want them to be applied but not be visible.
So as I said I want this: "This is a description with the word description in bold" and NOT this: "This is a <b>description</b> with the word description in bold"
Web Developer specialized in Opencart. Visit my extensions:
(1)SKU Generator 1.5.x / (2) Opentasks
Are you writing this in the description field of the product or category?
If so, select all text and codes you have now, cut it. Click on "Source" and paste it. Save. Source is the source code for that section which is where you can enter codes so they are parsed correctly.
If so, select all text and codes you have now, cut it. Click on "Source" and paste it. Save. Source is the source code for that section which is where you can enter codes so they are parsed correctly.
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
I don't understand what that means. As long as you're properly outputting HTML/XHTML this should always happen.Ariskos wrote:I don't want to just remove the html tags.
I want them to be applied but not be visible.
-Ryan
Ok, let me explain it further using steps:
1) In the input textarea, I write the description where I use the CKEDITOR.
2) Then I insert that description into the database using the escape function (which makes use of the mysql_real_escape_string function). So in the database, the description is stored in the following form ( I am using utf8_general_ci for that field):
3) And I appear that description in the admin panel which is shown as:
<p>This is a <strong>description</strong></p>
BUT what I want is the html tag to be applied in the description and instead of the above line I want to take the line below:
This is a description (<-- where the <strong> tag is already applied)
What makes tags to appear as text instead of being applied to the strings?
1) In the input textarea, I write the description where I use the CKEDITOR.
2) Then I insert that description into the database using the escape function (which makes use of the mysql_real_escape_string function). So in the database, the description is stored in the following form ( I am using utf8_general_ci for that field):
Code: Select all
<p>This is a <strong>description</strong></p>
<p>This is a <strong>description</strong></p>
BUT what I want is the html tag to be applied in the description and instead of the above line I want to take the line below:
This is a description (<-- where the <strong> tag is already applied)
What makes tags to appear as text instead of being applied to the strings?
Web Developer specialized in Opencart. Visit my extensions:
(1)SKU Generator 1.5.x / (2) Opentasks
Thanks for the quick respone, indead I had to pass the string through html_entity_decode function before appearing it.
Topic solved.
Web Developer specialized in Opencart. Visit my extensions:
(1)SKU Generator 1.5.x / (2) Opentasks
Who is online
Users browsing this forum: No registered users and 195 guests