Add Call-to-Action support at top of content
This commit is contained in:
		
							parent
							
								
									7b4dd6b148
								
							
						
					
					
						commit
						39d7488add
					
				
					 2 changed files with 32 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -9,6 +9,7 @@
 | 
			
		|||
        {{ partialCached "header.html" . }}
 | 
			
		||||
        {{ partial "breadcrumb.html" . }}
 | 
			
		||||
        <div class="content">
 | 
			
		||||
	    {{ partial "show-call-to-action-top-of-content.html" . }}
 | 
			
		||||
            <h1 class="post speakable">{{ .Title }}</h1>
 | 
			
		||||
            <div class="speakable">
 | 
			
		||||
            {{- block "main" . }}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,31 @@
 | 
			
		|||
{{ if .Params.call_to_action_top_of_content }}
 | 
			
		||||
{{ $context := . }}
 | 
			
		||||
    <aside>
 | 
			
		||||
    {{ if .Params.call_to_action_top_of_content.id }}
 | 
			
		||||
        {{ $show := true }}
 | 
			
		||||
	{{ if .Params.call_to_action_top_of_content.expires_after }}
 | 
			
		||||
            {{ $cta_expires_after := .Params.call_to_action_top_of_content.expires_after | time }}
 | 
			
		||||
            {{ if ge now $cta_expires_after }}
 | 
			
		||||
	        {{ $show = false }}
 | 
			
		||||
	    {{ end }}
 | 
			
		||||
	{{ end }}
 | 
			
		||||
	{{ if $show }}
 | 
			
		||||
  	    {{ $id := .Params.call_to_action_top_of_content.id }}
 | 
			
		||||
            {{ with (index $.Site.Data.call_to_actions $id) }}
 | 
			
		||||
	        {{ $language := $.Site.Language.Lang }}
 | 
			
		||||
	        <div class="highlight-box highlight-box-nluug">
 | 
			
		||||
	            {{- range $key, $value := .items -}}
 | 
			
		||||
		        {{ if eq $value.language $language }}
 | 
			
		||||
		            <h2>{{ $value.title }}</h2>
 | 
			
		||||
		            <p>{{ $value.text_long }}</p> 
 | 
			
		||||
			    {{ if .page }}<a class="button" href="{{ relref $context .page }}">{{ end }}<span>{{ $value.button_text }}</span>{{ if .page }}</a>{{ end }}
 | 
			
		||||
		        {{ end }}
 | 
			
		||||
		    {{ end }}
 | 
			
		||||
		</div>
 | 
			
		||||
            {{ end }}
 | 
			
		||||
	{{ end }}
 | 
			
		||||
    {{ else }}
 | 
			
		||||
        {{ errorf "ID van CTA ontbreekt (call_to_action_top_of_content.id)" }}
 | 
			
		||||
    {{ end }}
 | 
			
		||||
    <aside>
 | 
			
		||||
{{ end }}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue