Skip to content

Commit

Permalink
Merge pull request #35 from spekulatius/spekulatius-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
sheadawson committed Nov 26, 2015
2 parents 399ba18 + e72cf26 commit 8f32818
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ A Link Object can be linked to a URL or, an internal Page or File in the SilverS
### Example usage

```php
class Page extends SiteTree{
class Page extends SiteTree {

static $has_one = array(
private static $has_one = array(
'ExampleLink' => 'Link'
);

public function getCMSFields(){
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Link', LinkField::create('ExampleLinkID', 'Link to page or file'));

return $fields;
}

...
}
```

In your template, you can render the links anchor tag with
Expand All @@ -59,18 +61,20 @@ Use the EmbeddedObject/Field to easily add oEmbed content to a DataObject or Pag
### Example usage

```php
class Page extends SiteTree{
class Page extends SiteTree {

static $has_one = array(
private static $has_one = array(
'Video' => 'EmbeddedObject'
);

public function getCMSFields(){
$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Video', EmbeddedObjectField::create('Video', 'Video from oEmbed URL', $this->Video()));

return $fields;
}

}
...
```

Expand Down

0 comments on commit 8f32818

Please sign in to comment.