Skip to content

Commit

Permalink
Merge f5a4a71 into 1f50b5c
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Mar 19, 2019
2 parents 1f50b5c + f5a4a71 commit 2612da4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Form/BlockLinkField.php
Expand Up @@ -73,6 +73,34 @@ public function getLinkPage()
return DataObject::get_by_id(SiteTree::class, $pageId);
}

/**
* Get the link text/title
*
* @return string
*/
public function getLinkText()
{
return trim($this->getParsedValue()->Text);
}
/**
* Get the link "description", used for titles or alt text
*
* @return string
*/
public function getLinkDescription()
{
return $this->getParsedValue()->Description;
}
/**
* Get whether to open the link in a new window
*
* @return bool
*/
public function getLinkTargetBlank()
{
return (bool) $this->getParsedValue()->TargetBlank;
}

/**
* Get the relative URL for the linked {@link SiteTree} object, with a leading slash
*
Expand Down

0 comments on commit 2612da4

Please sign in to comment.