Jump to content

Accesing Repeater Data


charliez
 Share

Recommended Posts

I created a repeater in my SEO tab for my META statements (I know they are not fashionable anymore, but I still use them).

I am trying to access them like this:

<?php
foreach($page->Meta as $m) {
 echo "<meta name='$m->$MetaName' content='$m->$MetaContent' /><br/>";
 }
?>

but I get this:

<meta name='1011->' content='1011->' /><br/><meta name='1012->' content='1012->' /><br/><meta name='1013->' content='1013->' /><br/><meta name='1014->' content='1014->' /><br/><meta name='1015->' content='1015->' /><br/><meta name='1016->' content='1016->' /><br/><meta name='1017->' content='1017->' /><br/><meta name='1018->' content='1018->' /><br/><meta name='1019->' content='1019->' /><br/>

What am I doing wrong?

If I use the variables inside a <p>, they work fine printing out...

I am a noob... be gentle please...

Link to comment
Share on other sites

Try this without the $ in the field name?

<?php
foreach($page->Meta as $m) {
 echo "<meta name='$m->MetaName' content='$m->MetaContent' /><br/>";
 }
?>

or this with the {}

<?php
foreach($page->Meta as $m) {
 echo "<meta name='{$m->MetaName}' content='{$m->MetaContent}' /><br/>";
 }
?>
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...