2

I'm just getting started with Craft. My problem is that I'd like the user to be able to change the location of call to action buttons on the site. Instead of allowing them to enter any URL, it would be bit nicer to let them select the related entry.

I can use the entries type, but it won't allow me to select channels. How should I proceed? Create a single section that displays the channel entries so that I can link to it?

3

Create a single section that displays the channel entries so that I can link to it?

Are you trying to select the actual Channel itself? (like the News / Blog).

  • Trevor Davis' handy Listing Section fieldtype could work here.

  • If you want more control as to what is shown on that channle's "index" page (intro blurb, featured entries, etc), as you mentioned, just create a single that maps to the index page of the channel. Craft's routing is smart enough so when you go to /blog/ (for example) it'll route to the entry first.

2

Any Section Type I.e. Single, Structure or Channel should be selectable via the Entries custom field.

For example if you had two Sevtions:

  1. Article
  2. Call to action

If you've already created the necessary Sections then create the Entries custom field. E.g "Related CTA" and use the Entries field-type. (As you described)

You should be presented with checkboxes allowing you to select all or only the necessary Sections.

Once you've chosen the relevant Section and assigned the custom field to the "Article" Section / Content Type, you will see a list of CTA Entries when publishing an Article Entry.

The broad steps are:

  1. Create the Sections you need
  2. Create the custom Fields you need
  3. Assign the Fields to the relevant Content Types within each Section

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.