FROM CACHE - de_header

Button-Klick führt zu 404-Error

Gelöst
Nils_MOOT
Tourist
13 0 1

Hi!

Ich nutze Palo Alto und habe eine Promo-Section zur Homepage hinzugefügt. Die Buttons sind eigentlich zu existierenden Landingpages gelinkt. Sobald ich drauf klicke kommt allerdings der 404-Error und mir wird folgende URL angezeigt: https://moot.eco/secondary%20btn--small

Hat jemand eine Ahnung, woran wie man das fixen kann?

Vielen Dank im Voraus! 

1 AKZEPTIERTE LÖSUNG
Finer
Shopify Expert
1903 391 679

Erfolg.

@Nils_MOOT da ist auch direkt der Fehler 🙂

{%- assign promo_btn_link = block.settings.promo_btn_style -%}

ist nicht korrekt (4te Zeile)

 

Das sollte eigentlich folgendermaßen aussehen:

{%- assign promo_btn_link = block.settings.promo_btn_link -%}

 

Sobald du das korrigiert hast, sollte das passen.

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency

Lösung in ursprünglichem Beitrag anzeigen

8 ANTWORTEN 8
Finer
Shopify Expert
1903 391 679

@Nils_MOOT ich konnte diese Sektion auf der Seite nicht sehen. Kannst du ein Screenshot der Einstellungen zur Verfügung stellen?

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency
Nils_MOOT
Tourist
13 0 1

@Finer Vielen Dank für Deine Antwort!

Ich habe die Sektion nicht live, daher schicke ich Dir hier ein Screenshot aus dem Bearbeitungsmodus.
Bildschirmfoto 2022-10-25 um 09.41.45.png

Viele Grüße und danke für Deine Mühe!
Nils

Finer
Shopify Expert
1903 391 679

@Nils_MOOT wurde am Code etwas geändert? Ich glaube hier werden einfach die Einstellungen des Buttons in der Sektion falsch zugewiesen.

Im Code würde ungefähr so aussehen:

So würde das korrekt sein
<div>
<a href="{{ section.settings.button_url}}" class="button {{ section.settings.button_style}}">{{section.settings.button_text}}</a>
</div>

So wie es aktuell zu sein scheint (Achte auf die HREF-URL)
<div>
<a href="{{ section.settings.button_style}}" class="button {{ section.settings.style}}">{{section.settings.button_text}}</a>
</div>

 

Vielleicht kannst du in der entsprechenden Sektion das überprüfen.

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency
Nils_MOOT
Tourist
13 0 1

@Finer Vielen Dank! Leider finde ich weder den einen noch den anderen Code.
In der section-promo.liquid gibt es nur folgenden:
{
"type": "button",
"name": "Button",
"settings": [
{
"type": "text",
"id": "promo_btn_text",
"label": "Button text",
"default":"Shop Now",
"info": "Leave blank to link entire image"
},
{
"type": "url",
"id": "promo_btn_link",
"label": "Button URL"
},
{
"type": "select",
"id": "promo_btn_style",
"label": "Button style",
"default": "primary btn--small",
"options": [
{ "label": "Text", "value": "text" },
{ "label": "Small button", "value": "primary btn--small" },
{ "label": "Large button", "value": "primary" },
{ "label": "Small outline button", "value": "secondary btn--small" },
{ "label": "Large outline button", "value": "secondary" }
]
}
]
}

Ist daran etwas falsch?

Viele Grüße
Nils

Finer
Shopify Expert
1903 391 679

@Nils_MOOT das ist das Schema, der dafür relevante Bereich ist in der Datei wahrscheinlich etwas weiter oben, oder in einer separaten Datei. Kannst du die Datei hier anhängen/zur Verfügung stellen?

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency
Nils_MOOT
Tourist
13 0 1

@Finer in der Datei ist nichts mehr zum Button. In promo.liquid steht folgendes zum Button:

{%- when 'button' -%}
{%- assign promo_btn_text = block.settings.promo_btn_text -%}
{%- assign promo_btn_style = block.settings.promo_btn_style -%}
{%- assign promo_btn_link = block.settings.promo_btn_style -%}

{%- if promo_btn_text != blank -%}
<div class="promo-banner__button"{% if animations_enabled %} data-aos="fade-up" data-aos-anchor="{{ animation_anchor }}" data-aos-delay="{{ animation_delay }}"{% endif %} {{ block.shopify_attributes }}>
<a class="btn btn--{{ promo_btn_style }}" href="{{ promo_btn_link }}">{{ promo_btn_text }}</a>
</div>
{%- endif -%}
{%- endcase -%}
{%- endfor -%}
{%- endif -%}
</div>

{%- if promo_btn_text == blank and promo_btn_link != blank -%}
</a>
{%- endif -%}
</div>

Finer
Shopify Expert
1903 391 679

Erfolg.

@Nils_MOOT da ist auch direkt der Fehler 🙂

{%- assign promo_btn_link = block.settings.promo_btn_style -%}

ist nicht korrekt (4te Zeile)

 

Das sollte eigentlich folgendermaßen aussehen:

{%- assign promo_btn_link = block.settings.promo_btn_link -%}

 

Sobald du das korrigiert hast, sollte das passen.

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency
Nils_MOOT
Tourist
13 0 1

@Finer Super, das klappt! Vielen Dank für Deine Mühe! 🙂