work in progress:person form; shortcode for dynamic links

This commit is contained in:
Helmut Merz 2023-03-16 11:02:23 +01:00
parent 80779cbea7
commit 275ed6590c
3 changed files with 15 additions and 12 deletions

View file

@ -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 >}}

View file

@ -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>

View file

@ -0,0 +1,3 @@
{{- $target := .Get "target" | default "data.id" -}}
{{- $prefix := .Get "prefix" | default "?id=" -}}
<a :href="'{{ $prefix }}' + {{ $target }}">{{ .Inner }}</a>