Text Data Source

Update… forget it guys, using the technique below didn’t work on the mobile version, not sure if it’s a bug…

Just made the discovery (!) that I can use links to images from other websites instead of importing them as assets - meaning it’s quick and easy and doesn’t add weight to the project… see the blue Ford Mondeo image here, linked to an Ebay image, all the other images are from the Assets Manager http://www.jhautomotive.co.uk/sales.html

So my question - I can’t see a way of doing the same with selected text from a website, is there a way?

Ta.

there is not, its easy to add externally hosted images as they are a file but text would usually be part of a database or a static page. I think in the future it would be a nice feature to add but would take a lot of work and a very specific setup.

Wouldn’t this be pretty simple with a dab of php and an input in the interface for the source file.

Something like this would make it possible to roll your own CMS like behavior by giving clients write access to a directory of text files they could update without having to subscribe to a service.

Just thinkin’ out loud here.

1 Like

Sounds good! Not sure how it would all work, but sounds promising

Pretty simple. Have a look at these two files:

http://scottinpollock.us/test.html
http://scottinpollock.us/test.php

The last paragraph in the html file (surrounded by p tags) is:
" This content is part of the actual page html file."

The last paragraph in the php file (surrounded by p tags) is:
" <?php include 'stuff/test.txt';?>"

That is the only difference between these two files except of course the file extension.

1 Like

Could’nt you do this already with the HTML widget and setting the page suffix to PHP?

Of course. But the user would need to know how to tag it, and then there would be nothing in the interface but an empty box. Another issue would be that if they assigned custom attributes to the text area (type and appearance settings), they would have to assign those manually in the html enclosed in the widget.

I thought you were looking for something available from the interface to avoid that.

My thinking is you would point the data source via nav services to an external file, and show its content in the interface for preview. Then when an export was done, you swap that out for the include command and a relative path for the file source. Since the call to PHP is within a text container, it would inherit any class/style info assigned to it.

It is not something I need or want, I was just thinking out loud. If I needed it for anything I would just assign some placeholder text like the relative file path in the Blocs text container, and use textfactories to search and replace that with the PHP after export. I may in fact do something like this in the future as the one bitch about some CMS is if I have to post changes to say a Cushy’d site by uploading a new Blocs export, I overwrite their current edits.

BUT… to reconsider the original request from @Ian, I discovered when doing my little test that my host has allow_url_include turned off in its PHP config for security reasons, and am assuming most other hosts would be configured similarly. This means that pointing to data on another site would not be possible… so in this context the whole thing is a bit moot. (c;

1 Like

Well, that’s way over my head, but thanks! Would have been nice though…

BTW, I’ve had to scrap the insertion of an image from an external URL as the Blocs keeps ‘losing’ the pasted URL in the Data input field. Even after being saved, it’s vanishing.

Not sure if that’s a bug @Norm ?

Could be, does the image still load? Just the field is empty?

After being saved (this exported and uploaded correctly)…

After closing and reopening the project, the URL has disappeared…

Ok I’ll check it out tomorrow!

Another issue, sorry Norm… can’t ‘save as’ as Blocs quits, I’ve rebooted, no change.

2.4.1 on High Sierra 10.13.

1 Like

Is that the GM High Sierra?

Yes, GM…

@Norm Also, I cannot save changes, the project quits on Command+S and Shift+Command+S.

Looks like a project related issue. Could you send me the project please.

Norm - sent you both projects via the magic of Dropbox, let me know if there’s a problem. Ian

1 Like

Do you get any problems with new projects when you try to save?

I just did a quick check with your file and it doesn’t crash for me with the latest beta 2.4.2, have you tried that version?

Haven’t got any newer projects, and no I haven’t tried the Beta but I will as soon as I have time this afternoon, I’ll let you know the result.

1 Like