682 search results

hm interesting question, I can think only about Turbo tech from Stimulus devs probably it's the best use-case for it, however I'm not fully sure about it.
Hey Ryan. I solved it by using turbo frames. It works like a charm now and I can put it everywhere I want to :D. I created a route for the contact form and a partial I can include in my sitebuilding. In the partial…
Braunstetter
Braunstetter
Read Full Comment
Hello Ryan. I start using turbo now first for the frontend in our company. I did the first turbo page now and I have the first problem :). When I embed a controller with a (contact-)form (to be able to reuse it everywhere in a…
Braunstetter
Braunstetter
Read Full Comment
Instead of adding another else statement to the template you can also add an "append" turbo stream to the reviews frame to add a button within the turbo frame tags: ``` <a href="{{ path('app_product_reviews', {id: product.id}) }}" class="btn btn-success">…
Yeah... it looks like swup and turbo do almost the same exact thing: turn all the links in the body to ajax calls. So, right now it looks to me like there's no point in using both together, it's either one or the…
Pausable rendering has been implemented since this video https://github.com/hotwired/turbo/pull/290 I'm going to try to implement it on my own but a video on integrating Swup with Turbo would be awesome
Yup! I'm building it this week - Turbo had a few more chapters than I expected. I'm hoping to release this next week :)
weaverryan
weaverryan
Read Full Comment
This does seem to be the case: https://discuss.hotwired.dev/t/turbo-always-reloading-when-asset-js-css-is-added-with-turbo-track/3179/5
28 lines | assets/controllers/counter_controller.js
// ... line 1
import { visit, renderStreamMessage } from '@hotwired/turbo';
// ... line 3
export default class extends Controller {
// ... lines 5 - 7
increment() {
this.count++;
this.countTarget.innerText = this.count;
const streamMessage = `
<turbo-stream action="update" target="flash-container">
<template>
<div class="alert alert-success">
Thanks for clicking ${this.count} times!
</div>
</template>
</turbo-stream>
`;
renderStreamMessage(streamMessage);
if (this.count === 10) {
visit('/you-won');
}
}
}
See Code Block in Script
Hey team! I was sceptical about stimulus and turbo at first, mostly because I spent a lot of time learning react to give my front end a better user experience, but after playing around with stimulus for a bit, I must admit, I love it…
{{ form_start(form, {
attr: { 'data-turbo-frame': formTarget|default('_top') }
}) }}
{{ form_widget(form) }}
<button class="btn btn-primary" formnovalidate>{{ button_label|default('Save') }}</button>
{{ form_end(form) }}
See Code Block in Script
26 lines | templates/_modal.html.twig
// ... lines 1 - 14
<turbo-frame
class="modal-body"
src="{{ modalSrc }}"
id="{{ id }}"
loading="lazy"
>
{{ modalContent|default('Loading...') }}
</turbo-frame>
// ... lines 23 - 26
See Code Block in Script
33 lines | templates/_modal.html.twig
// ... lines 1 - 14
<turbo-frame
class="modal-body"
src="{{ modalSrc }}"
id="{{ id }}"
>
{{ modalContent|default('Loading...') }}
</turbo-frame>
// ... lines 22 - 33
See Code Block in Script
{{ form_start(form, {
attr: { 'data-turbo-frame': formTarget|default('_top') }
}) }}
{{ form_widget(form) }}
<button class="btn btn-primary" formnovalidate>{{ button_label|default('Save') }}</button>
{{ form_end(form) }}
See Code Block in Script
{{ form_start(form, {
attr: { 'data-turbo-frame': 'product-info' }
}) }}
{{ form_widget(form) }}
<button class="btn btn-primary" formnovalidate>{{ button_label|default('Save') }}</button>
{{ form_end(form) }}
See Code Block in Script
33 lines | templates/product/_reviews.html.twig
// ... lines 1 - 28
{% elseif not is_granted('ROLE_USER') %}
<p><a href="{{ path('app_login') }}" data-turbo-frame="_top">Log in</a> to post your review</p>
{% endif %}
// ... lines 32 - 33
See Code Block in Script
101 lines | templates/base.html.twig
// ... lines 1 - 87
{% block weather_widget %}
<turbo-frame id="weather_widget" src="{{ path('app_weather') }}"></turbo-frame>
{% endblock %}
// ... lines 93 - 101
See Code Block in Script
101 lines | templates/base.html.twig
// ... lines 1 - 87
{% block weather_widget %}
<turbo-frame id="weather_widget" src="{{ path('app_weather') }}" loading="lazy"></turbo-frame>
{% endblock %}
// ... lines 93 - 101
See Code Block in Script
import { Controller } from 'stimulus';
import * as Turbo from '@hotwired/turbo';
export default class extends Controller {
count = 0;
static targets = ['count'];
increment() {
this.count++;
this.countTarget.innerText = this.count;
if (this.count === 10) {
Turbo.visit('/you-won');
}
}
}
See Code Block in Script
import { Controller } from 'stimulus';
import { visit } from '@hotwired/turbo';
export default class extends Controller {
count = 0;
static targets = ['count'];
increment() {
this.count++;
this.countTarget.innerText = this.count;
if (this.count === 10) {
visit('/you-won');
}
}
}
See Code Block in Script