TransWikia.com

Show specific values when dropdown is select

Craft CMS Asked by Aima on July 18, 2021

I have a situation where I need to display booking links when the user selects a location from the dropdown list.

I have 30+ locations. Each location may have 3-5 different booking page links.

May I know how can I achieve this kind of problem in Craft CMS?

enter image description here

here is an example of what I want to achieve.

One Answer

At the risk of this question being closed for being too broad, there are a couple ways to handle this.

Unlike other CMS such as WordPress, in Craft CMS, the front end code is up to you. If you don't have any experience with HTML or CSS, you're going to need to get that experience first.

Assuming you have front end development experience, I'd recommend the Introduction to Templating page inside the Craft CMS documentation. Twig is a different, but great templating language for PHP.

In general, the way I work, I usually build the HTML and CSS outside of Craft first. When I have a good base, then I bring in the CMS related elements where you need them.

From your example, I can't tell if that's a mockup or production code but it looks like you're going to be making use of some sort of "accordion" UI component.

You could use something like one of the premade Foundation or Bootstrap components or if your project already has something like that built in, check out how it's built already by visiting the templates folder inside your project.

From there, if those booking links aren't being stored in Craft at all, you could just hardcode them in. But I'm also guessing those links could change at some point so maybe you use a Globals field to store them.

With knowing more it's hard to recommend a path but hopefully that gets you going.

Correct answer by RitterKnight on July 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP