# Customize Params question，I‘m new user

**URL:** <https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286>\
**Category:** support\
**Created:** [June 5, 2018, 1:03am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286 "2018-06-05T01:03:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhinoceros](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rhinoceros/32/6115_2.png) [@Rhinoceros](https://discourse.gohugo.io/u/Rhinoceros)\
**Post date:** [June 5, 2018, 1:03am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/1 "2018-06-05T01:03:50Z")

</div>

I have customized “.Params.ct\_download\_link” and “.Params.clic\_download\_link” in “single.html”, but each article header can only use “ct\_download\_link” and “.Params.clic\_download\_link” to pass only one link. How can I make “ct\_download\_link1”, "ct\_download\_link2"and “.Params.clic\_download\_link1” “.Params.clic\_download\_link2”… The cycle is called when publishing, that is, the same page outputs multiple different links

---

<div class="post-metadata">

**Author:** ![Rhinoceros](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rhinoceros/32/6115_2.png) [@Rhinoceros](https://discourse.gohugo.io/u/Rhinoceros)\
**Post date:** [June 7, 2018, 4:52am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/2 "2018-06-07T04:52:55Z")

</div>

anyone can help me

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [June 7, 2018, 4:58am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/3 "2018-06-07T04:58:04Z")

</div>

Sorry, it’s hard to understand what you’re asking. Are you saying you want to put the URLs in your frontmatter in an array, so you can loop through them in your template?

On the markdown content file frontmatter, something like this? :

```auto
---
...
myurls: 
   - http://oneurl.com
   - https://twourl.net
...
---

```

… and you want to “loop through” those, in your single.html?

---

<div class="post-metadata">

**Author:** ![Rhinoceros](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rhinoceros/32/6115_2.png) [@Rhinoceros](https://discourse.gohugo.io/u/Rhinoceros)\
**Post date:** [June 7, 2018, 8:23am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/4 "2018-06-07T08:23:42Z")

</div>

Please forgive my poor English

 ![33](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/a/a11a37ec25d9efa07531431401e19ada4e3be8e8.png)

.Params.ct\_download\_link in single.html

 ![26](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/7/78c1c2abd3917450233e85b63644166d45342253.png)  
ct\_download\_link in .md file

I want ct\_download\_link1 ct\_download\_link2 ct\_download\_link3…… in .md file ,output different link

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [June 7, 2018, 8:53am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/5 "2018-06-07T08:53:55Z")

</div>

Ok, I see. You are getting errors? It’s possible that what you did will work if _every_ page that is rendered by your single has that parameter. If not, `hugo server` will give an error, usually because some are missing.

You can use `with` to fix this. It acts like an `if then` statement.

> **[with](https://gohugo.io/functions/with#readout)**
>
> Rebinds the context (\`.\`) within its scope and skips the block if the variable is absent.

```auto
...href="{{ with .Params.cd_download_link }}{{ . }}{{ end }}">...

```

---

<div class="post-metadata">

**Author:** ![Rhinoceros](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rhinoceros/32/6115_2.png) [@Rhinoceros](https://discourse.gohugo.io/u/Rhinoceros)\
**Post date:** [June 7, 2018, 9:15am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/6 "2018-06-07T09:15:08Z")

</div>

no error ,now it’s worked,but every article only output “ct\_download\_link” and “clic\_download\_link”

“ct\_download\_link1” and “ct\_download\_link2”  
“clic\_download\_link2” and “clic\_download\_link2”  
can not work

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [June 7, 2018, 9:29am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/7 "2018-06-07T09:29:19Z")

</div>

Ah, ok. You’re telling hugo to go find a param `clic_download_link` but, not specifying it in your frontmatter. It won’t act like a wildcard.

If you want to make a list of urls of a certain type, you need to use `range` to loop over the urls and put them in like I mentioned first above.

You’re looking to show, say, a list of “ct” type links and another list of “clic” type links? An example from a single.html:

```auto
<p class="menu-label has-text-esolia-secondary-2-0">Tags</p>
  <div class="tags has-margin-l">{{ range .Params.tags }}
   <span class="tag is-rounded is-light"><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></span>{{ end }}
  </div>

```

… given frontmatter like:

```auto
tags:
  - this
  - that

```

This just puts the tags I have in the frontmatter, in spans, between a div.

---

<div class="post-metadata">

**Author:** ![Rhinoceros](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rhinoceros/32/6115_2.png) [@Rhinoceros](https://discourse.gohugo.io/u/Rhinoceros)\
**Post date:** [June 8, 2018, 12:56am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/8 "2018-06-08T00:56:32Z")

</div>

In fact, I just want to do a download of the historical version of the list, a version number corresponds to the download link for each disk, the other version number is still those disks, but it’s another version of the download link, so I need to be the same ct\_download\_link distinguishes 1 2 3 4 5… to distinguish different versions of download links

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [June 8, 2018, 2:36am UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/9 "2018-06-08T02:36:07Z")

</div>

Sorry, not so sure what you want now. Do you mean you want to show the latest/last URL in the list only, but still have the others available? If so, you could adapt this:

> [@Howto: Delimiter separated tags](https://discourse.gohugo.io/t/howto-delimiter-separated-tags/146):
>
> The construction below looks counter-intuitive, but it works: Given: Tags = ['item1', 'item2', 'item3'] This: {{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} Gives: item1, item2, item3 The example above uses tags with comma as delimiter, but this of course also applies to other ranges and delimiters.

So, instead of showing the comma you show the last listed URL.

---

<div class="post-metadata">

**Author:** ![Rhinoceros](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rhinoceros/32/6115_2.png) [@Rhinoceros](https://discourse.gohugo.io/u/Rhinoceros)\
**Post date:** [June 11, 2018, 12:56pm UTC](https://discourse.gohugo.io/t/customize-params-question-i-m-new-user/12286/10 "2018-06-11T12:56:10Z")

</div>

![2](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/9/9d279ff2dccbbf16fdc95137fbc1e0927504f1af.PNG)  
just like this screenshots

version,update date,download link  
one row every version, one to one correspondence

Take clicknUpload for example,version number 3.0,update date 2018.4.29,ClicknUpload download link in one row,add version number 3.1,update date 2018.4.30,ClicknUpload download link in one row, row and row correspondence
