Sections - how does it work?

AntoineLafontaine / 2008-01-25 02:33:50   

Hi Vaska and all the forum members,

I've been using indexhibit for a few projects now and I've got a fair hang of it, but I still wonder a few things about how sections are implemented and if my understanding is flood about some parts of it...

Well basically you can add sections in the "settings" menu of the admin interface. When you create a new section, you give it a section name (which is used for display purpose) and a folder name (which is used internally by the database as an identifier for the section). Once you have your new section setup, you can assign it to any new project you create. I think I'm fairly ok up to this point.

Where it gets complicated for me is when you access a project on your site and have mod_rewrite enabled, the URL of the project will reflect which section it was assigned to: eg: www.website.org/projects/my-first-all-color-book.html (where projects is a section)

If you move this project to a new section using the drag and drop feature in the admin interface, the projects seems to be properly reassigned, but the url reflects the old section name. A similar thing happen when you change a section folder name; only the newly created projects will reflect it in their url and the old ones will keep the old section name.

My guess is that when a project is moved from one section to another, the section's folder name isn't updated in the database. Similar problem when the section name is changed in the setting menu.

Before I dig deeper into this, I'd like to have some feedback from other users on this issue. (Of course, Vaska's feedback is more than welcomed :) ). Is this considered a bug... a feature, is my database setup to consider?

Thank you for taking to time to read all this!

Antoine Lafontaine

simon / 2008-01-25 08:30:36   

the key is to unpublish and republish the project.
By doing so you set the new path.
;)

AntoineLafontaine / 2008-01-25 09:11:06   

Thank you Simon,

I've seen the same suggestion by Eloisa in this thread and obviously tried it, but no success for me... I must be overlooking something.

Since people seem to agree that this would fix the problem, I guess I have to look for something else that's causing this behavior.

I'll post some updates after a few tests.

AntoineLafontaine / 2008-01-25 09:35:59   

*UPDATE*

Alright, I've found the culprit.

You need to have "projects section" (found in /settings/sections/edit one of your sections) set to "on" for this behavior to work properly.

Might not be a revolutionary tip, but it might help save some time for somebody else.

Vaska A / 2008-01-25 09:40:27   

My guess is that when a project is moved from one section to another, the section's folder name isn't updated in the database. Similar problem when the section name is changed in the setting menu.

No, it's not. We didn't bother doing this as it allows for alot of flexibility creating pages/urls and then where you place them. People can make section top pages this way...

We expect that people won't be changing the paths of the sections except when a site is first setup. The solution is to simply go in and unpublish and republish as Eloisa mentions. And if people do, the fix is simple enough for the pages that do need the url updated.

AntoineLafontaine / 2008-01-25 11:28:02   

Thanks Vaska for the explanation.

And sorry if I used the word problem for a lack of better word to express what I expected and what was happening for me. Now that I know the thinking behind it (and the way to update my projects if I do move projects from section to section, etc) it makes it all clear.

This thread has been closed, thank you.