A link schema type representing an internal or external link.
Project description
Overview
--------
This package provides a schema field that combines an internal and
external link representation. It's relatively low-tech.
It provides a widget that lets users enter links on the format:
"Title":internal path or URI:"Description"
Both title and description are optional. If an internal path is given,
the field tries to resolve the object and stores only its UID.
Requirements
------------
* Zope 2.10.4+
Usage
-----
Include the ZCML-slug for the package to register the widget with formlib.
A schema definition for a field carrying a single link:
>>> from collective.formlib.link.field import Link
>>> field = Link(title=u"Link")
A list of link fields:
>>> from zope import schema
>>> field = schema.List(
... title=u"Links",
... value_type=Link)
To render the link from a page template:
<a tal:attributes="href link/@@absolute_url;
title link/description"
tal:content="link/pretty_title_or_uri" />
--------
This package provides a schema field that combines an internal and
external link representation. It's relatively low-tech.
It provides a widget that lets users enter links on the format:
"Title":internal path or URI:"Description"
Both title and description are optional. If an internal path is given,
the field tries to resolve the object and stores only its UID.
Requirements
------------
* Zope 2.10.4+
Usage
-----
Include the ZCML-slug for the package to register the widget with formlib.
A schema definition for a field carrying a single link:
>>> from collective.formlib.link.field import Link
>>> field = Link(title=u"Link")
A list of link fields:
>>> from zope import schema
>>> field = schema.List(
... title=u"Links",
... value_type=Link)
To render the link from a page template:
<a tal:attributes="href link/@@absolute_url;
title link/description"
tal:content="link/pretty_title_or_uri" />
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file collective.formlib.link-0.1.tar.gz
.
File metadata
- Download URL: collective.formlib.link-0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a8f0c7703890fc0854b668264aa8cb5c653a72f3a499a2b4d3b2f3ef715d738 |
|
MD5 | d402e9d5648e3cc3d110a29f84a0f84b |
|
BLAKE2b-256 | 65fb819375fc4fe8a3e81210dc683b275870735749f7667e5a8cf9aabe9298e0 |