• Resolved Aureline

    (@aureline)


    Dear berkux,

    I hope this message finds you well. I am writing to seek assistance with a challenge I am facing while using the JSON Content Importer extension on my WordPress site.

    I am trying to import JSON data that includes HTML tags, specifically in fields such as “goals,” “targeted_jobs,” and “description.” However, despite my attempts to manipulate the content within the WordPress template, I am still encountering unwanted HTML tags in the output.

    Here the code :

    [jsoncontentimporter url="https://brewingtheory.hop3team.com/formations/la-maintenance-en-brasserie-et-micro-brasserie.json" basenode="training"]
    {subloop-array:1:-1}
        {subloop:training_category:-1}
                <span class="training_category">{training_category.name}</span><br>
        {/subloop:training_category}
        {subloop:training_cycle:-1}
                <span class="training_cycle"><i aria-hidden="true" class="far fa-check-square"></i> {training_cycle.name}</span><br>
        {/subloop:training_cycle}	
          {subloop:training_type:-1}
                <span class="training_type"><i aria-hidden="true" class="fas fa-users"></i> {training_type.name}</span><br><br>
        {/subloop:training_type}	
      {/subloop-array:1}
      Objectifs de la formation et compétences visées :
    {goals}
    <br><br>
    {targeted_jobs}
    <br><br>
    {description}
    <br><br>
    Accessibilité Handicap :
    <br>
    {accessibility}
    <br><br>
    
    <a  target="_blank">Je suis intéressé·e</a><br>
    </article> 
      [/jsoncontentimporter]

    I have tried various methods, including using the strip_tags function and JavaScript, but none have yielded the desired result. I even attempted to use the SimpleHTMLDom library to selectively retain specific HTML tags, but unfortunately, the issue persists.

    Could you please provide guidance on the best approach to handle HTML tags in the imported JSON content? Are there any specific settings or techniques I might be overlooking?

    Thank you for your time and assistance. I appreciate your support in resolving this matter.

    Best regards,
    Auréline

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author berkux

    (@berkux)

    Hi Auréline,
    for this :html can be added to the template:

    [jsoncontentimporter url=”https://brewingtheory.hop3team.com/formations/la-maintenance-en-brasserie-et-micro-brasserie.json&#8221; basenode=”training”]
    {subloop-array:1:-1}
    {subloop:training_category:-1}
    <span class=”training_category”>training category: {training_category.name}</span>

    {/subloop:training_category}
    {subloop:training_cycle:-1}
    <span class=”training_cycle”><i aria-hidden=”true” class=”far fa-check-square”></i>cyle name: {training_cycle.name}</span>

    {/subloop:training_cycle}
    {subloop:training_type:-1}
    <span class=”training_type”><i aria-hidden=”true” class=”fas fa-users”></i>type name: {training_type.name}</span>


    {/subloop:training_type}
    {/subloop-array:1}
    Objectifs de la formation et compétences visées :
    {goals:html}
    {targeted_jobs:html}
    {description:html}
    Accessibilité Handicap :
    {accessibility:html}
    Je suis intéressé·e

    [/jsoncontentimporter]

    Does that help?

    Best wishes,
    Bernhard

    Plugin Author berkux

    (@berkux)

    Thread Starter Aureline

    (@aureline)

    Hi,

    Thanks for your answer. It works perfectly !!

    I had seen this option in the documentation, but I must not have used it properly, because it didn’t correct anything.

    Many thanks for your quick help!

    Have a nice day,
    Auréline



Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issue with HTML Tags in Imported JSON Content’ is closed to new replies.