Yes, you're right :) But this might be tricky and sometimes you can easily miss in what spot what "this" means exactly. Also, with the new arrow function "this" does not work anymore :) So, using "$(e.currentTarget)" is vest practice todays.
Hello! I'm trying to deploy an application in a subfolder. I'm using a .htaccess generated by symfony/apache-pack. In this way everything works except the loading of the css and js files located in a /public/assets/css folder which are rewritten on www.dominio.it/assets/css/... instead of www.dominio.it/newfolder/ap...... how can I correct this? In the Twig templates I'm using the asset() function as suggested. Thanks for your help
my heart icon (fa fa-heart-o) never shows up... even before making the javascript additions. Am I missing something in moving the font or cs files? UPDATE: found issue... there is an extra ' in the line where the font awesome css file is loaded!!
Thanks for getting back with the update! I see you found the solution, but I wonder was the problem on your side or in our code? I'm asking, because if it's in our code - we can fix it properly. Anyway, thanks for sharing your solution with others.
My side... I think there was a copy / paste error when I was updating the link for the style sheet and the extra apostrophe was left in the link. I don't see it in the "final" solution for the base.html.twig template.
nope/ it isn't working. dang.... I can't find it.... I have reviewed, rewritten, and research many times. but it will not work. I really hate abandon this... It's wasting my time... can anyone help? Unexpected token "end of template" of value "" ("end of statement block" expected). Exception {% block javascripts %} {{ parent() }} <script src="{{ asset('js/article_show.js') }}"></script>{% endblock %}
Look's like you didn't close a "block" in your template (or maybe inside the template that you are extending), try double checking that all "blocks" are being closed. If you can upload your template file in somewhere I may be able to give it a look
Bah! Sorry about that - you found the one chapter where the subtitles failed (we're still perfecting a few formatting issues, so we allow subtitles to fail temporarily if we're not absolutely happy with them). We should have the subtitles up for this shortly!
20 Comments
I rewrote like button script from jQuery to vanilla JS and FetchAPI:
Ha! That's nice! I haven't tested it but it looks solid. I'm wondering if you benchmark-ed its performance?
Cheers!
FYI you don't have to call toggle Class twice. This will toggle both classes:
$link.toggleClass('fa-heart-o fa-heart');
Hey GDIBass!
Another good tip! I actually didn't know this one :).
Cheers!
It's also possible to write
var $link = $(this); <u>instead of</u> var $link = $(e.currentTarget);
My whole file at the end of the video looks like this:
Hey Sven,
Yes, you're right :) But this might be tricky and sometimes you can easily miss in what spot what "this" means exactly. Also, with the new arrow function "this" does not work anymore :) So, using "$(e.currentTarget)" is vest practice todays.
Cheers!
Hello! I'm trying to deploy an application in a subfolder. I'm using a .htaccess generated by symfony/apache-pack. In this way everything works except the loading of the css and js files located in a /public/assets/css folder which are rewritten on www.dominio.it/assets/css/... instead of www.dominio.it/newfolder/ap...... how can I correct this? In the Twig templates I'm using the asset() function as suggested. Thanks for your help
Hey Marco P.
There is
base-path:configuration variable underassetssubkey of framework configuration. You can specify it inconfig/packages/assets.yamlFor more configuration variants see: https://symfony.com/doc/current/reference/configuration/framework.html#base-path
Cheers!
my heart icon (fa fa-heart-o) never shows up... even before making the javascript additions. Am I missing something in moving the font or cs files?
UPDATE: found issue... there is an extra ' in the line where the font awesome css file is loaded!!
Hey Franc!
Thanks for getting back with the update! I see you found the solution, but I wonder was the problem on your side or in our code? I'm asking, because if it's in our code - we can fix it properly. Anyway, thanks for sharing your solution with others.
Cheers!
My side... I think there was a copy / paste error when I was updating the link for the style sheet and the extra apostrophe was left in the link. I don't see it in the "final" solution for the base.html.twig template.
Hey Franc!
OK, so that's great, that means no changes needed for this screencast :p
Thanks again!
Cheers!
nope/
it isn't working. dang.... I can't find it.... I have reviewed, rewritten, and research many times. but it will not work. I really hate abandon this... It's wasting my time...
can anyone help?
Unexpected token "end of template" of value "" ("end of statement block" expected).
Exception {% block javascripts %} {{ parent() }} <script src="{{ asset('js/article_show.js') }}"></script>{% endblock %}
Hey Dean D.
Look's like you didn't close a "block" in your template (or maybe inside the template that you are extending), try double checking that all "blocks" are being closed. If you can upload your template file in somewhere I may be able to give it a look
Cheers!
No subtitle here ? :(
Hey John!
Bah! Sorry about that - you found the one chapter where the subtitles failed (we're still perfecting a few formatting issues, so we allow subtitles to fail temporarily if we're not absolutely happy with them). We should have the subtitles up for this shortly!
Cheers!
the love heart does not appear with 'TEST', after the heart icon is clicked on?
Hey Emmanuel Abiola
What error are you seeing? Remember that you have to fix the "js script tags" problem first
Cheers!
it works now! the error occurred from mis-spelling span around the no. 5 :)
Oh, no worries, that kind of errors happens all the time, but it would not if you were using PhpStorm ;)
"Houston: no signs of life"
Start the conversation!