Download the PHP package se7enxweb/ezurlmultisite without Composer
On this page you can find all versions of the php package se7enxweb/ezurlmultisite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download se7enxweb/ezurlmultisite
More information about se7enxweb/ezurlmultisite
Files in se7enxweb/ezurlmultisite
Package ezurlmultisite
Short Description Multisite-aware ezurl template operator for Exponential: links to content of another site of a multisite installation point to the siteaccess that serves that content (its SiteURL, without its PathPrefix) instead of to the current siteaccess. Configured per siteaccess by root node, no kernel override needed.
License GPL-2.0-or-later
Homepage https://github.com/se7enxweb/ezurlmultisite
Informations about the package ezurlmultisite
ezurlmultisite
Kernel class override for Exponential / Exponential Platform Legacy that extends the
built-in ezurl template operator with multi-siteaccess link handling and a
number of optional sitelink-inspired features, while keeping the original
ezurl API intact.
What it does
In a multi-site installation ezurl normally only prepends the index path and
quotes the input. It does not know that a relative URL such as
websites/sole-kracker-org/foo or slashnews might belong to a different
siteaccess and must be rendered as an absolute URL on the correct host.
This extension overrides eZURLOperator so ezurl can, without template
changes:
- Detect a different target siteaccess from a
PathPrefixmatch. - Fall back to resolving the content node from the URL alias to determine the target siteaccess.
- Build the correct
http(s)://<SiteURL>/<path>output when linking across siteaccesses. - Leave local/internal links unchanged.
- Accept an optional third
parametershash with extra options such asabsolute,siteaccess,hash,query,no_self_link,protocol, etc.
It also registers three new operators for advanced use:
ezurl_pathezurl_siteaccessezurl_roots
Requirements
- eZ Publish 4.x / eZ Platform Legacy 2017+
eZURLOperatorkernel class override support enabledEZP_AUTOLOAD_ALLOW_KERNEL_OVERRIDEenabled inconfig.phpfor the kernel override layer
Installation
- Copy or clone this extension to
extension/ezurlmultisite. -
Add the extension to
settings/override/site.ini.append.php: -
Regenerate autoload arrays:
- Clear caches:
File layout
classes/kerneloverride/.../ezurloperator.phpis the kernel override forkernel/common/ezurloperator.php.classes/ezurlmultisite.phpcontains the shared helper logic.classes/ezurlmultisiteoperator.phpregistersezurl_path,ezurl_siteaccessandezurl_roots.
Basic usage
Templates continue to use |ezurl as before:
No template changes are required for the multi-siteaccess fix.
Extended ezurl parameters
The operator keeps the original positional parameters:
A third positional parameter, parameters, accepts a hash of advanced options:
Available parameters
| Key | Type | Description |
|---|---|---|
absolute |
boolean | Force a full absolute URL. |
siteaccess |
string | Force the target siteaccess. |
protocol |
string | Override the URL scheme: http, https, // (protocol-relative), or empty for current scheme. |
hash |
string | Append a URL fragment (#section). |
query |
string or hash | Append a query string; a hash is converted to key=value&.... |
user_parameters |
array | Append eZ Publish view user parameters as /(key)/value segments. |
no_self_link |
boolean | Return an empty string if the link target is the current page. |
node_id |
boolean | When the input is an integer, treat it as a node ID (true, default) or object ID (false). |
link_type |
string | For class-based links, request a specific type such as internal, external or download. |
Examples
Protocol / HTTPS
The current request scheme is used by default, so an HTTPS page generates
https:// absolute URLs. The protocol option can override this:
New operators
ezurl_path
Returns the path part of the resolved link, with the target siteaccess prefix stripped.
ezurl_siteaccess
Returns the name of the siteaccess that should host the given input.
ezurl_roots
Returns an array of root node information per siteaccess. Each element contains
siteaccess, host, prefix and root_node_id.
Configuration
Settings are in extension/ezurlmultisite/settings/ezurlmultisite.ini. Copy
the file to settings/override/ezurlmultisite.ini.append.php to customize it
safely.
[OperatorSettings]
ForceAbsoluteURL=enabledmakes everyezurlcall absolute by default.SiteLinkClassList[]lists class identifiers that should use class-based link generation (see below).
[HostMap]
Override the host used for a siteaccess when site.ini SiteURL is not enough:
[RoleMap]
Force the target siteaccess for users with a given role. Enable with
RoleOverride=enabled in [OperatorSettings].
[ClassSettings] and per-class blocks
For classes listed in SiteLinkClassList[], ezurl can resolve the link from a
specific attribute. LinkTypeList maps a link type to an attribute identifier,
and DataTypeClass can override the datatype handler used for the attribute.
[PathSettings]
When DisableNodeID or DisableObjectID is enabled, listed IDs cause ezurl
to return an empty string.
[DataTypeSettings]
Custom handlers must implement eZURLMultisiteDataTypeHandler.
Datatype handlers
The extension ships with three handlers:
eZURLMultisiteURLHandlerforezurlandezstringattributes.eZURLMultisiteBinaryFileHandlerforezbinaryfileattributes, withdownloadlink type support.eZURLMultisiteObjectRelationHandlerforezobjectrelationattributes, resolving the related object's main node URL alias.
License
Copyright (C) 1998 - 2026 7x
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.