Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

370 Posts in 100 Topics by 134 members

Widgets

SilverStripe Forums » Widgets » [Solved] Override WidgetHolder.ss

Discuss SilverStripe Widgets.

Page: 1
Go to End
Author Topic: [Solved] Override WidgetHolder.ss 543 Views
  • FungshuiElephant
    avatar
    Community Member
    49 posts

    [Solved] Override WidgetHolder.ss Link to this post

    I have a widget on a page.
    It's wrapped in HTML by the silverstripe/sappire/templates/WidgetHolder.ss file which contains:

    <div class="WidgetHolder">
    <h3>$Title</h3>
    $Content
    </div>

    I would prefer the title to be an h2 element rather than an h3 element.

    I copied the above, changing h3 to h2 and put it in silverstripe/themes/mytheme/templates/Includes as per this page http://doc.silverstripe.org/doku.php?id=widgets

    You can override the WidgetHolder.ss and Widget.ss templates in your theme too by adding WidgetHolder and Widget templates to themes/myThemeName/templates/Includes/

    but it didn't work.
    If I delete the core sapphire file (silverstripe/sappire/templates/WidgetHolder.ss) it works fine but obviously I don't want to do that because it will break following an update to the core sapphire files.
    Any ideas?

  • FungshuiElephant
    avatar
    Community Member
    49 posts

    Re: Override WidgetHolder.ss Link to this post

    It seems that I should have put the modified WidgetHolder.ss into silverstripe/themes/mytheme/templates not silverstripe/themes/mytheme/templates/Includes. I moved the file and it worked.
    This makes more sense as I'm not including it.
    I think that the documentation (http://doc.silverstripe.org/doku.php?id=widgets) is incorrect.

  • christophermanning
    avatar
    Community Member
    3 posts

    Re: [Solved] Override WidgetHolder.ss Link to this post

    I just ran into the same problem. Your solution worked correctly and it seems as either the documentation is misleading or incorrect.

    543 Views
Page: 1
Go to Top

Currently Online: There is nobody online.

Welcome to our latest member: Newclear

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

Comments on this website? Please give feedback.