People who code: we want your input. Take the Survey

Questions tagged [entry-type]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9
votes
1answer
3k views

How do I add a subcategory to the URL slug for a channel entry?

I'm trying to mimic the URL structure exactly how I have it in my old CMS. If I select an entry to have both a category and subcategory I would like to have the subcategory in the URL along with the ...
9
votes
3answers
3k views

Entry Types Custom Slug

The website I'm working on has different sections and each section different types of entries. I would like the types of entries to be shown in the URL. I have followed this tutorial to do so. In a ...
8
votes
2answers
3k views

How do I display entries from multiple entry types?

I have a 'teacher' channel section on my site. That channel has three entry types, 'teacher', 'demoTeacher' and 'guestTeacher' - how do I display entries from teacher and demoTeach combined? At the ...
7
votes
1answer
895 views

Using an IF-statement to define the Entry URL Format

Within a channel I have two kinds of possible article types, which I separate with the entry type feature. For the entry URL format I want to include the type, but only for one of the two. I've tried ...
6
votes
2answers
190 views

Is it possible to show more entries of the same entry type as the current entry?

I'm creating a tumblr-esque blog with a bunch of different entry types. One of the entry types will be named "Image". When I'm on the entry page for an "Image" entry, I'd like to be able to show 10 ...
5
votes
2answers
6k views

How can you get an entry type's name from its handle in a template?

Each of my entry types have their own template. The url is something like: /foo/{entryTypeHandle} And the route is: 'foo/(?P<routesEntryTypeHandle>[-\w]+)' => 'bar.html' In the template ...
5
votes
1answer
4k views

Link to an entry via Entries field type

I am attempting to create a "dynamic" button. By that I mean I want the user to be able to update the text and the target (href) of where the button links to when clicked. So I created fields: ...
5
votes
1answer
183 views

How do I add Entry Types to URL?

In the Sections settings ("Entry URL Format") I would like to add an entry property tag for Entry Type. discography/{slug}
5
votes
2answers
597 views

A Structure section with an entry to a channel index

I don't have commenting privileges yet, so couldn't comment on either of these posts (here and here) regarding an entry in a Structure section that links to a Channel index. Between the two posts ...
5
votes
1answer
633 views

Set Default Entry Types for elements in a Structure Section

I have a Structure Section controlling my Nav and page contents So I have Home About Us History List item List item Services Service 1 Service 2 Service 3 In the Control Panel when I add ...
5
votes
1answer
811 views

Using multiple sections VS a single section with entry types

I'm just planning ahead for a project and was hoping for a second opinion. I'm going to be making a site that will have about 7 different types of entry - all of which have different fields/URL's; ...
5
votes
1answer
1k views

Managing a large number of Variants in Craft Commerce

I'm currently building a site for a client who's products vary in price depending on the width / height selected. Essentially what this means is each product has around 70 possible variations, each ...
4
votes
1answer
492 views

Entry Form - Multiple Entries & Entry Type & Parent

I'm building an MVP for a project, I'm using Craft and would like to: Create an experiment (/experiments/) Create multiple cages for the animals within the previous created experiment eg. 5 cages - (/...
4
votes
1answer
2k views

{% if loop.first %} and {{ loop.index0 }} not working with Matrix

I have a problem with {% if loop.first %} and {{ loop.index0 }} with the following snippet: {% for block in entry.locationSlideshow %} {% switch block.type %} {% case 'upload' %} {% for ...
4
votes
1answer
1k views

Get next entry based on entry type

As an extension of this question How to link to previous/next entries in a section? If my page is set to automatically provide a entry var in my template. And I can simply access a field like this ...
4
votes
3answers
1k views

How do I save a front-end form as a specific Entry Type?

I have a few different forms on my site for different kinds of enquiries, each represented by an Entry Type with different fields in a single Enquiries channel. How can I get the entries/saveEntry ...
4
votes
2answers
5k views

How do I create a link to an entry using entry's id?

This is a beginner question: How do I create a link to an entry using entry's id? I tried several combinations, such as {{ entry.getUrl(my_id) }}, {{ entry.url.id(my_id) }}, etc. but failed to found ...
4
votes
3answers
246 views

Is it possible to limit how many times and entry type can be used?

I've structured my site so that most of the pages are in a single structure section (easier to manage that way and it means all my pages can be outputted and organised in the navigation's {% nav %} ...
4
votes
1answer
477 views

New route for entry types

I would like to create a route for the entry types of a specific section, pointing to a single template. Is it possible to do this automatically? So far I haven't had luck, I'm thinking something ...
4
votes
1answer
1k views

Sections, Categories, and EntryTypes. Which, when?

bit of a 'best practice' question, as I'm very sure there are many ways to do this sort of thing, but... When/how do you decide whether to use a section, category, or entry type to organise your ...
4
votes
1answer
409 views

Redirect entry type to another domain

I have an entry type (outsideCourse) that will never need its own page. It only exists so I can manipulate it in various lists of required courses. Thanks to Mats Mikkel Rummelhoff, I have a macro to ...
4
votes
1answer
614 views

Set Structure Parent when creating Entry in Plugin

I have Structure-type Section for entries and want to pragmatically populate a large list of multi-tiered entries. I see you can create an entry like: $entry = new EntryModel(); $entry->...
4
votes
2answers
665 views

Can I use translated properties for URL formats

Here's my scenario. I have a structure section: "events". Within that I have three entry types: "events", "exhibitions", "specials". I would like the events to follow the following URL structure: {...
4
votes
1answer
851 views

Is it possible to Filter entry types via the URL?

I'm wondering if it's possible to dynamically filter a section list by entry type based on a url segment? I'm hoping to avoid assigning a category to every entry.
4
votes
1answer
190 views

Limit a field to entries by entry type

Is it possible to have an "entries" field but only allow selection to entries of a specific "entry type" within craft? I'm trying to use entry types as a sort of way to enable interfaces with chunks ...
3
votes
2answers
4k views

How do I loop through entries for a specific entry type?

I would like to loop through entries in a channel but only the ones for a specific entry type. Is this Possible? I'm using the free version of craft on a test site, I have used the channel for my ...
3
votes
2answers
853 views

Different templates for different entry types within a section

When specifying the URL and template used to render a section, it's possible to set variable URLs using something like /{postDate.year}/{slug}. Is there any way to accomplish something similar for the ...
3
votes
1answer
704 views

How do I filter entries in CP by Entry Type?

I have an entry type called industry and am trying to use this search syntax in the CP to filter my entries by that type: type:"industry" I am getting no results whatsoever. How do I filter entries ...
3
votes
1answer
74 views

A way to save feeds as an entry

Was wondering if anyone had looked a a way of saving RSS feed items as an entry into craft. I imagine this would have to be done through a plugin and a custom field type? Or is there a better way to ...
3
votes
1answer
307 views

Can Section access be restricted at Entry Type level?

I have a structure section that is driving the majority of a site, which works great with multiple entry types letting us handle different needs across different areas of the site. The client now ...
3
votes
1answer
634 views

Linking to channel via structure section

I apologize for opening up a whole new question for this topic since it's been discussed a few times now, however I don't have enough rep yet to comment on the existing questions. Regarding the ...
3
votes
1answer
243 views

Element API: Entry field inside a Channel entry being passed into JSON file

Hopefully my titles makes some sense but I will try to elaborate. I have a Channel entry called Movies that I am using the Element API to turn into JSON. There is a field inside that called Movie ...
2
votes
1answer
674 views

How to list the latest 5 entries per entry type?

Let's say I have 4 entry types (Article, Video, Photo & Quote). What's the best way to list the latest 5 entries by each entry type?
2
votes
1answer
871 views

How can I programmatically add a tab to entry type?

I'm trying to create a plugin that adds a tab full of fields to entry types but I can't seem to get it working. I tried assembleLayout but that replaced all the fields with my new fields rather than ...
2
votes
1answer
1k views

How to list out entry types in a section

Something like craft.entrytypes.section('sectionHandle') and then loop through them to list out their names. I'm looking through the docs and can't see how to do this with just the craft.entries code....
2
votes
2answers
657 views

How to set a different URL format for each entry type of a section?

Is there any way to set a different url format for each entry type of a section? I have an entry type "image" on which I will be using the Randomm plugin by Fred Carlsen to generate random strings ...
2
votes
2answers
35 views

Max # of entry types?

Is there a limit to the number of different entry types a section can have? For this project I might need 50+. I think I need more content to meet the quality standards so I'll explain: my client ...
2
votes
1answer
129 views

Pulling Data Across Entry Types

On our play pages (ex. http://actors-express.com.s102768.gridserver.com/plays/liaisons), we list our each of the cast members, their headshot and role. We did this by creating a matrix field that ...
2
votes
2answers
244 views

Pages for each entry from an entry type?

Let's say I have an entry type named "Designers", and I have: A title field "Full Name" A categories field "Specialty" Another categories field "Location" Now I want each designer (that is, each ...
2
votes
1answer
195 views

Showing entries for light switch [duplicate]

So I have three light switches on my blog: 'featured', 'required reading' and 'skills'. I got the featured section to work with this code: {% for entry in craft.entries .section(['etiquette', '...
2
votes
1answer
250 views

how to specify entry type on front end entry form?

I have a section with 2 entry types. Logged in users need to be able to submit to each type. I had planned on having 2 different entry forms. How do I tell the form which entry type to save to? I ...
2
votes
1answer
290 views

What is the handle of a section’s default entry type?

For a section without additional entry types, what would be the handle value of the default entry type output by {{ entry.type }}?
2
votes
1answer
549 views

check if a route segment matches a section entry type

So i added a route to a template that shows entries by entry types. the way the template does it is by taking the last segment of the url, and using it as an entry slug for this filter: craft.entries....
2
votes
1answer
471 views

Include single entry type with custom parameters in the for loop within multiple entry types

I have several entry types, where I want to set a special element criteria for the entryTypeHandleX entry type, and simultaneously loop through all entry types included entryTypeHandleX. The criteria ...
2
votes
1answer
246 views

Dropdown menu out of entry types

There is the one way to build it, I could know, but It's complicated for maintenance, because I may add some new entry by time. I'm trying to figure out a better way to have entry types related to a ...
2
votes
1answer
502 views

How can an entry type have its own search and categories?

I have an entry type whose content will be separated from the main content. So I was wondering how can we give an entry type its own search and categories? Possible?
2
votes
1answer
2k views

Problems creating an entry using app()->entries->saveEntry()

I get the Craft loaded with another application on PHP and I try to create a Entry, no problems deleting and getting the entries but when I try to create a new one Craft doesn't show me anything, and ...
2
votes
1answer
255 views

exclude array of entry types in query

Here is my query: {% set resources = craft.entries({ section: 'resources', type: 'not caseStudyLanding' relatedTo: filterParams, orderBy: 'postDate desc' }) %} I would like to ...
2
votes
1answer
159 views

Entries field won't save/update from plugin, although data seems to be correct

UPDATE: I have found a workaround for the problem. It's not really a solution to the original problem per se, so I didn't want to mark it as an answer, as the solution isn't optimal in my case. I ...
2
votes
1answer
371 views

When to add a field to an asset?

I've added a field to an asset which in my case is a fallback image for a video asset. When uploading a video the field for the fallback image isn't visible so the chances of forgetting to set one is ...