Add text from an external doc

Hi everyone, is there a way to insert a list into Blocs from an external text file?

These are concert dates, so I’d like to know if there’s a way to update the list without manually editing the text lines each time, but rather by editing the text file that links to a specific bric…

Thanks in advance to anyone who can help!

HI @Gfm

Welcome to Blocs and I have done a couple websites where I have performers who want to add dates of either dates they have public shows or dates of wedding showcase events.

I do this via the Brilliant VOLT CMS which is a one off payment, but you can expand this by have a Blog and more areas to edit if need be. It works seamlessly and the developer is on here (@Jannis ) who is brilliant at helping and quick too which is a huge bonus. But what you’re looking for is pretty easy to apply.

Goodluck

2 Likes

Not downplaying Volt CMS or its extensive features, but for this alternatively it would only require a trivial amount of JS to fetch and build a list from a text file. So maybe Norm can whip up a little Bric or add something via Custom Interactions for a simple Blocs approach. Blocs preview uses a local server so it should work fine both locally and online when developing.

1 Like

240

Thanks everyone for your valuable advice! I’m looking for something simple. I’m not an expert, and I need it only for my band’s website. Can you help me specifically with the code I need? Thanks in advance.

Then bring up a working solution and support it for free for the community.

2 Likes

You have special characters in the file names that are not allowed. Do not use space or special characters etc. Change the names and it should work.

1 Like

hi @Gfm ,

That’s exactly what I’m doing for my local band’s little site, Bloca and Volt CMS works a charm.

2 Likes

Perplexed regarding the triggered defensive reaction 3 months later, especially after explicitly expressing “not downplaying” Volt CMS and that Volt has “extensive features”. Obviously those did not calm or mitigate the simple mention regarding possible basic alternatives.

As mentioned previously, the JS Fetch API which is part of core foundational languages of the internet and is available freely to everyone, can be used for your task with minimal required script. The same can be said for PHP also, if desired.

Not sure why either approach (Fetch or PHP) would definitively require or necessitate a Custom Bric or CMS with support in such a case for this stated usage of — “populate a list from a txt file”. Though, it could have been a good example for Blocs own Custom Interactions to showcase its no-code abilities.

@Gfm Just ask — Google Gemini AI — it should easily be able to advise you on the minimal implementation of either the JS Fetch API (available for a decade) or PHP (available for 3 decades) — to populate a list from a txt file. Why, because this very topic has been discussed exhaustively millions of times across the internet. Make sure to tell it that you’re using Blocs app for Mac, it will need to take that into consideration when suggesting how to use these approaches within Blocs.

https://gemini.google.com/app

Below are generic Prompts to show you, just copy each into Gemini, sequentially after it responds.


Initial - Prompt for Gemini (then wait for it to respond)

You are an expert at both Blocs for Mac and coding JS, I’m a complete novice so please be detailed, accurate and explain everything so I can understand the process and approach clearly. I’m using Blocs app for Mac, explain how I can use the Fetch API to populate a list in the app from an external txt file. I’ve already added a list Bric where I want it on my page within Blocs and styled it visually inside Blocs with CSS classes already using the CSS Class Manager within Blocs app. Provide the required optimized JS for the Fetch API that works in all browsers that support Bootstrap v5+ like Blocs app, use best code practices and also comment the script line by line, explain in detail how I would use the provided script to accomplish this inside Blocs with the required Blocs app feature entry points within the app. Show what my text file contents need to look like. Explain everything in clear detailed wording for a novice. Also, explain any issues or things to consider with Blocs that I may encounter when implementing this in the app or uploaded to my server.

1st - Follow-up Prompt (after it responds)

What if it’s for a bands tour or concert dates, with url option to buy tickets

2nd - Fun Follow-up Prompt (after it responds)

Can you show the same result but using PHP for this same setup


Ask whatever you want, but hopefully you can clearly see it’s just a bit of code (even with inline comments) and setup to accomplish this inside of Blocs.

You will have your own AI tutor to freely help you through it. Don’t worry you won’t break anything trying with Blocs, just setup a test Blocs file and play around, upload to your server, test, refine, learn. If you have issues or more features explain those as additional follow up Prompts and talk it through with AI. You should then be on your way doing neat stuff with Blocs, freely with your own initiative and learning along the way.

But if you’re still not comfortable with doing it that way, unfortunately it’s been over 3 months and no Custom Interaction example emerged from Blocs, which is the no-code approach within the app and would be a great way to showcase the Custom Interaction feature. You could of course instead use Volt CMS which seems to be the consensus throughout the thread to accomplish this simple request — it’s only $99 — you might like/enjoy its additional features beyond “populate a list from a txt file”.

Side Joke: Make sure to obfuscate the Fetch JS code you get from AI so it feels like a fancy paid Bric regardless of its simplicity — just kidding — relax folks.

Your question “populate a list from a txt file” has been asked literally millions of times in various terms across the internet. The concept of doing so is nothing fancy and certainly not proprietary in web development and can be accomplished freely if you desire, even for those completely unfamiliar with it.

Learn, have fun, expand your possibilities. Enjoy Blocs App.

1 Like