Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » problem when add php code

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1120 Views
  • ojalà
    Avatar
    Community Member
    87 Posts

    problem when add php code Link to this post

    Hi!
    I have a problem when I add php code. Layout of my tempate is divide in 2 menu, the first inside the header, the second under header. I want print 3 entry of menu in the first menu and othe 3 in the second menu (both of menu are principle, so the entry aren't child entry).
    I add this code in navigation.ss menu

    <?php
    $array_menu=$MenuTitle;
    for($i=0;$i<3;$i++)
    {
    ?>

    <ul id="Navlist">
    <% control Menu(1) %>
       
       <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode">$MenuTitle</a></li>
       
    <% end_control %>
    </ul>

    <?php
    }
    ?>

    I have the following error in theme/template/Page.ss

    Parse error: syntax error, unexpected T_STRING in C:\WINNT\Temp\silverstripe-cacheE--_silverstripe_cms-elisa\.cacheE.._silverstripe_cms.elisa.themes.villevenete.templates.Page.ss on line 37

    Can you help me to find the problem?
    Thanks!

  • ojalà
    Avatar
    Community Member
    87 Posts

    Re: problem when add php code Link to this post

    the problem is likn to .ss file? I'm writing php code in .ss file and not in .php file?

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: problem when add php code Link to this post

    You posted this topic 3-4 times. There is no need to double post. I answered this in another topic.

    In the future please don't post the same question multiple times.

    1120 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.