Skip Navigation

[Resolved] 's appear everywhere after adding conditional code

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 17 replies, has 3 voices.

Last updated by szymonF 4 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2244547

Hi Minesh,

Thanks again for looking into this.

I know there are some <br> tags in the script. These are the breaks I want. Obviously, I am not referring to those ones. The ones I am referring to are not in the script, but are in the rendered site. Naturally, I want the breaks and paragraphs I add, not any other ones.

Perhaps I should point to them more specifically. Please compare the following snippets of code:

1a. what I put in the Content Template:

<div class="article-export">
<em><u>hidden link</u></em>
<em><u>hidden link</u></em>
<em><u>hidden link</u></em>
<em><u>hidden link</u></em>
 <em><u>hidden link</u></em>
<em><u>hidden link</u></em></div>

1b. what comes out in the rendered page:

<div class="article-export">
<em><u>hidden link</u></em>
***<p><em><u>hidden link</u></em><em><u>hidden link</u></em></p>
<em><u>hidden link</u></em>
***<p><em><u>hidden link</u></em><em><u>hidden link</u></em></p>
<em><u>hidden link</u></em>
***<p><em><u>hidden link</u></em><em><u>hidden link</u></em></p></strong>
<em><u>hidden link</u></em>
***<p><em><u>hidden link</u></em> <em><u>hidden link</u></em></p>
<em><u>hidden link</u></em>
***<p><em><u>hidden link</u></em><em><u>hidden link</u></em></p>
<em><u>hidden link</u></em>
***<p><em><u>hidden link</u></em></p>
</div>

==========

2a. what I put in the Content Template:

<div class="article-links">
            [wpv-conditional if="( $(wpcf-link) ne '' )"]<em><u>hidden link</u></em>[/wpv-conditional]
            [wpv-conditional if="( $(wpcf-free) ne '' )"]<em><u>hidden link</u></em>[/wpv-conditional]
            [wpv-conditional if="( $(wpcf-find) ne '' )"]<em><u>hidden link</u></em>[/wpv-conditional]
            </div>

2b what comes out in the rendered page:

<div class="article-links">
            <em><u>hidden link</u></em>
***<br>
            <em><u>hidden link</u></em>
***<br>
            <em><u>hidden link</u></em>
            </div>

All the lines starting from *** is NOT in my script. That is the stuff I want to get rid of, not the breaks that I intentionally added.

#2246007

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've added the following JS code to content template's JS editor:
=> hidden link

jQuery(function($){
 $('p:empty').remove();
  
    $(".article-use").find("br").remove();
    $(".article-export").find("p").contents().unwrap(); 
  
});

And following CSS code to the CSS editor:

.article-export{
	width:auto;
	float:right;
}

Can you please confirm it works as expected now: hidden link

#2246185

Thanks! I guess this is a brute-force solution for now - I tweaked it a bit to look good, but it works. I hope this incompatibility might be resolved at source in the future!