Rename Parent-Pages

edited May 2011 in Feature Requests
Hey.

If i want to rename a page, which is a parent of a other page eg. about/contact and i rename "about" into "about me", the contact page will automatically get lost and will transformed into an orphan, right?

What's the easiest way to update the structure? i could load in the "on_before_save" method all pages.locations and update the child locations. or can i do that an easier way?

Comments

  • edited 11:48AM
    That's correct in that it will be orphaned. FUEL doesn't have a built in way at the moment to automatically update children. However, I could see that being a nice feature for both the pages and navigation model. To implement that, I would probably use an on_after_save hook to query all locations with that have it's parent in as part of the location (e.g. about/%).
  • edited 11:48AM
    ok. made that. :)

    also there is a understanding-problem from my side, i guess. :)

    In the navigation model, we do have a 'location', and a 'nav_key'. Can you explain me the function eg. the difference of those two keys?

    tank you
  • edited 11:48AM
    The nav_key is a unique value for your navigation items in a whole group. You can match against it in the "Selected" field. The "Selected" field you can add regular expression to have navigation items be active. For example, you could place in the "Selected field:
    about$|about/history
    Which would say to show an active state on this item if the active parameter passed in the fuel_nav() function (which is usually the current URI path location) is either "about" or "about/history".

    The location value is only unique to a parent and not the entire navigation group. So it is possible to have multiple about/history location values as long as they belong to different parents.

    Also, I just posted to the repo some additional validation to the location_model to take into account the uniqueness of the location value at the parent level.
  • edited 11:48AM
    Thank you very very much!
Sign In or Register to comment.