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.
39 Replies
How can I get the full value from permalink?
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
Thank you, Ifox. Do you know how to get full permalink value with slug?
How can i implement it?
I'm using twill 2
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
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?
@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
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?
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
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
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...
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
ok
so, overriding them inside of the vedor dir and then run build
ill test that right now
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
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
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
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 finesounds like you enabled dev_mode in config
oh yeah
I think I did
actually, no
I did but I reverted
what else could it be?
artisan config:clear and/or cache:clear should fix
no dice
if it's looking for the dev manifest it must be because dev_mode is/was enabled
tried view:clear too?
I did optimize:clear
and then the others
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)nope
ok
so I explicitly set dev_mode to false
and that worked
It was a cache somehwere
interesting
good to know
cool
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
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
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
yup
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
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
that is a strange way to go about things imho
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.
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
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)
I will make a command internally for now
the client needs this asap
the pr can wait a bit