Changing information in repeater depending on dynamic item page

Hi,
Question:
How to code some sections away or make appear depending on the database? If the database is empty for this particular column then I want to have the section disappear. If there’s something I want it to appear. I also want information to appear according to the item in the database. Probably reading “what are you trying to achieve” will make my question/situation clearer.
Method 2: An alternative (if possible) to hiding the sections, is to make the repeater change its information depending on the item page we are on. I will add at the end a screenshot of what I tried.

Product:
[I think I use wix editor. I’m not sure though.]

What are you trying to achieve:
[Basically my idea is to make a “travel blog” with one dataset being all the countries. As you can see on the screenshot below (first screenshot) we are currently in the Portugal section. I would like to then connect the database of Portugal (a separate database from the countries) to this repeater, so to be able to see a few articles about Portugal in the repeater. Also, if I go to the country Spain (country dataset) I would like to see articles about Spain (from the Spain dataset). So to summarise, I would like to have one “mother” dataset with all the countries each with its own page. On every individual page (so on every country) I would like to connect in this repeater articles about the respective country. So by chaning the country you would have the same lay-out, but with different articles in the repeater.
I would like to only use dynamic pages in order to have the same lay-out just with different information.]

What have you already tried:
[I tried to do the same as in this video(https://www.youtube.com/watch?v=4cCU7en-iuo&t=395s), but not by using booleans, instead using tags. The person mentions that it should be the same procedure, however I was not able to do it.]

Additional information:

(screenshot 1)This is my attempt to code what they said in the video. The Ptag does not get recognized.

(screenshot 2) Here is what I have in the country database. The 4th and 5th column are the different articles from the respective countries (so taken from the Portugal database and Spain database (Just like you could add the specific services of a certain employee))

METHOD 2:
We are still in the Portugal item page (of the country dataset) with the repeater connected to the articles from the Portugal dataset (which is projects 1 dataset). However, if we go to Spain (of the country dataset) the articles from the Portugal dataset still appear. How could the repeater change to those of Spain?
(screenshot 3)

Your help wil be immensely appreciated, I have been trying to figure this out for a few weeks.

Looking at the code the variable Ptag is not declared or defined and the single = sign means assignment not comparison which would be ===.

These would be the cause of the problem.

In the future for code please paste the code as text and format it as such:

```js
const myCode = ‘here’;

export function myFunc() {
    return true;
}
```

This will then format your code to display properly (example below) and make it much easier for people on this forum to help you.

const myCode = 'here';

export function myFunc() {
    return true;
}