Quantcast
Channel: WordPress.org Forums » [Header Footer Code Manager] Support
Viewing all articles
Browse latest Browse all 38

Passing paramaters through shortcode

$
0
0

Replies: 1

Hi, I have a simple snippet like:

<div id="gvk_04" style="text-align: center;"></div>

<p align="center"><button class="spw_button" onclick=spw_gvk_expl()>Show/Hide explanation</button></p>

<script>

function spw_gvk_expl() {

var x = document.getElementById("gvk_04");

if (x.innerHTML === "") {
x.innerHTML = spw_gvk_expl_brd(4);
} else {
x.innerHTML = "";
}
}

function spw_gvk_expl_brd(brd) {

return
Hi, this is the explanation of board ${brd}

}
</script>

It is toggling between showing/hiding some explanation.

Is it possible to pass the boardnumber (4 in the code above) as a parameter, so I can use the same code for all boards? Something like

[hfcm id=”123″ brd = “4”]

Kind regards,

Saskia

  • This topic was modified 2 weeks, 2 days ago by saskiaherm.

Viewing all articles
Browse latest Browse all 38

Trending Articles