Support Forums

Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Change default media folder for PageBuilder 3

Featured Lock Resolved Issue
I've updated the default media folder in the global configurations to "_site-resources" which works for a standard Joomla article just fine, but Page Builder doesn't appear to inherit these default Joomla Configuration settings. How/where do you change the default media folder? I don't want to use the default /images folder.

Attachments (1)

  • Screen Shot 2018-01-06 at 8.54.34 PM.png
    Screen Shot 2018-01-06 at 8.54.34 PM.png 307.4 KB

53 Answers

joel_m

More than a month ago #Permalink
I agree with Paul. I'm implementing SP Page Builder into YOOtheme's Warp framework and I highly recommend that you implement an option to change the default media folder to Joomla's images/ folder or a specific folder.

Paul Frankowski - Staff

More than a month ago #Permalink
Hi,
You know that if you edit component core file, in future you'd have to edit it every time after each update.
--
Probably our developer knows better, but after my short investigation I discovered at least those:
administrator/components/com_sppagebuildera\views\page\tmpl\edit.php
components/com_sppagebuilder\views\media\tmpl\folders.php
components/com_sppagebuilder\views\form\tmpl\edit.php
plugins\system\sppagebuilder\sppagebuilder.php
modules\mod_sppagebuilder\fields\pagebuilder.php

Paul Scarnegie

More than a month ago #Permalink
So if I understand correctly, you've developed a component for Joomla which contains a "media" element that not only doesn't adhere to the Global Configuration parameters inherent to every Joomla installation (ie default media directory), but also doesn't contain the ability to edit the component's default media directory without hacking the component itself?

Am I understanding you correctly? Did I actually purchase a $180 subscription to utilize a component that doesn't allow me to edit the parameters for something as important as where I want to put all of the media associated with my website?

Paul Frankowski - Staff

More than a month ago #Permalink
If I may... how many users change /image folder, 1% or even less ?
It wasn't planned by Us. SPPB is on the market since 2014, and you are probably first person who asked about this change. For common user it's not main feature.
---
But I agree , it should be somehow possible in future.

Paul Scarnegie

More than a month ago #Permalink
Paul, thank you for getting back in touch with me - I know I sound a little irritated and I do apologize. I want to love the Page Builder. I really do. I've been using YooTheme for about 12 years now and started with their newer YooTheme Pro which has a nice page builder, albeit not as advanced as what you folks are offering which is why I started to make the migration over for a new rebuild. I also think that your framework has greater flexibility than Yoo's, but again at the expense of a much larger learning curve.

To answer your question, every install I've done since Joomla 1.0 has veered away from the default media folder. Some could argue personal preference, existing cron jobs, organizational control - what ever the bend, it should be a non-issue. Those options are in the default configs and should be maintained as such. Most of my clients have an abundance of files, images, pdfs, etc and Joomla's default configuration allows setting a default path to images AND a default path to documents - which is very important as far as organization on our end. It's all part of an established workflow. Even the JCE editor, which has stellar media control, has a parameter to allow setting these folder preferences.

So again, I apologize if I've been a little ... um ... upset, but as an iOS developer myself, it's just bad design to remove functionality already built in to the core operating system and expected to be there by default.

blueoceanyyc

More than a month ago #Permalink
Hi,

We too have asked for this in the past on this forum, Paul is not the first one to ask for this feature.

We use a different Joomla image folder for security purposes and also have a need to have components adhere to Joomla's custom image path.

We would really like to see PageBuilder get an option to change image / media paths.

PageBuilder 2 was a bit easier to set to custom image path than PageBuilder 3. For PageBuilder 2 there was a forum posting here: PageBuilder 2 - Change Media folders

For PageBuilder 3 - I have listed the files that I have changed:


administrator/components/com_sppagebuilder/assets/js/media.js (2 hits)
js file is now minimized, har d to give line numbers.

administrator/components/com_sppagebuilder/models/media.php (2 hits)
Line 201: $path = $input->post->get('path', '/images', 'PATH');
Line 206: $folders = self::listFolderTree(JPATH_ROOT . '/images', '.');

administrator/components/com_sppagebuilder/controllers/media.php (1 hit)
Line 81 to 89:

if( $media_type == 'image' ) {
$folder_root = 'images/';
} elseif ( $media_type == 'video' ) {
$folder_root = 'media/videos/';
} elseif ( $media_type == 'audio' ) {
$folder_root = 'media/audios/';
} elseif ( $media_type == 'attachment' ) {
$folder_root = 'media/attachments/';
}

administrator/components/com_sppagebuilder/views/media/tpl/folders.php (3 hits)

Line 17: $path = $input->post->get('path', '/images', 'PATH');
Line 55: $path = $input->post->get('path', '/images', 'PATH');
Line 63: $tree = '<option value="/images">/images</option>';

administrator/components/com_sppagebuilder/views/page/tmpl/edit.php (1 hit)
Line 82: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');

plugins/system/sppagebuilder/sppagebuilder.php (1 hit)
Line 95: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');

components/com_sppagebuilder/views/form/tmpl/edit.php (1 hit)
Line 127: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');

components/com_sppagebuilder/views/media/tmpl/folders.php (1 hit)
Line 11: $path = $input->post->get('path', '/images', 'PATH');

modules/mod_sppagebuilder/fields/pagebuilder.php (1 hit)
Line 76: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');


After these changes, result for us is:

https://dha4w82d62smt.cloudfront.net/items/2E0j0j0T0q0F0d1Q0E07/Image%202018-02-10%20at%2012.06.48%20PM.png?X-CloudApp-Visitor-Id=2872511

Hope to hear from you soon.

With best regards,

Piet Nutbey

Paul Frankowski - Staff

More than a month ago #Permalink
personally I cannot change this,
I can only ask about this improvement as I did some time ago.
---
thanks for tips

Paul Frankowski - Staff

More than a month ago #Permalink
Security tip
Add into /images (or new /images) folder htaccess rules which will protect from php files upload/access.

blueoceanyyc

More than a month ago #Permalink
Thanks Paul! Here's hoping the PB Dev team can make the improvements.

pepperstreet

More than a month ago #Permalink
Following…
(PS: And I totally agree with the other users!)

Nait

More than a month ago #Permalink
Hi,
I agree with all those who are iń need to change the path in an easy way. I´ve built over 200 sites with Joomla and maybe 10? were left with the media path set to "images".

I´ve discovered PB about year ago and it became my really powerfull friend, saving VERY MUCH of my time, so I am happy with every new release.

Please, add the topic to a "wishlist".

Best regards.

joel_m

More than a month ago #Permalink
+1 following :)

Maren McPeak

More than a month ago #Permalink
+1

Erik

More than a month ago #Permalink
+1

Peter

More than a month ago #Permalink
Hi Paul.

I would like to be able to change the folder as well. I mean, it does not make sense to keep pdf, video, music, etc under images folder.

I am sure that dev team will agree.

Can this be fixed as a standard update feature?

Thanks!

Paul Frankowski - Staff

More than a month ago #Permalink
Can this be fixed as a standard update feature?


Our developers have seen that so many people ask for this feature so let's have hope it will be implemented soon.

Robert Stones

More than a month ago #Permalink
+1 from me too, I was just wanting to create better folder hierarchy - as time is always precious but then realised its not yet possible and does degrade an otherwise great extension.

Hope you can get an eta from the devs, I'm sure we'd all appreciate been in this 'loop'.

Regards,

iramko

More than a month ago #Permalink
+1

Please do something...
It saves a bunch of time and very simple to make this upgrade..

Thanks in advance..

Paul Frankowski - Staff

More than a month ago #Permalink
It's still on our list do to.

iramko

More than a month ago #Permalink
Dear Paul,

Thank you for your reply.
I look forward to see this upgrade soon.. :)

blueoceanyyc

More than a month ago #Permalink
That is great news, hope to see this update sooner than later, would make upgrading PageBuilder in our setup so much easier.

Thanks!

Paul Frankowski - Staff

More than a month ago #Permalink
in tomorrow, update, not yet. But I hope soon.

Geoff

More than a month ago #Permalink
I use a folder called /assets/ for all my Joomla images and PDFs. PLEASE we need a way to remap the SpPageBuilder's image path. Very important.

Geoff

blueoceanyyc

More than a month ago #Permalink
Just checking in to see if this topic is still an item on the dev's list... ?

Paul Frankowski - Staff

More than a month ago #Permalink
yes, it's on the list, but not in August.
Beside just check change logs

mbaggs

More than a month ago #Permalink
+1 for this feature to be implemented! Any update on this???

Kate Kleiman

More than a month ago #Permalink
Another request for the same thing. SP builder's media manager is putting images in a folder hierarchy
2019 >
03 >
04 >
16 >
Makes absolutely no sense. To get to images in a way that I can identify them, I have to browse folders to find the one I want. If update is not coming really soon, I'm changing the code as described above.
When will it get here?

Nait

More than a month ago #Permalink
Well, I understand the system for those using any kind of blog system (used in Helix, etc. and even in Helix is this setting pretty annoying) or for those who do not need to care and simply upload some ilustrative images, but for SPPB it really makes no sense.

Changing the code is a minute solution as any new upgrade rewrites the code back.

So, this is really something taking the SPPB down, while the rest is superb.

As mentioned above by Paul - this is put on the list (a pretty long time ago), but the solution is stil covered by the mists of Avalon.

Pavel

More than a month ago #Permalink
+1

Kate Kleiman

More than a month ago #Permalink
Not really an answer. SPPB is terrific, but as with any software, could use improvements based on user feedback. "Covered by the mists of Avalon" is not a professional way to describe progress on a user-requested issue. I'm spending an inordinate amount of time managing image assets and can cope with the override issue.

K.

Nait

More than a month ago #Permalink
Hello Kate,

I am user too, not a developer :D . That was just my sigh.

I use SPPB for many sites as it offers a plenty of interesting solutions, but I do agree with you - therea are improvements to do and this one I find really important. So, my "mists of Avalon" is not the light at the end of a tunell, but the statement of a things.

Pavel

More than a month ago #Permalink
Of course there is an inconvenience in where SPPB saves images by default. However, not everything is so dramatic - as a workaround, you can use two extra clicks before uploading an image. Click one - Browse Folders, Click two - select (create before this) the folder that you need, and then upload the image

Paul Scarnegie

More than a month ago #Permalink
My subscription to JoomShaper had lapsed so I wasn't able to read how the "1%" was responding to my original query almost a year a half ago. The fact that I had to have a current membership just to read the support blog is a different argument for a different day, but from what I can tell there have been roughly 4 SSP Page Builder updates since I - and apparently a whole lot of other people - have been requesting the simplest of feature updates. I wouldn't even call it a feature - having a Joomla plugin adhere to the built in Joomla settings/preferences isn't a feature - it should be a given! We as site builders have a need to organize our files in the way that best suits our purpose, what ever that purpose is. Hard coding the SSP Builder media files away from the settings available within the Joomla framework destroys an otherwise awesome extension. We wouldn't need a "work around" if it was coding properly from the beginning.

Geoff

More than a month ago #Permalink
As much as I genuinely love PageBuilder, I wholeheartedly agree with the above.

Even the idea of the uploads going into folders with date stamps isn't ideal for us. We'd rather organise our files our own way.

Regards,
Geoff

Paul Scarnegie

More than a month ago #Permalink
Geoff - I'm afraid this has all fallen on deaf ears. If I can figure out all the individual files that need to be edited I'll try to share it with the group. After spending $300 on a membership I now have to spend my free time learning more about JComponentHelper::getParams to fix what doesn't work!

blueoceanyyc

More than a month ago #Permalink
As users of PageBuilder since version 2 - we have asked for the same thing. Adhere to the Joomla logic when it comes down to choice of media folders. Still hoping for a PageBuilder fix to follow the Joomla standards, however I do believe that changes to current media folder setup are not a priority compared to new addon features. Or at least, that is the impression I get.

Having said that, since PageBuilder 2, we painstakingly will hardcode our preferred image paths and recode after each update.

For those who want to take a shot at it... below you will find the files that we edit to set our preferred media paths (mind you, this will maintain the PageBuilder data-structure, but now in the folders of your choice.)


administrator/components/com_sppagebuilder/assets/js/media.js (2 hits)
js file is now minimized, hard to give line numbers.


administrator/components/com_sppagebuilder/models/media.php (2 hits)
Line 201: $path = $input->post->get('path', '/images', 'PATH');
Line 206: $folders = self::listFolderTree(JPATH_ROOT . '/images', '.');

administrator/components/com_sppagebuilder/controllers/media.php (1 hit)
Line 81 to 89:

if( $media_type == 'image' ) {
$folder_root = 'images/';
} elseif ( $media_type == 'video' ) {
$folder_root = 'media/videos/';
} elseif ( $media_type == 'audio' ) {
$folder_root = 'media/audios/';
} elseif ( $media_type == 'attachment' ) {
$folder_root = 'media/attachments/';
}

administrator/components/com_sppagebuilder/views/media/tpl/folders.php (3 hits)

Line 17: $path = $input->post->get('path', '/images', 'PATH');
Line 55: $path = $input->post->get('path', '/images', 'PATH');
Line 63: $tree = '<option value="/images">/images</option>';

administrator/components/com_sppagebuilder/views/page/tmpl/edit.php (1 hit)
Line 85: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');

plugins/system/sppagebuilder/sppagebuilder.php (1 hit)
Line 102: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');

components/com_sppagebuilder/views/form/tmpl/edit.php (1 hit)
Line 128: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');

components/com_sppagebuilder/views/media/tmpl/folders.php (1 hit)
Line 11: $path = $input->post->get('path', '/images', 'PATH');

modules/mod_sppagebuilder/fields/pagebuilder.php (1 hit)
Line 77: $doc->addScriptdeclaration('var sppbMediaPath=\'/images\';');


I have also attached a zip file that we have used for the past updates, to our knowledge, these files have not changed for pagebuilder 3.4.3 to 3.4.7. Each update I will compare the original files with the contents of attached folder. When similar, I just ftp them, merge folders and overwrite files. Makes the process a bit easier.

The zipfile contents will set the preferred media folder to /uploads - so please use wisely and set to your preferred media folder of choice.

Attachments (1)

  • SP_IMAGE_UPDATE_CORRECTION.zip 30 KB

Paul Scarnegie

More than a month ago #Permalink
Blueoceanyyc - That's brilliant and very much appreciated. I'm sorry to see it took a paid user to make SSP more user friendly. I've downloaded your file and will dig through all the elements today!

Paul Scarnegie

More than a month ago #Permalink
Blueoceanyyc - Just a couple things on your attachement. Within your "components" directory, the "form" and "media" folders are within the "views" folder - so they're one more level down. At least in the SSP pro version that I've got installed.

Unfortunately this didn't seem to work completely for me on my end tho. While the media manager within SSP does indeed now point to your aforementioned "uploads" directory, when ever I upload a image into a blog styled article it places it back in the original "images" directory in the 2019/04/03 hierarchy or folders.

You're files are certainly a good start tho. Perhaps I'll be able to figure out the rest if time permits.

Attachments (1)

  • Screen Shot.png
    Screen Shot.png 44.7 KB

blueoceanyyc

More than a month ago #Permalink
Silly mistake on my part on the components view file. I have updated the attached zip file in original post.

Paul Scarnegie

More than a month ago #Permalink
OK, I think I've done the group one better. First a major shout out to blueoceanyyc for the initial assist in locating all the files that needed to be updated. The one element that was missing (at least on my end) was that the Helix framework (I'm using v1.0.5) also needed some changes because any blog pages were still putting their uploaded images into the default "images" folder. Granted, my updated files are still hard coded so it's still not the best scenario but maybe someone at JoomShaper will finally take a long hard through these and understand why it's important to a fair amount of us out here. Building an extension for a CMS framework that doesn't adhere to that framework's preferences is wrong on so many many levels!

Structure: For clarity sake, all of my externally referenced images (art, docs, media) start at a root folder called "_resources" (keeps it always at the top where I can find it quickly). From there there are subfolders called "blog", "documents", "images" and "media" respectively. I've attached an archive (again thanks to blueoceanyyc for the jumpstart) which makes my default images folder "_resources/images" with the caveat of any Helix blog type articles which will now go into "_resources/blog" respectively. Again, not a perfect scenario because it's still hard coded, but at the very least it will keep things better structured (IMHO) and out of the default images folder.

Moving forward, until JoomShaper get's off their ... well ... know upfront that any updates to the PageBuilder or to the Helix framework will most likely require overwriting them all again manually. There's only 11 files, but they're spread out across a number of directories so it takes a few minutes. I've also got original versions in the folders (.bak) just in case - again, I'm currently working from the v3.4.7 of Page Builder and v1.0.5 of the Helix framework.

So far my testing hasn't shown any problems. I do suggest not doing this on a production site until it gets a few more miles on it but after almost 18 months of waiting on JoomShaper I couldn't wait any longer - it appears to be working as expected on my end. To be fair, I wouldn't drop this task on a new web developer - you kinda have to pay attention to what you're doing or you'll really screw things up. Worse case scenario you can always just reinstall Page Builder over your current file and overwrite them back to JoomShaper defaults.

My hope is that this is worked in to an update in short order and we never have to do this again. Personally I prefer my blog images and my other site images to be in separate folders because it makes things easier to find for me. As it's already been mentioned, trying to find images in the 2019/04/03 hierarchy is not user friendly at all, but again a different problem for a different day.

I hope these hacking endeavors are a help to the rest of the group. Good luck and God Bless!

Attachments (3)

  •  Folder Hierarchy.png
    Folder Hierarchy.png 27.7 KB
  • Media Folder.png
    Media Folder.png 216.2 KB
  • SP-PageBuilder-3.4.7-Path-Updates.zip 138.8 KB

Paul Frankowski - Staff

More than a month ago #Permalink
Thanks, and really sorry for the delay with this "problem".

I asked our developer to speed up with this topic, so I hope soon hacks wouldn't be necessary.

blueoceanyyc

More than a month ago #Permalink
Much appreciated Paul!

LAC Webadmin

More than a month ago #Permalink
Hi Paul,

I second this request to update SPPageBuilder and template framework code base. Here's the exact code to get com_media parameter for path:


// get image path
$mediaParams = JComponentHelper::getComponent('com_media')->params;
$mediaBasePath = $mediaParams->get('image_path');


I wish your developers will make the update ASAP. Just like Paul Scarnegie we don't use the default Joomla /images path folder. Since Joomla 2.5 if I'm not mistaken or maybe 1.5, that folder path is configurable so there's no reason for developers to hardcode it as /images.

Thanks,
Jackson

Paul Frankowski - Staff

More than a month ago #Permalink
I wish that I could speed up that request... I suffer as much as you.
This topic is marked as resolved but i dont see an option to change default images folder without modifying core files.

Paul Frankowski - Staff

3 weeks ago #Permalink
Because users created their own customization code, use it

mbaggs

3 weeks ago #Permalink
Because users created their own customization code, use it
I'm sorry but that is not a resolution- that is a bandaid. A resolution would be the developers creating an actual fix. I don't go to the doctor with a broken arm in a make shift sling, and the doctor pronounces upon seeing the sling "You fixed it! Nothing more for me to do."

No, it's not fixed. Just because I made a sling to support my arm, the arm is still broken and needs to be mended-the bone reset back in place.

The user solutions here are not permanent. Each time you guys do an update, the update will reset our code requiring us to alter the code again.

As Paul Scarnegie stated in a previous post "...having a Joomla plugin adhere to the built in Joomla settings/preferences isn't a feature - it should be a given!"

Paul Frankowski - Staff

3 weeks ago #Permalink
Mark as solved could do any user. So please don't blame me.
It's still on the list to do.
Im not blaming you, just giving a little push so you could push who ever is in charge to make this decision, so he can push the devs to take half hour or less to make this happen. After all, its just few lines of code ;)

JL

3 weeks ago #Permalink
I was also disappointed with this tool using a proprietary asset location. If I want to locate a file in its location, I basically have to know the day it was uploaded. I prefer to have control over my uploads.

Just wanted to add my voice to the point being made here.
@JL, I share your frustrations when it comes to requests for fix like this to developers. My frustrations is mainly on why they don't see it. For sure they heard it but it seems like they don't care about it and continue on prioritizing on other features. Most Joomla developers I dealt with are like this, frustrating most of the time.

I have posted the same request like this few versions back.

Thanks,

Jackson

Nait

2 days ago #Permalink
Yes, you are completly right. This is a long, long, long time ago story. Nothing has changed.


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Leaderboard (30 days)

Paul Frankowski

Paul Frankowski

Total Accepted Answers: 103
Sifat

Sifat

Total Accepted Answers: 97
Toufiq

Toufiq

Total Accepted Answers: 36
Pavel

Pavel

Total Accepted Answers: 4
J

johnny

Total Accepted Answers: 3

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us