BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> openElement General Discussion
  New Posts New Posts RSS Feed - "Export to Folder" code block only resource files
  FAQ FAQ  Forum Search   Register Register  Login Login

"Export to Folder" code block only resource files

 Post Reply Post Reply Page  12>
Author
Message
leroyle View Drop Down
Newbie
Newbie


Joined: Jan 07 2020
Location: Richardson, Tx
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote leroyle Quote  Post ReplyReply Direct Link To This Post Topic: "Export to Folder" code block only resource files
    Posted: Feb 11 2020 at 6:54pm
Hi,
I have some resource files, images and audio mp3 files, that are referenced within code blocks but are not referenced from/used by any OE elements. 

For instance one code block uses the html <audio> element to present an mp3 file for playing. 
<audio controls>
<source src="myaudio.mp3" type="audio/mpeg">
</audio>

When I "Export to Folder" the audio file is not copied into the export folder Files/Audio/.

If I link that audio file to an element, button for instance, then it is exported to Files/Audio/ as we might expect. So I could use hidden elements to force the export.

Is there another way to "force" these types of "code block referenced only" resource files to be exported?

I've tried searching this forum be came up empty.

Thanks.
Back to Top
digizar View Drop Down
Senior Member
Senior Member
Avatar

Joined: Dec 30 2015
Location: Germany Frankfu
Status: Offline
Points: 742
Post Options Post Options   Thanks (0) Thanks(0)   Quote digizar Quote  Post ReplyReply Direct Link To This Post Posted: Feb 11 2020 at 8:05pm
To 'activate' resources/images, ... they have to be 'imported' fom original location into oe resources.
If you use those resources from outside of oe, they are not known to oe. Not transferred and not updated, just unknown.
That condition of oe is by far not known. But it's an important key for the usage of oe.

So,
whenever you'd need a resource/image/sound/clip to be implemented on oe, it is required to transport/invoke that to the resource(s).
The further advantage is, that the original of that image is kept anwhere, it will never be touched (just  copied to oe).
The access will always be through oe internally. It is 'embedded'. Oe could not find it else, because it is also not transferred to the server.

How to establish that?
Don't be scared, it's simple.
When you see the symbol for implementing a resource
(screen shot 1), that button leads you to the resources part of oe.
You select a resource (image) from there only. That makes that image known to oe.
And it includes that particular resource into the optimization process (manually triggered), but leaves the original(s) untouched (Preferences ... Maintenance, ...).

If you do not yet have such resource there, you may add it
(screen shot 2).
Pull that wanted symbol/image from the original place, add it to the resources. It's just copied.
That leaves the original intact. Only oe has internal access to it via the resources. Very nice. You may even delete that resource/mage at the original location, it is still known to oe.

One thing else, you might consider
(screen shot 3).
To keep an order to find resources already existing in oe's resources,
I urge you to create some correspondingly named *Folders*.
You may easily create any *folder* (New Folder).
There are exceptions. Some entities/resources have to go to the *Other* ... folder(s), you'll find out
(screen shot 4).
Be careful to give meaningful names, because it's not so simple to change the folder names.

Be acquainted with the resource handling, that helps alot.
Usually it is not required to manually coding in oe for resources.
I made the same mistake, referenced the resources from original location only.
But I was not really happy.

It is a pretty simple process - once you know the beef.

Recently I put my sample project online for free usage.
That might give you more info. It might help you.
https://forum.openelement.com/en/forum_posts.asp?TID=1622&title=sample-website



Screen shot 1



Screen shot 2



Screen shot 3


Screen shot 4




Edited by digizar - Feb 12 2020 at 1:48am
___________________________________
Ask questions only if there is no answer yet.
https://blumendigi.com
Back to Top
leroyle View Drop Down
Newbie
Newbie


Joined: Jan 07 2020
Location: Richardson, Tx
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote leroyle Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 2:41am
Thank you Digizar,

I did "catch" my self copying the files as a temporary test into $project/Files/Audio. But once I recalled that was not correct I then removed them, then,

1. clicked on the "project" tab, then the Resources icon
2. clicked on the "audio" tab
3. created a couple of folders as you suggested, 
4.  and then  "Add Audio Files" within the newly created folders
5. I exited the Resources dialog and re-entered it. 
 I verified could see the newly added folders and their audio files.

 Then I clicked on the "Export to Folder" icon to run the export again.
Once complete I do not see the audio files within the exported Files/Audio folder.

If I then,
1. add a text link to my page
2. then at the "Link Configuration" dialog which pops up
3. select "File" as the destination or script
4. at the Resources dialog that pops up, I can navigate to the Audio tab and down my created folders
5.  I can select one of my audio files that were added in the above steps
6. then click "Ok" at the Link Configuration dialog
7. save all pages

Now if I "Export to Folder" I can see within $project/Files/Audio the audio file associated with my text link, but I do not see any of the others.

Using the project tab, Resources icon was the only way I could see to bring the files into my project.

Is there another way I should be using so that all of my files get exported even though they are not explicitly associated with an OE element, but are referenced within custom html within a code block.

Or, must the files be referenced by an OE element in order to be eligible for export?

thanks again


Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6209
Post Options Post Options   Thanks (1) Thanks(1)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 3:27am
Originally posted by leroyle leroyle wrote:

Hi,
I have some resource files, images and audio mp3 files, that are referenced within code blocks but are not referenced from/used by any OE elements. 

For instance one code block uses the html <audio> element to present an mp3 file for playing. 
<audio controls>
<source src="myaudio.mp3" type="audio/mpeg">
</audio>

When I "Export to Folder" the audio file is not copied into the export folder Files/Audio/.

If I link that audio file to an element, button for instance, then it is exported to Files/Audio/ as we might expect. So I could use hidden elements to force the export.

Is there another way to "force" these types of "code block referenced only" resource files to be exported?

I've tried searching this forum be came up empty.

Thanks.

OpenElement creates some sort of databases that list the elements to include into the export.

When you use code block to include a file into your pages OE doesn't know it.

If you use Project=>Resources to import these files into OE, you can also use Project=>Resources then select files and use the publish button to export them.

Back to Top
digizar View Drop Down
Senior Member
Senior Member
Avatar

Joined: Dec 30 2015
Location: Germany Frankfu
Status: Offline
Points: 742
Post Options Post Options   Thanks (0) Thanks(0)   Quote digizar Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 10:26am
Originally posted by leroyle leroyle wrote:

Using the project tab, Resources icon was the only way I could see to bring the files into my project.
That is ONE requirement to access the resources. To make them visible in the resource portion.
But it's NOT the complete way to 'connect' them to the site.
It's a very small button at the lower left side of an element, to 'invoke'/reference them into oe.
See screenshot 1 (former posting).
Use that, it's mandatory.
I don't know anything about code segment as you tried. As I'm not really familiar with html, only a little bit.
Your 'code solution' seems not to catch and connect the resurce(s).
Because if a resource is not referenced/linked, it is not worth to export it.


Is there another way I should be using so that all of my files get exported even though they are not explicitly associated with an OE element, but are referenced within custom html within a code block.
You could, but actually the browser would probably not find them, because there ist no reference for such element/resource/image. They would not be created in the project, even if they appear in the resource portion. So it's bad practice, it simply does not work.
As a rescue you could *Export to folder* (which puts everything referenced -and only the referenced resource(s)- into a folder, as mentioned before). Not referenced/linked? => resource not required, no transfer.
And then transfer the complete content of that folder to the server with FTP (Mozilla).
But even then it takes the linked/referenced resource(s) only. Not referenced? => not created, not transferred. Because even the complete *Export to Folder* would not create that resource in the folder, oe simply does not know the resource.
I usually use that methode once a while, because oe sometimes gets confused which files actually to transfer after being changed. That situation is true if you *Exported to folder*. For oe that means, next upload, it has transferred all files already, nothing to transfer. It's true also for partial rebuilt pages.

Or, must the files be referenced by an OE element in order to be eligible for export?
YES, see screenshot 1 (former posting)


Edited by digizar - Feb 12 2020 at 1:11pm
___________________________________
Ask questions only if there is no answer yet.
https://blumendigi.com
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6209
Post Options Post Options   Thanks (1) Thanks(1)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 12:45pm
I just designed a new element for MP3 / OGG files


Built from HTML5 standards for OpenElement, if you use it, OE will know the audio file and export it

Currently it is minimum, It allows for MP3 and OGG and is limited to full controls, I will add options later today.


Procedure:

  1. Download the zip file
  2. Unzip the content
  3. Copy the file in the Common/Elements directory
  4. Start OpenElement, you will see the new element appearing into the Element's Media menu


Edited by Hobby001 - Feb 12 2020 at 1:48pm
Back to Top
leroyle View Drop Down
Newbie
Newbie


Joined: Jan 07 2020
Location: Richardson, Tx
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote leroyle Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 4:13pm
Thanks Hobby001,

My "normal" workflow at this point is to "Export to Folder" then copy those files up to the web server as sometimes they go to a production location, sometimes to a test location. 

Once I setup my publishing configuration correctly, I can indeed "publish" the resources within the Resources "File Library" dialog. This does push them up to the web server. But I suppose all go, even those not currently "desired" by the developer, but we could pick and choose individual files I suppose.

But they will still not make it to the "Export to Directory" location.
Back to Top
leroyle View Drop Down
Newbie
Newbie


Joined: Jan 07 2020
Location: Richardson, Tx
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote leroyle Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 4:17pm
Hobby001,

I'll give your new element a try, thanks.

If I do not use that I'll just associate the audio files with a hidden element. Then they will seamlessly go along for the ride.


Thanks again to you both for your help.
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6209
Post Options Post Options   Thanks (1) Thanks(1)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 4:19pm
Originally posted by leroyle leroyle wrote:

Thanks Hobby001,

My "normal" workflow at this point is to "Export to Folder" then copy those files up to the web server as sometimes they go to a production location, sometimes to a test location. 

Once I setup my publishing configuration correctly, I can indeed "publish" the resources within the Resources "File Library" dialog. This does push them up to the web server. But I suppose all go, even those not currently "desired" by the developer, but we could pick and choose individual files I suppose.

But they will still not make it to the "Export to Directory" location.

The new element makes OpeneElement to add the image to the ressources and to publish the targetted image to the server automatically. 
Back to Top
leroyle View Drop Down
Newbie
Newbie


Joined: Jan 07 2020
Location: Richardson, Tx
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote leroyle Quote  Post ReplyReply Direct Link To This Post Posted: Feb 12 2020 at 4:29pm
The audio element does the trick. I can toss my code block. 

Thanks much.

(Guess I should learn how to add elements but I'm not big into the web side of things. )
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.070 seconds.