permalink

Good morning, everyone. I wanted to ask a question. I would like to have the possibility to add a button next to the permalink, where I could click on it and automatically copy that link. Is there something already available that does this? Thank you for your attention.
No description
39 Replies
foleystorm
foleystorm9mo ago
How can I get the full value from permalink?
ifox
ifox9mo ago
this is not available as an option but we can certainly advise how to implement it or accept a contribution in core to do it
foleystorm
foleystorm9mo ago
Thank you, Ifox. Do you know how to get full permalink value with slug? How can i implement it? I'm using twill 2
ifox
ifox9mo ago
the full permalink value is there already since when you click that link it does open the full url. If you want to add a copy link functionality there you'd need to customize the Vue component inside Twill that is rendering the permalink
LaravelOnline
LaravelOnline9mo ago
this is what I am trying to do, I cannot figure out how to duplicate the Vue component, where do I put my version of the Vue component? how do I tell Twill to render IT instead of the native/vendor component?
ifox
ifox9mo ago
@LaravelOnline you can literally override them in your vendor folder and run twill:build, or follow this for custom components https://twillcms.com/guides/creating_custom_components_form_fields_and_blocks.html
Twill
LaravelOnline
LaravelOnline9mo ago
Thank you, so when I run the build command... how does this ensure when I deploy the new files are used? I guess, where does it put th eoverriden files?
ifox
ifox9mo ago
you can go the pure override way, as in changing the actual file from twill, in your vendor folder, or use the resources path meant for custom components. It will copy them in the vendor folder before building
LaravelOnline
LaravelOnline9mo ago
see, thats where you lose me lol the "pure override" way doesn't sound like it will keep my changes when we deploy unless I do something else
ifox
ifox9mo ago
GitHub
twill/frontend/js/components at 3.x · area17/twill
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/c...
ifox
ifox9mo ago
well it will since twill:build will create new js assets in your public folder, which you can decide to push to your repo, or call twill:build during your deployment
LaravelOnline
LaravelOnline9mo ago
ok so, overriding them inside of the vedor dir and then run build ill test that right now
ifox
ifox9mo ago
I see what you mean though, if you literally override in your local vendor folder and build during deployment in CI for example, vendor modifications won't be there. But if you need that you can create your own composer or npm scripts that copies them from your own chosen folder to the vendor path
LaravelOnline
LaravelOnline9mo ago
so, is there a hierarchy where twill will read from? like, will it look at non vendor files for vue components? or, basically, I can fork twill and use my fork
ifox
ifox9mo ago
see the guides for custom Vue components. That's for creating your own components, as in ones that don't already exists in twill, like a new form field type. Those can be created under resources/assets/js/components and twill:build will include them. Now if what you're looking for is changing an existing component from twill, depending on which one, you may need to override the actual file, which you can do with the approach I shared above, or a fork, yes, that totally works too
LaravelOnline
LaravelOnline9mo ago
thanks for clarifying all this for me, the client is eager to get this feature just having a hard time wrapping my head around Twill do you know why @ifox when I run artisan twill:build I get Twill dev assets manifest is missing. Make sure you are running the npm run serve command inside Twill. but when I run dev it works fine
ifox
ifox9mo ago
sounds like you enabled dev_mode in config
LaravelOnline
LaravelOnline9mo ago
oh yeah I think I did actually, no I did but I reverted what else could it be?
ifox
ifox9mo ago
artisan config:clear and/or cache:clear should fix
LaravelOnline
LaravelOnline9mo ago
no dice
ifox
ifox9mo ago
if it's looking for the dev manifest it must be because dev_mode is/was enabled tried view:clear too?
LaravelOnline
LaravelOnline9mo ago
I did optimize:clear and then the others
ifox
ifox9mo ago
hmm that's weird. check if you have a hot file in your public folder? if so you can delete it (it should not matter with dev_mode disabled but there might be a regression there)
LaravelOnline
LaravelOnline9mo ago
nope
No description
LaravelOnline
LaravelOnline9mo ago
ok so I explicitly set dev_mode to false and that worked It was a cache somehwere
ifox
ifox9mo ago
interesting
LaravelOnline
LaravelOnline9mo ago
good to know
ifox
ifox9mo ago
cool
LaravelOnline
LaravelOnline9mo ago
so, I made my change to the vue component in the vendor folder how can I test that it will continue to work on deployment? or do I have to make a command to replace this file when we deploy or fork the repo
ifox
ifox9mo ago
If you push the content of your public/assets folder to your repo you're all good, the built assets is all you need for your change to be deployed
LaravelOnline
LaravelOnline9mo ago
ok thank you so much! so - wait a sec if I make these changes in vendor, and then run build - it compiles the files and puts them in public assets
ifox
ifox9mo ago
yup
LaravelOnline
LaravelOnline9mo ago
but then, where do I make any more changes to any overriden files? they won't be in vendor anymore and public/assets is compiled
ifox
ifox9mo ago
they won't be after a composer update, correct, that's why I said you can create your own scripts that copies them to vendor before you run twill:build. That way you can version them wherever you want in your repo
LaravelOnline
LaravelOnline9mo ago
that is a strange way to go about things imho
ifox
ifox9mo ago
you are free to make a PR with a better suggestion. This is only for overriding internal components. For custom components there is a path made for it, as documented in the guide I linked earlier in this thread.
LaravelOnline
LaravelOnline9mo ago
I understand that - custom components is a different thing altogether you could have a special dir in resources/js somewhere and an artisan command that will copy things over before build is ran something like that
ifox
ifox9mo ago
I'm with you it can be improved by simply providing an override folder, like Laravel does with package views (which is the approach if you need to override blade view from twill)
LaravelOnline
LaravelOnline9mo ago
I will make a command internally for now the client needs this asap the pr can wait a bit