Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Version dropdown and languages

Started by Andy Grafham 7 years ago · 1 replies · 649 views
7 years ago

Hi everyone. I've been looking into making a site a bit like the http://learn.getgrav.org/ with a drop down for the version, like the v1.5 / v1.6 one.

But on closer inspection it seems like that is using the language mechanism to provide different versions which seems less than ideal for a few reasons:-

1) It'd be nice to be able to have multi language support as well as multiple versions on the same site.
2) There's a 2 character limit on language names, so once you get to version 1.10 it would stop working I think
3) If you use [version=1.6] tags, it will only show for that specific version - it would be useful to have content that would appear for all versions 1.6 and above.

Does anyone have any suggestions of a better way to handle multiple versions?

Thanks in advance.

7 years ago

Hi @graf, You might want to take a look at the build-in 'Taxonomy' functionality of Grav in combination with the 'TaxonomyList' plugin.

You can see both in action in this demo of the TaxonomyList plugin. The taxonomies are shown on the right side below the "Popular Tags" header.

Imagine the tags like 'Photography', 'Journal' etc. to be your versions 'v1.5', 'v1.10'. When you select a tag/version, you will be taken to a page which only shows pages labeled with that specific tag/version.

Although the 'TaxonomyList' plugin shows the tags as a list, you can override the template used by 'TaxonomyList' by a dropdown.

Hope this gives you an idea.

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 133 1 day ago
General · by pamtbaau, 1 day ago
1 93 1 day ago
General · by Andy Miller, 2 days ago
0 77 2 days ago
General · by Marcel, 12 months ago
6 387 5 days ago
General · by Duc , 6 days ago
3 72 6 days ago