Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Filetype uses wrong template file

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 507 Views
  • suntrop
    Avatar
    Community Member
    131 Posts

    Filetype uses wrong template file Link to this post

    I've got a pagetype called Map.php and it uses the default Page.ss Template and an adjusted Layout.

    Now I made a copy of Map.php (Map_FB.php which extends Map.php) and made a Map_FB.ss in my templates folder.
    That way I can remove the header and footer and put that Map into an iFrame on Facebook.

    But the page I created in the CMS still uses the default Page.ss template, not the Map-FB.ss template file.
    I flushed the cash, deleted the file and recreated it. But with ?showtemplate=1 it shows me SS uses the page.ss file.

  • Futureweb
    Avatar
    Community Member
    232 Posts

    Re: Filetype uses wrong template file Link to this post

    I haven't tried, but the problem is probably be the underscore _

    Try renaming your the class in your php file to MapFB and your template MapFB.ss

    Templates with _ in the name relate to the page type, then an action on the class - PageType_PageAction.ss.

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: Filetype uses wrong template file Link to this post

    Hi and thanks for your reply. Think I missed the email notification for this.

    I am now using the renderwith function and that works. But I'll try to remove the underscore and see if that works.
    I wasn't aware of that. Couldn't find it the docs. Do you have a link for me?

    507 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.