Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Dynamic Content Items #4856

Closed
LMSSonos opened this issue Nov 22, 2019 · 8 comments
Closed

Question: Dynamic Content Items #4856

LMSSonos opened this issue Nov 22, 2019 · 8 comments

Comments

@LMSSonos
Copy link

To show the real example, I have following menu structure
Unbenannt

For this I created a taxonomy as follows:

  • Winter (url: /winter)
    • Freeride (url: /winter/freeride)
    • Avalanche Training
    • Snowshoing
  • Summer
  • Outdoor

Then I create ContentItems (Type: ActivityPage) for Freeride Tour1, FreeRide Tour 2, Basic, etc. They all reference the corresponding taxonomy.

Now when I click winter in the menu, I want to show a page which lists all the sub-taxonomies as shown here (call this MainOverview):
grafik

Then, when selecting the Freeride example, I want to show all Content-Items with that Taxonomy, in this case (Call this SubOverview)

grafik

Question
I could create a MainOverview Page for Winter, Summer, Outdoor and on each Page I select the taxonomy to show.

Then I could create SubOverview Pages where I assign the subtaxonomy (Freeride) and it shows that ActivityPages with that taxonomy.

The Problem: With that is, that if the structure is big, you need to create lots of pages.

I was wondering if there is something more dynamic to build this structure without having to generate a MainOverview Page and SuboverviewPage for each taxonomy.

@LMSSonos LMSSonos changed the title Question Question: Dynamic Content Items Nov 22, 2019
@dodyg
Copy link

dodyg commented Nov 22, 2019

You can query from TaxonomyIndex

#4494 (comment)

So essentially you just need to make two pages: MainOverview and SubOverview and create a query that take the taxonomy term id

@LMSSonos
Copy link
Author

@dodyg thanks for your hint. But how can I have like a dynamic content item (page) which will be called if you call /winter o /winter/freeride. I'm looking for a way not having to create all these MainOverview and SubOverview pages.

ps: do you think taxonomy is the right thing here or should I go for lists (like blog template)

@deanmarcussen
Copy link
Member

Something you are probably looking for is this #2688

@LMSSonos
Copy link
Author

@deanmarcussen thanks! that's exact what I was looking for. As it sounds, it will take still longer until this is released, so for the moment I will probably go the way to build all the pages.

@dodyg
Copy link

dodyg commented Nov 22, 2019

Ah I got it - the problem you were trying to solve is preserve the nice url structure (/winter/free-ride).

If you don't care about this, then you can create a Liquid page that handles these structures via query string e.g. trip?q=/winter/freeride.

ps: do you think taxonomy is the right thing here or should I go for lists (like blog template)

I would choose Taxonomy if I had your scenario.

If you are going to create these pages manually for the routing purposes, I hope you are creating a template and call this template from the pages.

@LMSSonos
Copy link
Author

@dodyg the liquid page is not an option, as I want to have the nice url ;-)

If you are going to create these pages manually for the routing purposes, I hope you are creating a template and call this template from the pages.

I will create a ContentType SubOverview and this one will have the current taxonomy. Then I create a entry with route winter/freeride , another with route winter/avalanche-training etc. Then I also planned to add a templated Content__Suboverview where I probably use a query to get all the entries from the database. Or did you suggest it differently?

@dodyg
Copy link

dodyg commented Nov 22, 2019

Yeah that should work.

The other approach is to create a custom module to render taxonomy pages in case they grow too large.

@LMSSonos
Copy link
Author

LMSSonos commented Nov 22, 2019

The other approach is to create a custom module to render taxonomy pages in case they grow too large.

I tried to use modules (https://orchardcore.readthedocs.io/en/dev/docs/reference/core/Modules/) but the issue I had was that the html code I return from there renders as whole page, but I want to write from the module only to the {% render_body %} of part within template. Then this would be the best way. I did not find a way to do this.

@OrchardCMS OrchardCMS locked and limited conversation to collaborators Apr 25, 2024
@Piedone Piedone converted this issue into discussion #15852 Apr 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants