WebsiteBaker Support (2.8.x) > Bakery Shop

Change media image folder name

<< < (2/2)

jacobi22:

--- Quote from: sky writer on October 15, 2015, 06:50:23 PM ---I took off your trailing forwardslash, because that caused the search and replace to miss some files.

--- End quote ---

i test only some pages in the backend, but not all functions.  :oops:
Do you have a working solution on this basis now?

P.S.: i think, a good example must be be OneForAll-Module (if i remember correct, it have a way like this in the code)

sky writer:
Hi Jacobi,

I used Christoph's fix, because it works as is.  And since future upgrades will require a new search and replace with either approach, maybe this is the most sensible solution.  At least until the future possibility of something similar being implemented into the bakery core.

But I didn't given up on your idea, because I think it would be a helpful addition.

Here's what I did to get it working.

added your code to the bottom of the bakery/config.php file:

--- Code: ---// name of the bakery image folder in media
$sBakeryImgFolder = 'products';  //no leading/trailing slash or backslash!! A simple directory name only!! 
--- End code ---

Renamed my media/bakery folder to media/products

Did a search (Find in Files) with Notepad++ for all instances of (31 total in 8 files):

--- Code: ---MEDIA_DIRECTORY.'/bakery
--- End code ---
and replaced with:

--- Code: ---MEDIA_DIRECTORY.'/'.$sBakeryImgFolder.'
--- End code ---

There are two files which require different replace formatting
'save_item.php' ~line 278

--- Code: ---MEDIA_DIRECTORY.'/'.$sBakeryImgFolder.
--- End code ---
notice the difference, there is no single quote between MEDIA_DIRECTORY.'/'.$sBakeryImgFolder.   <and>   $directory;

uninstall.php ~line 52

--- Code: ---MEDIA_DIRECTORY.'/'.$sBakeryImgFolder
--- End code ---
notice the difference, there is no trailing single quote or concatenation.

I took a look at the OneForAll module files and the calls are to the info.php for the module name '$mod_name' - to complete the media folder path.

There are two files which aren't displaying the images in bakery with the above settings in place, modify.php and view_overview.php

I added the following to those two files (near the top, although I do not know if placement matters), and it now everything seems to work:

--- Code: ---// Get some default values
require_once(WB_PATH.'/modules/bakery/config.php');
--- End code ---

But I do not know enough to know if this is all something that should be done, or what effect it might have.  But it was fun working it out.

jacobi22:
 (Y) (Y) (Y)

Thanks!!

i'll do the same over the weekend

Navigation

[0] Message Index

[*] Previous page

Go to full version