Hello, I have a question and I’d be really grateful if help me.
I just have a question: I have two tables and join them together. the first table can have many children in the second table(one to many ORM), now I want to load the children of each parent(first table row) by parent’s ID. I mean that just the children of each parent load on the second linked page when I click on the parent name link.
for example First table row: Germany Second table row: Munich, Dusseldorf,… I want when I click on Germany just load The Cities of Germany. Not all the rows in the second table.
Here are my codes:
in parent module:
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“UTF-8” />
<meta http-equiv=“X-UA-Compatible” content=“IE=edge” />
<meta name=“viewport” content=“width=device-width, initial-scale=1.0” />
<title>Document</title>
<link rel=“stylesheet” href=“cities.css” />
</head>
<body>
<div class=“gallery”>
<div class=“octagon”>
{% for row in hubdb_table_rows(5481009) %}
<div id=“octagon”>
{% if module.image_field.src %}
{% set sizeAttrs = ‘width=“{{ module.image_field.width }}” height=“{{ module.image_field.height }}”’ %}
{% if module.image_field.size_type == ‘auto’ %}
{% set sizeAttrs = ‘width=“{{ module.image_field.width }}” height=“{{ module.image_field.height }}” style=“max-width: 100%; height: auto;”’ %}
{% elif module.image_field.size_type == ‘auto_custom_max’ %}
{% set sizeAttrs = ‘width=“{{ module.image_field.max_width }}” height=“{{ module.image_field.max_height }}” style=“max-width: 100%; height: auto;”’ %}
{% endif %}
{% set loadingAttr = module.image_field.loading != ‘disabled’ ? ‘loading=“{{ module.image_field.loading }}”’ : ‘’ %}
<img class=“imgview” src=“{{ module.image_field.src }}” alt=“{{ module.image_field.alt }}” {{ loadingAttr }} {{ sizeAttrs }}>
{% endif %}
<h3>{{ row.Bundesland }} </h3>
<p>
{{ row.Landkreis }}
</p>
<a href=“” class=“btnview”>show childs</a>
</div>
{% endfor %}
</div>
</div>
</body>
</html>
in child module:
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“UTF-8” />
<meta http-equiv=“X-UA-Compatible” content=“IE=edge” />
<meta name=“viewport” content=“width=device-width, initial-scale=1.0” />
<link rel=“stylesheet” href=“subcities.css” />
<title>Document</title>
</head>
<body>
<div class=“rowoctagon”>
{% for row in hubdb_table_rows(5484646, queryparam) %}
<div class=“ort”>
<div class=“ort-content”>
<h1>
{{ row.name }}
</h1>
<p>
{{ row.Description }}
</p>
<a href=“”>click here</a>
</div>
</div>
{% endfor %}
</div>
</body>
</html>
Thank you
Maryam