by
KK » Fri Nov 24, 2017 9:12 pm
@Jonathan
as I already conceded, it would be nice to have the explorer point to any arbitrary location.
However, I'll have to disagree with your observation -
With an existing site with 100's of pages with images already uploaded an on pages, but giving the user the ability to change those images - A MAJOR PROBLEM.
e.g. As soon as you give the user the ability to change the image (standard practice these days), and you make that image editable, bang! you lose the image on that page (and 100's of others).
Since we are discussing existing pages (and 100s of them), as I see it, the only practical way to Couchify them while automatically importing existing data would be to convert each of the page into a template (i,e. add the two PHP statements you are aware of).
We cannot use the cloned-pages route as that would in any case entail recreating each page manually in the admin-panel and inputting data (which would include the images - so it wouldn't really matter where the images are located as you'll have to select and input them nevertheless).
So, continuing with the assumption that you are converting an existing page into a Couch template suppose the page has the following image -
- Code: Select all
<img src="assets/img/people/joe.jpg" />
As you can see, the image is not residing in the location that Couch would eventually use.
OK, so now to make the image editable so as to allow the user to change it, use the following -
- Code: Select all
<img src="<cms:editable name='my_image' type='image'>assets/img/people/joe.jpg</cms:editable>" />
By enclosing existing data within the cms:editable tags, we are making that data the default value for the region.
So now when you come back to the admin-panel, you'll see that the image editable region is showing your original path (but the client can now select into it a new image).
On the frontend, the original image will continue showing the way it did before although now it is editable.
So is it a problem - YES! as a developer of over 35 years it seems a bit dismissal to say to a client
"Oh, yes sorry you have to go through each of your 100+ pages of existing content (that you already had images on...) and re-upload the 'same' image that was already there(!) on every page and re-save that page"...
As I have shown above, that is most certainly not that you'll need to say.
Rather, you say "Your page keeps looking exactly the way it did before. To use a new image, upload one from your machine and select it".
So wrapping up the discussion -
if your problem was that making a region editable will make the design lose the existing image and the client will have to re-upload them, that is a non-issue.
However, if your intention was that to select a new image the client could browse through a set of images already existing on the server (and not have to upload themselves) - that would still be a problem I am afraid.
The only resolution in that case would be, as @trendoman suggested, to forgo some disk space and FTP the images to the new location.