Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » getting custom module to work

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: 975 Views
  • marcink
    Avatar
    Community Member
    89 Posts

    getting custom module to work Link to this post

    hi,

    i wrote a module, that adds a flash file to the page using swfobject.js.
    now i have a tab in the cms, where i can fill the required data. in the module folder, i also have a template file, like:

    <script>
    swfobject($FlashUrl, $Container, $Width, $Height);
    </script>


    $FlashUrl, $Container etz. are the variables i enter in cms.

    how do i get this code snippet into my page, filled with the variables from the tab?

    thanks a lot!

  • Anatol
    Avatar
    126 Posts

    Re: getting custom module to work Link to this post

    Hi,

    did you add the database fields to the module code? E.g.

    static $db = array(
          "FlashUrl" => "Text",
          "Container" => "Varchar(255)",
          "Width" => "Int",
          "Height" => "Int"
    );

    If you have that and you added the CMS fields the variables should be available in your template file as in your code snippet.

    Cheers!
    Anatol

  • marcink
    Avatar
    Community Member
    89 Posts

    Re: getting custom module to work Link to this post

    hi anatol,

    thanks for the answer... but i'm trying to do it modular, so nobody has to edit the page types...

    just like a widget, when you just type: $Sidebar, and the code is "just there".

    any idea on that? - if it's possible anyway...

    thanks,
    marcin

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