*phew!*
Hope thats all with the file/image picker stuff.
@all:
I need some input here
I wonder if it is really a good idea to use the image uploads dir for blocks of type image. (currently this is the case in AdvancedContent)
The default content type uses for {content_image}-blocks the uploads dir.
So the module is not compatible to the standard content type.
Here an example why that makes me think:
Let's say the uploads path is "uploads" and the image uploads path is "uploads/images".
In your template you have
Code: Select all
{content_image block="someImage" dir="banners"}
With the default content type it will search in "
uploads/banners" for any images.
If you save it "
uploads/banners/myImage" will be stored in the db.
If you change that page to AdvancedContent it will search for the same block in "
uploads/images/banners" for images. But there it won't find the images that were listed before.
If you move all your pictures to the image uploads dir to be able to select them in backend you will have two problems. 1st it will not list the images anymore for pages that are of type content (since it searches in another folder). 2nd in frontend all pages of type AdvancedContent won't show any images because AdvancedContent does not store "
uploads/images/banners/myImage" but only "banners/myImage". But the {content_image} tag does not prepend the current upload dirs to the stored value.
The {AdvancedContent} tag does this but this is not that important now. It is just about the compatibility to the {content_image} tag. I want to switch between the two content types without any problems.
So that means AdvancedContent stores the path of images relative to the image uploads dir.
You might wonder why i not just adapt the module to be compatible to the default core stuff.
The answer is easy: I think it is an issue that the default content type stores the pathes - as mentioned above - relative to the
root dir.
If you change for whatever reason the uploads folder in the config.php, with the {content_image} tag no images will be shown in frontend anymore. You need to re-edit all pages and set the content image again. If you have large projects this is a pain.
Using the {AdvancedContent} tag you won't get in trouble if upload folders changes.
But you cannot use the same folder and not the same template for that page.
You always need to remember what content type is used, where your images are stored and what templates needs to be used.
E.g. one template for default content types:
Code: Select all
{content_image block="image" dir="images"}
and one for AdvancedContent:
Code: Select all
{content_image block="image"} (what will not show the image and even if urlonly is true it will not show the right path)
or
But i want to be able to use the same folders and templates with both content types.
I just wonder if i should adapt the AdvancedContent module to be compatible to the default content type (what means to revert the latest changes and always just use the uploads dir - regardless if type ist set to image or to file and maybe loose the feature of dynamic folders) or if it might be better to file a feature request to the core to also use the image uploads dir and to store pathes relative to the image uploads dir.
What would you prefer?
Use the image uploads folder for all your images by default or be able to define the image dir individually by yourself?
(In case of the last one i really wonder what the image_uploads_path actually is for?)
edit: I filed a feature request to store the pathes relative to the (image) uploads dir in the default content type and prepend the (image) uploads dir to the stored path in the {content_image} tag.
If this is accepted it is up to your votes and to the developers choice if image uploads dir or just the uploads dir will be used. (i don't care about that but i just need to know what is the default to adapt the module)
And then we will have no compatibility problems anymore and a nice new feature