Jump to content

Using url field value.


Martijn Geerts
 Share

Recommended Posts

Simple change in the InputField (InputfieldURL.module):

public function ___render() {
	$rootUrl = $this->config->urls->root;
	if($this->addRoot && !$this->noRelative && !$this->notes && strlen($rootUrl) > 1) {
		$this->notes = sprintf($this->_("Start local URLs with \"/\" and leave off the \"%s\" part."), $rootUrl); // Instruction for local URLs displayed when site is running from a subdirectory
	}

	$out = "\n<input " . $this->getAttributesString() . " />"; 
	$value = $this->getAttribute("value");
	if(!is_null($value) && $value !== ""){
		$out .="<p class='notes'>WebSite <a target='_blank' href='".$value."'>here</a>.</p>";
	}
	return $out;
	
}

renders as: Screenshot%202014-01-11%2017.37.26.png?d

I had never thought of this, although there have been times where this would have been beneficial. This seems something worthy of adding to the core (maybe not done in 2 minutes like mine  :P)

  • Like 5
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...