Jump to content

if query for a field from a different template


kaz
 Share

Recommended Posts

I have a template with fields for a settings page. Because the pages that should access the fields from the template 'settings' use a different template 'base', I access them via ID:

<?php echo $pages->get('1025')->FIELD; ?>

But now I need an if version for some fields. Unfortunately not so easy, because I have nested brackets that lead to an error message.

<?php if ($page->get('1025')->FIELD): ?>
<?php echo $pages->get('1025')->FIELD; ?>
<?php endif; ?>

I have tried it with square brackets, but i can't get it work.
<?php if ($page->get['1025']->FIELD): ?>

How does a if query from a field from another template (ID) looks like?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...