toolset:test2021 <--please mark this as privat
I am trying to place a min-height inline style by condition to rd-header-row-layout
It works in the body:
[wpv-conditional if="( '[wpv-post-id item="$parent"]' ne '' )"]has parent[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-id item="$parent"]' eq '' )"]has no parent[/wpv-conditional]
But it doesn't work in the inline style (actually not placed in the website)
<div ... style="max-width: 1290px; min-height: [wpv-conditional if='( "[wpv-post-id item='$parent']" ne "" )']30vh[/wpv-conditional][wpv-conditional if='( "[wpv-post-id item='$parent']" eq "" )']50vh[/wpv-conditional]; >
Hello,
Where did you put those codes?
I have tried the same codes in my localhost with a fresh WP installation + the latest version of Toolset plugins, it works fine.
for example, add a shortcode block, using below codes:
<div style="max-width: 1290px; min-height: [wpv-conditional if='( "[wpv-post-id item='$parent']" ne "" )']30vh[/wpv-conditional][wpv-conditional if='( "[wpv-post-id item='$parent']" eq "" )']50vh[/wpv-conditional]; ">12345</div>
It outputs different min-height value in different pages, see my screenshot: sub-page.JPG
I put it in a Fields-and-Text block on a single page template.
Tried it on my toolset test server, got the same problem with your code?
Tried adding it in an HTML block and it worked!?
I inserted the conditional for the rd-header-row-layout into the Fields-and-Text block and did a copy into an HTML block below.
hidden link
Also see my toolset testserver:
hidden link
Is the Fields-and-text block the problem?
Thanks for the details, I can duplicate the same problem, and have escalated this issue, will update here if there is any news.
yes please. Having lot's of issues I can't explain, always thinking that I am doing the probs, like pages that I can't update after changes, or the disappearing css bug at the buttons https://toolset.com/forums/topic/custom-toolset-styles-for-buttons-disapear-at-first-reload/page/2/. Would be great if it's not allways my issue 😛
Just realised that he also "crashes" the html-block if I reedit the template. If I reopen it twice (without saving the first time) he shows me that there is a backup with changes at the second time, without having changed anything myself. There you can see that he edits the html block in the backedup version (red outline) like he probably did with the Fields-and-Text block by saving at the first time.
Maybe that helps
Your screenshot isn't in English, it does not help.
Please provide detail steps to reproduce the same problem in a fresh WP installation.
Hi Luo Yang,
please see Video for detail steps to reproduce the same problem in a (quite) fresh WP installation.
hidden link
Hope this helps and that it is ok by video because that's much, much faster for me than explaining it by words...
Greetings Torsten
Since you are using shortcodes + HTML codes, please try as my first answer: use shortcode block:
https://toolset.com/forums/topic/place-value-in-inline-style-by-condition-has-parent-or-hasnt-parent/#post-1904765
It works fine in my localhost.
And for the HTML block and Fields-and-Text block issue, I have checked it in our to-do list, according to our developers feedback, it seems to be an issue of WordPress core:
This is probably due to some sanitization done by WP over its content on post save.
So in your case, please try to use shortcode block.
Well that was clear that it's because of sanitization of WP.
Hoped that there was some work-around for that.
As there isn't iI will keep rewriting the code into a HTML block every time I save the template.
Not the best solution but at least a solution.
Thx for your support!