-
-
Notifications
You must be signed in to change notification settings - Fork 16
Cassiopeia template.js #216
Comments
I had already created an issue. Have closed it in favour of this here. |
Sorry, I've missed that. Anyways I think the explanation here is something that can be verified and tackled |
Yes, that's why I've closed mine in favour of this one, because here the information comes from first and not from second hand 😉 |
After PR #244 has been merged, at least the back to top part of the template.js is not obsolete anymore. |
Honestly you don't need JS for this: https://moderncss.dev/pure-css-smooth-scroll-back-to-top/ (plenty more articles for a css only solution) |
it is needed if you insist on removing #back-to-top from the url |
No it's not and I just gave you the link with all the html/css. No freaking JS for moving to the top of the page in 2020... |
Sorry dmitris the code in that demo and in all the pure css demos will keep the #anchor in the url. They didnt want that - hence the js. As you don't believe me I have put the code from that article on a real link instead of in a codepen iframe and you can see for yourself that the #anchor is present |
@dgrammatiko See also #242 . |
I just went through the issue and I have to say that people should firstly invest understanding how the web is really working before raising issues. The In short they're solving a non existing problem. |
That might all be right .. I've just linked the issue to make clear what has been done why. |
Well, Javascript is a powerful language and will allow you to do a lot on the DOM, but before doing anything always ask if it worth the effort or is it really solving a problem. In this case there's no problem that needs a js solution. My 2c |
I am not saying I agree with removing the anchor - just explaining |
I know, my comments are not really targeting you or @richard67 . I just needed to explain why the whole js solution is a placebo... |
Apart from the bit where you said that the link showed you how to do it without any #anchor in the url ;) |
Yeah my bad, I didn't read the issue right away... |
Well, I wouldn't call myself a web expert at all, but as far as I know and have experienced with Google search console, the anchor should not really be an issue. I didn't really understand why #242 was an issue. |
It's not. The whole idea of "clean URLs" in the client side just doesn't exist and (as long as the anchors actually exist in the page) in fact as I explained above it's a feature (eg guide ppl to the particular part of the page that you want to share).
Since the anchor is only attached in the client side Google will never know about it. Also even if you manage to put anchors in your sitemap Google will ignore them. Also the platform has gone one step forward: https://chromestatus.com/feature/4733392803332096 so the old anchor is pretty safe... |
Well, as we are finishing our development here soon, we might not fix this here but later in the CMS repo with a future PR. At the end our work here did not touch it and leaves it like it was before. |
So if we don't solve it here, we should move this issue to the CMS repository after we have made our PR for the CMS repo with our work. |
The code in the template.js should be totally useless right now, let me explain:
This part existed for the grouped buttons in J3 but in J4 the functionality is done by html+css, no js needed or even if it is needed then it should be coupled with the actual Form Field (radio ?) not thrown in the template. The template is just an orchestrator, it doesn't and shouldn't impose things (embrace modular architecture)
This part is for the back to top but iirc now this is done by a simple anchor and a css property (smooth-scroll)
So the entire file is useless...
Expected result
No template.js needed anymore
Actual result
template.js has code that either doesn't belong there (eg Form Field Radio) or it can be replaced (or already has been replaced) by simple html+css (the back to top link)
System information (as much as possible)
Additional comments
The text was updated successfully, but these errors were encountered: