Replies: 1 comment 1 reply
-
Hi there! I see a couple of problems here. First of let's discuss why the blocks appear multiple times when you reload. If you're using memory caching (which is basic in the template setup), the call to Secondly, the call to Suggested solutionFirst of I would put a property Secondly I would do a query on the Regards |
Beta Was this translation helpful? Give feedback.
-
This is a code I have been trying to get working
The commented out code should simply add blocks to the page, like if you want to find the most popular pages, to show them as page links. The code works but does not do what I would expect.
The thing is. In the cshtml, the blocks are there, they can be counted, queried and worked on but they don't get displayed unless you reload the page. But if you reload the page multiple times, you get the block multiple times.
I think this has to do with how CSHTML files are pre-processed and/or cached.
The whole idea is not to do this in Javascript. The frontpage page class just inherits from Page, no changes, nothing to add, it is just there so I can get an URL for the front page so I could add the most popular pages or some other links.
Hope there is a quick and easy solution.
Beta Was this translation helpful? Give feedback.
All reactions