Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.0.0-b1
-
Component/s: None
-
Labels:None
Description
The base URI for plugin action nav links is determined automatically by the context of the link.
This becomes problematic, however, if we wish to define a primary client nav element that is based off the public URI. The solution is to add the ability to overwrite the base URI via an option.
- base_uri - The base URI (optional)
- "public" - The public URI path
- "client" - The client URI path
- "admin" - The admin URI path
- Any other string, e.g. "https://blesta.com/"
The base_uri option should be supported as a top-level key, as well as within any sub element that also contains a uri key. For example:
[ 'action' => 'nav_primary_client', 'base_uri' => 'public', 'uri' => 'order/', 'name' => 'Order', 'sub' => [ [ 'name' => 'Dippin Dots', 'uri' => '', 'base_uri' => 'https://www.dippindots.com' ] ] ]
The top-level base_uri SHOULD overwrite the base_uri for all sub elements unless explicitly overridden by a sub element. If no top-level base_uri is defined, it should inherit the default base_uri as it does today.
The Navigation model requires updates in order to support this.
public function baseUri($label, $uri) { $this->base_uris[$label] = $uri; return $this; }
Then in AppController:
$this->Navigation->baseUri('public', $this->public_uri); ->baseUri('client', $this->client_uri); ->baseUri('admin', $this->admin_uri);
Issue Links
- blocks
-
CORE-1974 Add client area link to available order forms
- Closed