Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calendar_link
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
calendar_link
Commits
5ebb80e8
Commit
5ebb80e8
authored
6 years ago
by
Christopher C. Wells
Browse files
Options
Downloads
Patches
Plain Diff
Improve examples for more realistic use case.
parent
13cd2818
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+15
-13
15 additions, 13 deletions
README.md
with
15 additions
and
13 deletions
README.md
+
15
−
13
View file @
5ebb80e8
...
...
@@ -77,7 +77,7 @@ Assume an example "Event" node with the extras fields:
*
. Start date/time (datetime
`field_start`
)
*
. End date/time (datetime
`field_end`
)
*
. All day event (boolean
`field_all_day`
)
*
. Description (
string
`field_description
`
)
*
. Description (
text_format
`body
`
)
*
. Location (string
`field_location`
)
In a twig template, the following code with generate a link to the event to a
...
...
@@ -85,12 +85,13 @@ Google calendar:
```
twig
{%
set
link
=
calendar_link
(
'google'
,
title
,
field_start
,
field_end
,
field_all_day
,
field_description
,
field_location
)
node.title.value
,
node.field_start.date
,
node.field_end.date
,
node.field_all_day.value
,
node.body.value
,
node.field_location.value
)
%}
<a
href=
"
{{
link
}}
"
>
Add to Google
</a>
```
...
...
@@ -99,12 +100,13 @@ Or, to create a list of links for each service:
```
twig
{%
set
links
=
calendar_links
(
title
,
field_start
,
field_end
,
field_all_day
,
field_description
,
field_location
)
node.title.value
,
node.field_start.date
,
node.field_end.date
,
node.field_all_day.value
,
node.body.value
,
node.field_location.value
)
%}
<ul>
{%
for
link
in
links
%}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment