{"id":7858,"date":"2021-05-02T11:49:20","date_gmt":"2021-05-02T11:49:20","guid":{"rendered":"https:\/\/www.bay20.com\/?p=7858"},"modified":"2025-05-21T16:33:32","modified_gmt":"2025-05-21T10:48:32","slug":"pagination-with-relnext-and-relprev-in-magento-2","status":"publish","type":"post","link":"https:\/\/www.bay20.com\/de\/pagination-with-relnext-and-relprev-in-magento-2\/","title":{"rendered":"Paginierung mit rel=&#8220;next&#8220; und rel=&#8220;prev&#8220; in Magento 2"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.bay20.com\/de\/magento-entwicklungsunternehmen\/\" title=\"Magento 2\">Magento 2<\/a> hat zahlreiche Optionen, die helfen k\u00f6nnen, die Suchmaschinenoptimierung zu optimieren, aber wenn es um Kategorieseiten geht, haben Sie nur die M\u00f6glichkeit, kanonische Meta-Tags hinzuzuf\u00fcgen.<\/p>\n\n\n\n<p>Hier werden wir unsere eigene Variante des kanonischen Tags hinzuf\u00fcgen, indem wir rel=&#8220;next&#8220; und rel=&#8220;prev&#8220; Tags hinzuf\u00fcgen, um Bots mit paginierten Inhalten zu helfen.<\/p>\n\n\n\n<p><strong>Nachfolgend sind die Schritte zur Umsetzung aufgef\u00fchrt:<\/strong><\/p>\n\n\n\n<p><strong>Schritt 1: Erstellen und Konfigurieren des Moduls zur Anzeige bestimmter Ereignisse<\/strong><\/p>\n\n\n\n<p>Erstellen Sie eine <em>registration.php<\/em> im Verzeichnis app\/code\/Bay20\/RelPage. Hier ist Bay20 der Name des Anbieters und RelPage der Name des Moduls.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n    \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n    'Bay20_RelPage',\n    __DIR__\n);<\/code><\/pre>\n\n\n\n<p>Erstellen Sie eine <em>module.xml<\/em> im Verzeichnis app\/code\/Bay20\/RelPage\/etc. Kopieren Sie den folgenden Ausschnitt und f\u00fcgen Sie ihn ein<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\"?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n        xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module\/etc\/module.xsd\"&gt;\n    &lt;module name=\"Bay20_RelPage\" setup_version=\"1.0.0\"\/&gt;\n&lt;\/config&gt;<\/code><\/pre>\n\n\n\n<p>Aktivieren Sie nun das Modul, indem Sie den Befehl<\/p>\n\n\n\n<p><strong>php bin\/magento module:enable Bay20_RelPage<\/strong><\/p>\n\n\n\n<p>Nachdem Sie dies getan haben, m\u00fcssen Sie das Modul mit bestimmten Ereignissen konfigurieren. Dazu m\u00fcssen Sie die Datei events.xml im Verzeichnis app\/code\/Bay20\/RelPage\/etc\/frontend erstellen und dann die Klasse observer anlegen.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\"?&gt;\n \n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Event\/etc\/events.xsd\"&gt;\n    &lt;event name=\"layout_generate_blocks_after\"&gt;\n        &lt;observer name=\"categorySeo\" instance=\"Bay20\\Seo\\Observer\\Category\" \/&gt;\n    &lt;\/event&gt;\n&lt;\/config&gt;<\/code><\/pre>\n\n\n\n<p><strong>Bitte kontaktieren Sie uns unter <strong><a href=\"mailto:manish@bay20.com\">manish@bay20.com<\/a><\/strong> oder rufen Sie uns unter <strong><a href=\"https:\/\/api.whatsapp.com\/send?phone=+918800519180&amp;text=Hi,%20I%20contacted%20you%20through%20your%20website.\" target=\"_blank\" rel=\"noreferrer noopener\">+91-8800519180<\/a><\/strong> an, wenn Sie Unterst\u00fctzung f\u00fcr Magento 2 ben\u00f6tigen. Sie k\u00f6nnen auch die <strong><a href=\"https:\/\/www.bay20.com\/de\/magento-entwicklungsunternehmen\/\">Magento2<strong>-Entwicklungsseite<\/strong><\/a><\/strong> besuchen, um die von uns angebotenen Dienstleistungen zu \u00fcberpr\u00fcfen.<\/strong> <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 has numerous options that can help to optimize the search engine optimization but when it comes to category pages, you have only option to add canonical meta tags.<\/p>\n","protected":false},"author":1,"featured_media":8413,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77,79],"tags":[],"class_list":["post-7858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento2","category-magento-anleitung"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/7858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/comments?post=7858"}],"version-history":[{"count":8,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/7858\/revisions"}],"predecessor-version":[{"id":17295,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/7858\/revisions\/17295"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/media\/8413"}],"wp:attachment":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/media?parent=7858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/categories?post=7858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/tags?post=7858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}