How do you solve "unstructured" navigation in PHP?

I have a big PHP based CMS that manages web pages. All elements are organized in a tree structure. When I edit an element, the back button usually points to its parent element. Thus, a normal workflow moves through a tree.

Now, from time to time, a need arises for a workflow that β€œjumps” to other elements without taking into account the structure.

For example, when a user edits a web page, they may want to open the template to which the page is attached (another element in a completely different branch), make changes there, and when you click "save" expect to return to the page they edited.

I am currently solving this using

domain.com/admin/template/edit?from=/frontpage/edit

where the from from variable defines the destination URLs of the save and cancel buttons.

This works to a certain point when the path becomes too long and complicated. For example, what if a user

  • edit page
  • opens the attached template
  • Preview this template in an interface view.
  • and then expects them to be easily returned to the page they are editing?

Right now, the β€œstory” ends on the last element, so when the user returns from appearance, the link to the original page is lost, and they must search for it manually.

Another problem that can happen quickly is that the GET url containing all the "from" values ​​becomes too long or completely chaotic:

domain.com/admin/template/edit?from=/frontpage/edit&from=/somepage/edit
&from=/template/preview&/from=template/edit&/from=template_preview ...

(you get a drift)

, , , , , .

?

"" , (= )?

?

, , - "", . " x".

, , - , , .

+5
3

: IFRAME, ?

URL: - , URL-

(i.e. /frontpage/edit = 952,
/frontpage/edit&from=/somepage/edit = 763,
/template/preview = 651,
template/edit = 612,
template_preview = 866 etc.)

PATH_INFO :

domain.com/admin/template/edit/952/763/651/612/866
+2

, , , , . .

, . , , , .

+2

As long as you only need to return once, why not pass in any page IDs of the links you want when you create the page you are going to?

0
source

All Articles