work in progress:person form; shortcode for dynamic links
This commit is contained in:
parent
80779cbea7
commit
275ed6590c
3 changed files with 15 additions and 12 deletions
|
@ -1,17 +1,17 @@
|
|||
---
|
||||
title: "test1"
|
||||
summary: "Test Page #1"
|
||||
title: Person
|
||||
summary: View/Edit Person
|
||||
img:
|
||||
pageid: test1
|
||||
pageid: app_form_person
|
||||
domains: [App]
|
||||
topics: [Examples]
|
||||
date: 2023-03-12
|
||||
date: 2023-03-16
|
||||
author: helmutm
|
||||
draft: false
|
||||
weight: 100
|
||||
---
|
||||
|
||||
cyberscopes example site - use petite-vue in Hugo-generated sites.
|
||||
cyberscopes example site - view / edit person (user) data.
|
||||
|
||||
{{< pv/fieldset >}}
|
||||
|
||||
|
@ -23,8 +23,10 @@ cyberscopes example site - use petite-vue in Hugo-generated sites.
|
|||
|
||||
{{< pv/display linkto="data.id"
|
||||
expr="`${data.firstname} ${data.lastname}`.trim() || '???'" >}}
|
||||
|
||||
{{< pv/display name="id" linkto="data.id" >}}
|
||||
<br>
|
||||
{{< pv/link >}}
|
||||
Reload page with id {{< pv/display name="id" >}}
|
||||
{{< /pv/link >}}
|
||||
|
||||
{{< /pv/fieldset >}}
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
{{- $name := .Get "name" | default "textline" -}}
|
||||
{{- $expr := .Get "expr" | default (printf "data.%s" $name) -}}
|
||||
{{- $linkto := .Get "linkto" -}}
|
||||
<div>
|
||||
{{- if $linkto }}<a :href="'?id=' + {{ $linkto }}">{{ end -}}
|
||||
<pre v-text="{{ $expr }}"></pre>
|
||||
<span v-text="{{ $expr }}"></span>
|
||||
{{- if $linkto }}</a>{{ end -}}
|
||||
</div>
|
||||
|
|
3
layouts/shortcodes/pv/link.html
Normal file
3
layouts/shortcodes/pv/link.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{- $target := .Get "target" | default "data.id" -}}
|
||||
{{- $prefix := .Get "prefix" | default "?id=" -}}
|
||||
<a :href="'{{ $prefix }}' + {{ $target }}">{{ .Inner }}</a>
|
Loading…
Add table
Reference in a new issue