All language subtitles for 010 Creating Dynamic Pages (with Parameters)_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Creating the detail page like this works,

until we realize that we probably would have

more than one news item on our news site.

It would be very realistic that index.js

and the news folder should output a list of news items.

And then we can click those individual items

and then take into the detailed pages

with the concrete content for the news item we selected.

So we use the same page over and over again

for different news items for different content.

We would probably fetch the concrete content

from some database when a user visits this detail page

and then display it on the screen.

So, it's the same component technically

but with different content.

And that's of course a totally realistic,

I would even say very common scenario.

So hard coding, the identifier,

like something dash important

like this in the file name is not very realistic.

Instead, we wanna create a so-called dynamic page

where the path segment to concrete value

in the path can be dynamic,

so that it's not just slash news,

slash something important,

but also slash something else

or slash this course is great, whatever.

So then this would be the identifier of a news item

and we have a lot of different identifiers

and we add new use all the time,

but we always load the same page

no matter what the concrete value here is.

But then inside of the page,

we simply have access to that value

in the path so that we can fetch the proper data.

And that is something we can implement with dynamic paths.

For that, we change the file name here

to a different file name, and we use a special syntax

which will be understood by nextJS.

We use square brackets here

in the file name in front of the extension.

If you have square brackets in your file name like this,

this tells nextJS that this will be a dynamic page

so that it should be loaded

for different values in your path.

And then you can add an identifier

between those square brackets

where the identifier name is totally up to you.

Something like newsId, for example, like this.

But this again is up to you,

but you need those square brackets.

This then tells nextJS that this page

will be loaded for different values.

So for example, for something important after slash news

but also for any other identifier.

And then in a next step,

I will show you how you can get access

to the concrete value entered here and how you can use that.

But let's get there step by step.

If we now saved as again, if I load this page

for /news/thiscourseisgreat,

I see the detail page,

but I also see for something else

or anything else we enter after slash news.

So that is how we can add such a dynamic path here.

And that is another key feature of nextJS.

It's a feature that allows us to build truly dynamic

and flexible websites with nextJS.

But how can we now extract the entered path value

inside of the component so that we can,

for example, then fetch the correct news item

from a database,

let's say when a user visits this page?

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.