Jump to content

Recommended Posts

Posted

I'm using the url field often to store links from imported RSS items.

It would be nice if the URL stored in the URL field could be easily visited with a click.

Maybe popup in a magnific-popup. or a target='_blank'

Posted

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
Posted

Sorry to respond this late,

I do think it sould be done client side instead of serverside, as server side is one step to late. I will marinate this for a while till I have some spare time.)

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
  • Recently Browsing   0 members

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