Search…

X3 Photo Gallery Support Forums

Search…
 
Mibu
Topic Author
Posts: 18
Joined: 16 Oct 2024, 14:13

Renaming folder structure

17 Oct 2024, 17:54

Hi

let's assume I have 2 galleries and sub-galleries in the content folder,like
Gal 1 Gal 2
-> Sub 1 -> Sub 3
-> Sub 2 -> Sub 4

When I rename Gal 1 (via Gallery/Rename) it seems to correctly adjust all links (URLs) including it's subfolder structure. However, when Sub3 has a preview image or link to Sub 1, it does not automatically get updated via the afore mentioned rename. Why not?

I would assume that all link references (URls, Page Preview Images,...) which are pointing to some subfolder structure within /content/ are updated automatically. But this was not the case. Did I do something wrong, or is this not (yet) implemented?

Adding/correcting this feature would be a really helpful.

(If someone wonders why I might have 2 galleries pointing to the same substructure, you can imagine having images sorted once by date and once by location, or captions in different languages)

Thanks
Michael
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Renaming folder structure

17 Oct 2024, 22:39

Mibu wrote:When I rename Gal 1 (via Gallery/Rename) it seems to correctly adjust all links (URLs) including it's subfolder structure. However, when Sub3 has a preview image or link to Sub 1, it does not automatically get updated via the afore mentioned rename. Why not?
Unfortunately no. Because X3 builds the internal structure of your galleries and pages automatically from the structure inside your content. However, when you add a link/path manually on another page, it is just a piece of text stored in your page data, and X3 won't automatically recognize your manual references in all other pages.

If X3 was a database application, that locked all references internally and everything stored in the DB, then this would be more likely. Since X3 is based on a physical structure, your custom references are more fragile. As long as X3 is a non-DB app, I don't think this is logically possible. For example, you have a page /aaa/bbb/ccc/ renamed to /aaa/DDD/ccc/, there might be hundreds of references to this page inside custom html in hundreds of other folders. We can't just loop through ALL folders (potentially thousands), search for references to the old link, and blindly replace it.
Mibu wrote:(If someone wonders why I might have 2 galleries pointing to the same substructure, you can imagine having images sorted once by date and once by location, or captions in different languages)
I'm not quite sure I understand this.
 
Mibu
Topic Author
Posts: 18
Joined: 16 Oct 2024, 14:13

Re: Renaming folder structure

18 Oct 2024, 03:16

I get your point and already now the rename takes ages, if done from within the panel. I understand that without a DB there is no reasonable way to implement that efficiently. 

As for my use case why I want one gallery accessible bfrom 2 menu emtries: Let's say I have pictures from my trip to a specific country, I put them into one gallery, which I then want to reference from Menu 1, showing trips in 2024, 2023, 2022... as well as from Menu 2 showing trips to Europe, Asia, Australia,...
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14469
Joined: 30 Sep 2006, 03:37

Re: Renaming folder structure

18 Oct 2024, 06:47

Mibu wrote:As for my use case why I want one gallery accessible bfrom 2 menu emtries: Let's say I have pictures from my trip to a specific country, I put them into one gallery, which I then want to reference from Menu 1, showing trips in 2024, 2023, 2022... as well as from Menu 2 showing trips to Europe, Asia, Australia,...
I understand perfectly well how it would have been useful in an ideal world that your internal references were updated when you changed/moved/renamed a folder. Unfortunately, this is not a strong feature of non-database X3. You will need to edit custom references from other locations manually if you change the path of a target.

There are "workarounds", but I would probably try to avoid. For example, if you have many links to /path/to/folder/ and then you change the folder name to "folder2", you could create a REDIRECT in the original location /path/to/folder/ that points to the new location /path/to/folder2/. All your references that point to /path/to/folder/ would redirect to /path/to/folder2/. Should probably be avoided as it can become cluttered.
 
Mibu
Topic Author
Posts: 18
Joined: 16 Oct 2024, 14:13

Re: Renaming folder structure

18 Oct 2024, 07:16

It would have been nice, but it's not a big deal. More of a feature that would have been helpful especially during the initial setup, when things could still change. Later on it's more unlikely that I^ll have to change the whole folder structure anyways. Thank you again for your feedback..