Roych Posted March 6, 2017 Share Posted March 6, 2017 Hello, Im having some trouble hiding a <p> in my template if a checkbox is "checked". I have two fields "text field for a button" and "simple checkbox for hidding a text button field" with a dependency to hide button field if hecked. Now I need to hide that button in frontend if checked. It is a list of pages "blog like" with a read more button. Sometimes that button is not nessasary so I need an option to hide it on some articles. I tried with: (RemoveButton = Checkbox field - Text = Button text field) <?php if (strlen(trim($single->RemoveButton)) > 1): ?> <p><a button href="<?= $single->url ?>" type="submit" id="submit" class="btn btn-blue btn-effect"><?=$single->Text?></button></a></p> <?php endif; ?> I need to hide all that <p> somehow. Hope I wrote understandable. R Link to comment Share on other sites More sharing options...
arjen Posted March 6, 2017 Share Posted March 6, 2017 If RemoveButton is not false then show the button: <?php if (!$single->RemoveButton) : ?> <p><a button href="<?= $single->url ?>" type="submit" id="submit" class="btn btn-blue btn-effect"><?=$single->Text?></button></a></p> <?php endif; ?> 4 Link to comment Share on other sites More sharing options...
Roych Posted March 6, 2017 Author Share Posted March 6, 2017 5 minutes ago, arjen said: If RemoveButton is not false then show the button: <?php if (!$single->RemoveButton) : ?> <p><a button href="<?= $single->url ?>" type="submit" id="submit" class="btn btn-blue btn-effect"><?=$single->Text?></button></a></p> <?php endif; ?> Woow, that was fast and works perfect. Very helpfull also, thank you R Link to comment Share on other sites More sharing options...
arjen Posted March 6, 2017 Share Posted March 6, 2017 No problem. I had to do someting with my 1000th post 11 Link to comment Share on other sites More sharing options...
Roych Posted March 6, 2017 Author Share Posted March 6, 2017 Hehe, congrats for 1001! R 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now