Inhalte aufrufen

Profilbild

MVC Route block not working

Page Builder

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
5 Antworten zu diesem Thema

#1 Yoram

Yoram

    Benutzer

  • Members
  • 27 Beiträge

Geschrieben: 11 May 2020 - 11:02

Hello,

 

I want to import the news overview page on my homepage as a page builder block. I found a video that explains exactly what i want to do.(https://www.youtube....h?v=rsTuHDK47rQ) But if i try, it doesn't work, i get an error. The image is attached.

 

Is there something i'm doeing wrong?

Angehängte Bilder



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3596 Beiträge

Geschrieben: 11 May 2020 - 13:18

Also add the area parameter to your template route:

{
  "Area": "",
  "Controller": "News",
  "Action": "HomePageNews"
}

  • stefanmueller und Yoram gefällt das

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#3 Yoram

Yoram

    Benutzer

  • Members
  • 27 Beiträge

Geschrieben: 13 May 2020 - 08:06

Thanks Marcus for your answer. It is working now. You have to turn on the setting "Show on home page" in Settings > News settings. But that makes you see the news section 2 times on the homepage, in the MVC Block and on the original place. Is there a way to hide the original one?

 

I tried to turn of the setting and do someting like this, but that didn't work.

{
  "Area": "",
  "Controller": "News",
  "Action": "List",
  "command": {"PageSize": 3, "PageNumber": 0}

}



#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3596 Beiträge

Geschrieben: 13 May 2020 - 11:24

You can hide it using CSS in \Themes\Flex\Content\_user.scss:
.news-list-homepage {
    display: none;
}

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#5 Yoram

Yoram

    Benutzer

  • Members
  • 27 Beiträge

Geschrieben: 13 May 2020 - 12:04

I tried that also, but it hides both news overviews. Thats because the class name is the same for both. For now i solved it to comment out the render action in index.cshtml. Not the best practice, but it works.



#6 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3596 Beiträge

Geschrieben: 13 May 2020 - 15:19

You can adjust the above CSS selector to only get the desired block. Something like ".page-body > .news-list-homepage".


Schöne Grüße aus Düsseldorf,
Marcus Gesing



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: Page Builder