Partials - Reusable Brics grouping

Hello,

in Rapidweaver with Stacks its possible to create “Partials”. Partials are one or multiple elements which can be grouped and used on other pages. I’ts a little bit like BlocksApps Global Header and Footer, but more flexible. You can chose yourself on which pages you put which partial. For example this makes sense if I create a side navigation or a multi-language website. The Navigation on a multilanguage website is for 2 languages on 50% of the sites the same and on the other 50% for the other language the same. There are a lot more cases where this really helps building websites faster. Perhaps an idea for BlocsApp 3 or 4 :wink:

I don’t know why no one commented on this 2018 post. This is absolutely essential and still hasn’t been implemented in Blocs. We need a Blocs-style Partial tool. Like now! It should be easy. The footer and menu work exactly like that, so why isn’t that feature available?

1 Like

Desirable maybe.. It was always a bit cludgy in RW. I also remember it could cause the file size to increase and unused partials would get uploaded and then become ‘persistent’ when you didn’t want them within a project you had copied.

Similar feature requests have been made for several years in many threads. It just hasn’t made it to the priority list to implement I guess, for what ever reason. :man_shrugging:

This same feature desire was also mentioned in 2016 on the old original blocs forum.

I’ve just started using blocs and would find it useful if you could create global blocks on the centre area of a page, so if you made a change to the bloc on one page it would also update the same block on another page. Is this possible?

But it was not commented on there either by the app developer.

However interestingly, 2016 was the same year Web Components arrived in Chrome.

Web Components, the initial concept began in 2011, v0 spec was 2013, 2016 was the v1 modern standard and by 2018 most all browsers supported ‘autonomous custom elements’, Edge instantly caught up when it switched to Chromium in 2020. Typical of Safari being the bottom dweller of browsers and pain point for developers, Safari still does not support “customized built-in elements” but at least it does autonomous.

Web Components - Web APIs | MDN

https://developer.mozilla.org/en-US/docs/Web/API/Web_components

Web Components could be considered for a built in feature within blocs for global, partial, linked, shared (whatever a person wishes to call them) elements, to finally arrive.

With this, reusable elements can be created, but also unique iterations of the duplicates are even possible. Basically fulfilling the concept of partials, globals, shared, linked, etc., elements. Which people have been asking about for a decade. This could be the underlying modern way for blocs app to wrap its visual build approach around such a feature for users, if implemented correctly its also SEO friendly.

Pinegrow does all this visually in app with Web Components, so it’s demonstrated there if a person questions it.

But it seems like workarounds remain the name of the game for blocs. For example …

https://forum.blocsapp.com/t/can-you-create-a-linked-section-on-multiple-pages/28137

With the Fetch API approach shown above from the other thread, a person could prevent Flash of Unstyled Content (FOUC) by adding two css styles one for hiding the element initially and the other to fade in when the Fetch is loaded. The script could also benefit from some further fail safe checks. But SEO can be sketchy depending on content type and bot type.

With the PHP Approach shown above from the other thread, although it works at its basic sense it could be written more robust, guessing about 130 to 150 lines of PHP to do it optimally. SEO is good because it writes from the server, bots see everything first pass.

PHP would be a great choice, but …

It would be nice if users could see the instances in the app across pages/site with whatever approach since blocs is a visual builder, generic place holders for such elements would be confusing and rather weird within the visual nature of the app. But it seems people are used to such generic non rendering holders within blocs for various other things so maybe not an issue.

So again, Web Components could be considered for a built in feature within blocs for global, partial, linked, shared (whatever a person wishes to call them) elements, to finally arrive. Or I guess someone can add another long desired feature as a paid additional cost 3rd party bric again as an alternative.

1 Like