Senior Python Dev @ ICVR.
Building Trivox, OSS AI automation for creators.
Dev logs, rants, and tutorials that cut through the noise.
AI, pipelines, creativity, and a little chaos.
Location
Colombia
Education
Graphic Design at ULA (University of Los Andes, Venezuela)
Hello. This is well explained, and I have a question.
Let's say I want to dynamically change a tag when I include a pug file. Is it possible? For example, I have this form which I want to use in two different pages in my project but at home, it is in a modal. Its title is inside .modal-header with the tag .modal-title, The form fields are inside .modal-body and the submit button, inside .modal-footer.
Now, I need to load the same form in another page but without the modal tags. How can I do that?
I didn't cover this in my posts but I think a mixin is what you'd want to use in this case. Pug mixins are documented here. If you have troubles figuring out how to make that work, I'd be glad to write up another article showing a scenario similar to yours.
Another alternative would be to just use client-side JavaScript to add/remove CSS classes from your elements.
Senior Python Dev @ ICVR.
Building Trivox, OSS AI automation for creators.
Dev logs, rants, and tutorials that cut through the noise.
AI, pipelines, creativity, and a little chaos.
Location
Colombia
Education
Graphic Design at ULA (University of Los Andes, Venezuela)
I created a mixin for the modals (Actually I'm using two with different forms, I pass the params I need and it includes the forms. Even though it would be great if you write another article about it. Thank you.
Senior Python Dev @ ICVR.
Building Trivox, OSS AI automation for creators.
Dev logs, rants, and tutorials that cut through the noise.
AI, pipelines, creativity, and a little chaos.
Location
Colombia
Education
Graphic Design at ULA (University of Los Andes, Venezuela)
I'm a student and I'm looking for somebody to help me about 2 problems with pugjs.
Please, could you help me ? I have 2 problems... and I have to find a solution before saturday...
First, I want to display a picture for specific days. Moreover, I'll like creating a calendar.
It will be very kind if you could help me.
Best regards
We're a place where coders share, stay up-to-date and grow their careers.
Hello. This is well explained, and I have a question.
Let's say I want to dynamically change a tag when I include a pug file. Is it possible? For example, I have this form which I want to use in two different pages in my project but at home, it is in a modal. Its title is inside
.modal-headerwith the tag.modal-title, The form fields are inside.modal-bodyand the submit button, inside.modal-footer.Now, I need to load the same form in another page but without the modal tags. How can I do that?
I didn't cover this in my posts but I think a mixin is what you'd want to use in this case. Pug mixins are documented here. If you have troubles figuring out how to make that work, I'd be glad to write up another article showing a scenario similar to yours.
Another alternative would be to just use client-side JavaScript to add/remove CSS classes from your elements.
Hope that helps!
Did it.
I created a mixin for the modals (Actually I'm using two with different forms, I pass the params I need and it includes the forms. Even though it would be great if you write another article about it. Thank you.
Let me see what I can work up!
Done! Its quick & dirty but hopefully you'll find it useful.
Thank you. I'll share with you my solution.
Hello,
I'm a student and I'm looking for somebody to help me about 2 problems with pugjs.
Please, could you help me ? I have 2 problems... and I have to find a solution before saturday...
First, I want to display a picture for specific days. Moreover, I'll like creating a calendar.
It will be very kind if you could help me.
Best regards