1

2sxc 11.3.0 / DNN 9.3.2 (and others)

I want to set up a simple listing of cards (with a heading, a picture, some text, and a link) and when the user clicks on the link of a card, it brings them to a full "details" view that has a friendly URL. Very similar to a news module but considerably simpler.

So I would have https://mywebsite.com/careers and then a listing. When a user clicks on a career, they would be taken to https://mywebsite.com/careers/dairy-farmer

The URL would be the title of the career. On the details page, there would be a lot more content as well, that the content editor could manage.

Is this video still relevant? https://youtu.be/RtmOYvaeJpo

Or is there a newer, simpler way of doing things? Also, is this something I can set up in the Content module as opposed to the App module?

2 Answers2

2

I tend to use App rather than Content because I'm not limited when the inevitable need to do "one more little thing" happens. And, you can use both token an Razor views.

Yes, I think that the video is still applicable. There may be some differences in more recent releases of 2sxc. Most of the changes, though, simplify things.

So, what I would do is create a content type that includes all of the details of your cards. Then create a list view and a detail view, and you can tie them together with an apropriate URL.

If you look at the last of David Poindexter's "DNN Dave" videos with Don Gingold, you will see another approach, using the presence or absence of a querystring to determine whether to show the list or a detail section. That one requires Razor, though. It might be worth doing, though.

Joe Craig
  • 1,244
  • 1
  • 7
  • 7
  • Is using the visual query designer a mandatory step? How can I get cleaner URLs than just using the querystring? – Aaron - Wolf X Machina Jul 20 '20 at 19:03
  • 1
    No, the Visual Query is not necessary. I'll try to find some time to play with the Poindexter/Gingold approach show how you can build clean URLs ... it may take a few days. – Joe Craig Jul 21 '20 at 20:44
1

There are many ways to do this - as everybody could have different needs.

I suggest you look at the tutorial https://2sxc.org/dnn-tutorials/en/razor/data/home - at the bottom you can find various parent/child examples. The tutorial can also be downloaded.

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21
  • After a bit of searching, I did eventually find those tutorials but the URLs weren't very friendly. For example, https://2sxc.org/dnn-tutorials/en/razor/data610/true/id/15187 I wasn't able to figure out how to get it working from there but Joao Gomes did provide a sample that helped. – Aaron - Wolf X Machina Jul 27 '20 at 18:39
  • I guess you're right - there is additional complexity because of the tutorial; not ideal. – iJungleBoy Jul 29 '20 at 07:33