Single block for multiple pages

Hi!
I want to use my code in the Code Widget block. This block will contain my code and should be the same on a large number of pages. How do I make it so that I don’t have to update my code on each page separately?

1 Like

Hi @Bimbrother,

Place the HTML bric in a global section.
The header and footer are both global sections.

Hi @Whittfield,
Thanks for the answer!
I will clarify the question. An example is the website BIM 360 Docs Help. It has a link tree on the left. This tree appears the same on each page. In Blocks, you cannot make a global space on the right or left - only on the top or bottom. If you try to create a similar site in Blocks you will have to manually fix the link tree on the left of each page. And I want to know how to make it so that in one place to fix the link tree, and it changed on all pages?
Uploading: Снимок экрана 2019-11-29 в 17.52.49.png…

Okay got it.

This sounds like a “Global Bloc” concept. Update the Bloc and it updates everywhere. Love the idea, not sure if it exists yet. I don’t think it does.

I’m not sure what can be done in this case. If the left column is a separate bloc I suppose you could update it by duplicating your master to those pages. (I’m honestly not sure if this will work, just an idea)

That’s all I’ve got, sorry.

1 Like

@Whittfield do you have an easy method to call an external file and populate the bric from that?

1 Like

I do not see it so complicated, make a side panel either left or right I leave a video and tell me if it is what you are looking for.

http://manuelrosique.com/01.mov

Using a global zone, add the menu or links with the styles you want easily and add a “fixed-left” code and that’s it, everything is updated every time you update in the global area on all pages.

2 Likes

@Whittfield,
anyway, thanks for the help! Now I know for sure that it will not be easy to do it.

@nelo,
that sounds like something that might help me. But in my case, too much data will have to be loaded at a time on the page.

As for the suggestion of fixing the global column to the left, that only partially works here because based on the link you provided you want side nav AND a global nav above as well.

Just thinking out loud…

Quite a few ways to go here if you are using code, Ajax and json/xml would be my approach.
For non-coders something simpler might be Object tag in HTML5. (similar to iframes)

<object type="text/html" data="http://your-domain.com/page-with-menu.html" width="400px" height="600px" style="overflow:auto;">
</object>

My concern here is how you will handle responsive behavior this way.
It’s more work and a bit clunky, but doable.

You can load as much data as you like in the global area in a block for a side panel, and you can also use another block for a horizontal menu navigation above your side menu! I don’t see much problem, I just have to adjust for mobile.

I guess I’m not clear. So the new Bloc you add at the top would be somehow global as well?

I observe it this way: in the global area you can place more than one block that is to say I can add a navigation block for the normal menu and add another block for a vertical menu the two blocks in the global area, so any change would look affected on all pages!

That’s interesting @nelo, never considered doing something like that with the global area. Thanks for sharing.

1 Like

Thanks for explaining that. :+1:t4:

1 Like

I still wished there was a feature that allows you to create a block that can be used on multiple pages and is automatically updated on multiple pages. That would save so much time. I mean its called BlocsApp!

2 Likes

Reading through this thread, I think @nelo initiated a good idea here but from the perspective of a non-coder using Blocs, that approach might not be easily understood. But I get the idea, and I think it’s a valid one. But the way I see it, it would be better for novices as well as advanced Blocs users if it was more in the form of a bric that can allow users to place global content onto a project. A container of sort, where other control brics can be added.

This would allow designers to add controls globally in areas of their choice (such as in the scenario described in this thread). Heck, this “Global” bric could even have a list in the inspector where the designer can select what pages in the project would show the global content. It would (by default) show in all pages, as the name implies, but the designer can determine whether to exclude it from certain pages. Though I’m not a developer, I’ve worked along side them for over 20yrs, so I understand it’s never easy, but is it viable?

I think this would be a great capability to have (maybe Blocs 6? :thinking: :wink:) I certainly would love to see this be available in Blocs. @Norm, do you think this is possible in a Blocs future?

I’m also curious to know how many people on this forum thinks this is something useful for their projects. Let’s see a show of hands, anyone?

1 Like

+1, Global content or components have been asked about for a long time now. It’s pretty standard in most web builders. Some even have ones that allow you to modify content on a page if needed, but keep the structure… that would be game changing.

Components or partials what ever you want to call them, would revolutionise making sites in blocs, you could create master template pages. The tools the cool kids have :joy:

No doubt it would have to be a major release feature. :smile:

2 Likes