Download the PHP package codeq/link without Composer
On this page you can find all versions of the php package codeq/link. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package link
Short Description Link helper for Neos - with Atomic.Fusion & Monocle in mind
License GPL-3.0-or-later
Informations about the package link
CodeQ.Link
The Neos link helper with Atomic.Fusion & Monocle in mind
Here's the most basic usage, which separates your Monocle presentational components from your integration. By providing a transfer object, you can keep your presentational components clean without cluttering your props.
By separating the aspects of link types and rendering we enable the separation of those aspects into different fusion-components.
What's important to notice:
- If a link should be a link in the backend can be controlled in your integration with
backendLink = false
- If a component should be rendered, if no link is given can be configured on presentation with
<CodeQ.Link:Tag renderDefaultTagIfNoLink={true}...
- The code is easy to read, no hidden magic
So the package offers way more. Interested? Read ahead!
Installation
CodeQ.Link is available via packagist run composer require codeq/link
.
We use semantic versioning so every breaking change will increase the major-version number.
Usage
Rendering one link
As you have seen, the presentational part of rendering one link is simple:
For the integration we offer a lot of helpers to implement common use cases:
- For Monocle:
CodeQ.Link:DummyLink
-
Defining everything yourself:
-
Handling Neos nodes:
-
Handling Neos assets:
- Handling Neos strings with references, like 'node://XXX' or 'asset://XXX'
Rendering one link lists and menus
Our menu items are inspired by the Neos core and have the following API:
We provide the following helpers:
CodeQ.Link:DummyMenuItems
-
CodeQ.Link:DummyReferences
CodeQ.Link:NodeReferences { nodes = ${q(site).property('nodes')} }
You need to provide your own code to render it, this will typically look something like:
FAQ
When would I use CodeQ.Link and when Carbon.Link?
Carbon.Link is great for rendering links with just
<Carbon.Link:Link node={props.node}>Read more</Carbon.Link:Link>
if you don't use
Sitegeist.Monocle.
If you want to use Monocle Carbon.Link does not work, because it uses content and node data inside the prototype. Also it does not offer a way to give link configuration to the Fusion rendering.
By providing a transfer object instead, we implement Carbon.Link functionality with Monocle in mind. What does such a transfer object consist of:
Background information
Carbon.Link does a really great job at offering an appealing simple API, but at the cost of some very complex and slow requests, generally massively slowing down rendering if you use it 50+ times - which you easily archieve using it inside a menu. So we chose to reimplement these features in a more explizit API.
License
Licensed under MIT, see LICENSE
Sponsors & Contribution
The development of this plugin was kindly sponsored by Code Q.
We will gladly accept contributions. Please send us pull requests.
All versions of link with dependencies
neos/fusion-afx Version ^1.2 || 7 - 8 || dev-master