inspheric / nova-url-field Goto Github PK
View Code? Open in Web Editor NEWA URL input and link field for Laravel Nova
License: MIT License
A URL input and link field for Laravel Nova
License: MIT License
I have a scenario where I want both the link and the label to be based on the model data. However, it appears that I'm currently only able to make the link dynamic.
I may be mistaken, but it does not seem possible to output custom HTML on the index and/or detail page? Since the Url
field inherits from the default Text
field, I expected things like Text::asHtml()
to work. Is there any way prevent the HTML from being escaped?
Would be great to have a nofollow
option.
As a quick attempt, I tried extending the Url class
use Inspheric\Fields\Url as BaseUrl;
class Url extends BaseUrl {
public function nofollow() {
return $this->withMeta(['rel' => 'nofollow']);
}
}
But unfortunately that doesn't seem to work. Maybe the meta tags are restricted?
Hello!
Using this package to display links to download files inside tables. I have it working fine on local, but when I deploy I'm getting some unexpected behavior on the app.
Local:
<a href="https://-----" target="_blank" class="cursor-pointer dim no-underline text-primary flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" role="presentation" class="fill-current mr-2 flex-no-shrink"><path d="M19-----"></path></svg> <span class="block truncate">
Download
</span></a>
Production server:
<index-url-field resource-name="files" via-resource="contacts" via-resource-id="14440" field="[object Object]" class="text-left"></index-url-field>
Any ideas on what could be causing this?
I can't use placeholder in url filed. I'm try set using withMeta and work.
->withMeta([
'placeholder' => 'newPlaceholder'
])
Is it possible to just put urls without http://? Currently it refuses.
I am using this package for the display purpose only. When updating the model, it requires a URL. But as you can see in my code, I am using only a part of the URL.
Url::make('Instagram', 'instagram_username')
->displayUsing(function ($instagram) {
return 'https://instagram.com/' . $instagram;
})
->clickable()
->hideFromIndex(),
This field is great, huge help. I use it extensively. But it doesn't support displayUsing when a field gets shortened.
Url::make(__('URL'), 'url')
->rules('required')
->sortable()
->displayUsing(function ($title) {
return str_limit($title, 25, '...');
})->clickable()->clickableOnIndex()->onlyOnIndex()
,
Some URLs are actually longer, and so they end up looking like "https://www.somedomain.c..." because of displayUsing. They get turned into links, but when clicked, you end up going to "https://www.somedomain.c..." instead of the real URL.
Is there going to be any support for Nova version 4?
Hi,
In the code, only noopener is true by default.
/**
* The link tag's rel attribute.
* @var array
*/
protected $rel = ['noopener' => true];
In the README, it looks like both are true by default:
Url::make('Homepage')
->noopener(bool $noopener = true),
Url::make('Homepage')
->noreferrer(bool $noreferrer = true),
So, is the README wrong or does the default value have to be true for both?
/**
* The link tag's rel attribute.
* @var array
*/
protected $rel = ['noopener' => true, 'noreferrer' => true];
Great field! Thank you.
Nova Version: ^4.0
URL Field Version: ^2.0
I think they changed the index page row click behavior in Nova 4. Now if you click on any regular fields in the Row it opens the Resource Detail page. Which creates interference for this URL field. I think you need to wrap the field in a div and stop the click event bubbling up to the resource view level.
I want to know, if it is possible to add a custom url(value) href, using the default template
I think this should also work with computed values -- however, right now it doesn't.
It would be nice in some cases to have a styling option so the url looks like e.g. the BelongsTo url on detail pages. So this package could be used to link to specific resources within nova without having a defined relationship and looking like everything else in nova.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.