Questions tagged [sections]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
12
votes
1answer
6k views

How to get one random entry from among multiple sections

I'm trying to pull a random entry from among an array of sections, but I can't get it to work. I tried the code below, but I'm just getting errors. I've tried multiple ways of listing the sections -- ...
1
vote
1answer
53 views

How to build a web page using different sections created in Craft

I am a beginner in Craft. I have a Craft website. There is an HTML design with me. From admin, I divided the HTML into sections and created entries based on that. All the coding related to each ...
1
vote
2answers
34 views

How to display multiple entry loops on the homepage (Single section type)

I've been learning Craft 3 for a couple weeks and I've run into a little snag. I have a homepage that I would like to display multiple entry loops and/or types. However, I cannot find how to do this ...
0
votes
0answers
27 views

How to allow multiple entries to have the same slug?

Users create an account and their profile (domain.com/userName) is a template pulling info from craft users. Each user can create entries, all stored in a Structure section (domain.com/userName/...
1
vote
1answer
98 views

Calling unknown method: craft\models\Section::hasUrls() - Craft 3 upgrade

I am migrating a site from Craft 2 - Craft 3. In my sitemap template I have the following code; {% for section in craft.sections.getAllSections() %} {# We only care about sections that have URLs #} ...
2
votes
4answers
3k views

Get the URL of a section?

Similar to this question: Output URL to section Let's say we have a section with handle 'places' which defines its URL format as 'places/{slug}'—how do I get the link to the 'places' index page? The ...
1
vote
1answer
62 views

Can I use Craft CMS as a PIM system?

Does it make sense to use Craft CMS as a Product Information Management system? I have already used Craft 3 for a couple of sites, and I understand part of its capabilities. I was a bit puzzled ...
1
vote
1answer
31 views

Where/how to add a page title to a section (listing)

I have a number of pages/sections (listings) in either channels or structures. Each page/section (listing) will have a heading that displays an editable title of each page/section. Should I be able ...
0
votes
0answers
160 views

Database Exception – yii\db\Exception

I created a plaintext field called 'researchYear' that was add to a section called 'research'. I added a record to the section. I went back to the field, renamed it to 'researchDate' and made it a ...
16
votes
3answers
22k views

How to return a specific entry?

Hopefully this is a simple question but I couldn't find a clear answer anywhere - I just want to be able to pull in data from a specific entry, where I know the identifier. In this particular case, ...
0
votes
0answers
19 views

Use one entry's records in Dropdown field

Let's assume we have two sections... the 1st is topic and the 2nd is videos. I want to filter videos from topic's name. So I want to use topic name as a dropdown in the videos section. But I don't ...
1
vote
1answer
20 views

Merge a structure and a single section

That is written so inefficently: {% set indexNavi = craft.entries.section('pageContent').level(1).all() %} {% set bookingLink = craft.entries.section('booking').all() %} <ul class="navList"> ...
1
vote
1answer
36 views

Edit the create new section page [closed]

When creating sections, I need a way to toggle all of them off or on. I have 188 sites and you can imagine how big of a pain it is to untoggle one by one. Am I able to do this somehow? Create a ...
12
votes
1answer
2k views

Move entries between sections

I have some entries that I'd like to move to a different channel, but I don't see any way to do this. Is it possible?
1
vote
1answer
138 views

How to manage multiple categories and entry url formats

I have a setup in Craft 2 like below: Section: products Url format: flowers/{productCategory.last.uri}/{slug} Categories: cat1 = Bouquets cat2 = Valentines days Url format: flowers/{slug} The ...
1
vote
1answer
143 views

Fixing deprecated code, relatedTo issue

Working on fixing a lot of deprecated code, enviroment is setup as dev so getting a lot of warnings. Some are easily idetified, others are pretty generic and come from core files. Doesn't show where ...
1
vote
2answers
60 views

Multiple authors for an entry

The website I'm currently working on is a plattform where several 'subgroups' can post events but also have their own subpage. So the two affected secrions are 'event' and 'subgroup'. Currently, every ...
2
votes
1answer
181 views

Organizing Entry, Section, and Category hierarchies

I have a site with three broad sections of content: Humanities, Business, and Music. Within each of these are sub-sections. Under "Humanities", for example, is Politics, History, Economics, etc. ...
1
vote
1answer
35 views

Using language specific variables inside section URL settings

When i use some kind of variable in url settings of section, it always uses default language version of this variable. For example, blog has two languages, english (default) and german. If i use ...
1
vote
1answer
480 views

How do I get different URL Format with parent/child structures & how do I display different templates?

I need to create a features structure section for a website that will have parent features and child features. Q1: How do I get different URL Format for parent & child pages? I need the parent ...
1
vote
1answer
469 views

How can I list Entry Types of a single Section?

The following outputs all sections and their entry types, but I'm struggling to work out how I output only the entry types from the "blog" section. {% for section in craft.app.sections.allSections() %...
1
vote
2answers
104 views

A-Z Separate Pages

I've built a page listing all entries by Character 0-9/A-Z. But unfortunately it's extremely slow loading due to the amount of entries the site has. I'm wondering if I can break out the letters into ...
1
vote
3answers
559 views

Craft templates in sub directory

We want to add a little more structure to our templates directory by adding folders to group templates files. For example: templates --_macros --_views --_layouts In general this works fine but we ...
2
votes
1answer
40 views

Section and template folder problem

I hope anyone can help me to get started. I think I have a brain freeze or something. I have created a section (structure) that is called "House". I want this section to use a template. In craft/...
2
votes
1answer
216 views

Targeting the first entry item

I'm using Craft 3 and have created a section (channel type) for my project entries. At the bottom of each project page I have my Prev and Next Project buttons. How do I target the first and last ...
2
votes
2answers
854 views

How should an index page be setup/defined in Craft?

Site construct question... I have categories. Craft knows where to find the template for a category - i.e. markets/{slug}. But I also have a Markets (categories) page with the first 6 entries ...
1
vote
1answer
43 views

How should I organize/structure my channel sections?

To me, I have a large dataset of 2,000 - 2,400 entries. It's a static dataset. I only need to update a few fields annually. I plan to use channels. But, how should I organize the channels? ...
1
vote
1answer
27 views

Can user group permissions be used to override entry section locale settings?

I have created a localized site with 9 locales for a client in craft v2.6. They are now requesting us to create a user group for each locale so they can assign editors for each of those regions. When ...
1
vote
1answer
443 views

Get Entries from a specific Entry Type

I'm trying to get all Entries that are from a specific Entry Type. My Section is "Site". Which has 3 different Entry Types. Now I want to get all Entries from the Entry Type "Program". I'm trying ...
1
vote
1answer
145 views

Find related entries from section entry Matrix entry field

In my projects section, each project entry has a Entry field in a Matrix. The Entry field references a tool. On the tool entry page I am trying to display all the projects that use that tool in their ...
1
vote
1answer
173 views

Element Type: Edit Page fields

I'm currently working on creating a full-sized Edit Page for my own Element Type. I created a elementSelectField and wanted to know if you guys have some advise or good articles to read on that ...
1
vote
0answers
25 views

Multi-language, how Craft determines the CopyFrom after adding website and Section

The question is admin (backend only), not Twig : Where to Manage "copy from" site when adding new website and add section to this website. The "Copyfrom" takes place in the background after ...
1
vote
0answers
17 views

Section permissions are ignored when linking to an entry

Users with permissions to limited sections can still “link to an entry” in any section from within the WYSIWYG (Redactor) editor. I'm using Craft 2 with a Rich Text (Redactor) field. Is this a bug ...
0
votes
0answers
230 views

Get Entries from Section related to a category

I'm currently trying to get all entries which belong to a section which is related to that category. e.g. Category Brand Offer Offer belongs to a brand. Brand has a category field. {% set ...
0
votes
1answer
71 views

How can I use two different templates for a single entry?

I'm building a coursework site and have a Course section, who's entries will be courses containing work that the client will assign to users. I built in both the work itself (different "lessons" ...
1
vote
2answers
250 views

Craft CMS - Dynamic Order Field Layout In Sections

I'm wanting to have the order of my elements within a template dynamic so that the user whilst in a template of page can reorder the modules as they please. See screenshot for example Within the ...
1
vote
1answer
257 views

Entry within multiple sections

I'm trying to work out if the following is possible in Craft. Assuming I have a single entry, I want to theoretically tag it as a 'blog' and 'about', both of which are sections I want to then have ...
1
vote
1answer
474 views

Get the section name based on a url segment

I'd like to retrieve the name of a section based on a url segment. Normally I would use {{entry.section.name}}, but this doesn't work, since there is no entry available. I've got this working: {% ...
1
vote
1answer
60 views

best approach to call entries from two different sections

I have set up two sections for two different kinds of events. On one page I want to differentiate between them on the other page I want to list them all. How do I organise that best on the back end ...
5
votes
2answers
1k views

Updating all entries URIs after changing entry URL format

After publishing some entries, I've changed the section setting "Entry URL Format" from news/{slug} to news/{id} but I had to re-save every entry to reflect the change. Is there a better and fast way ...
2
votes
2answers
228 views

How do I set up a section for pages with very flexible content?

I'm trying to build a page similar to the index page of buildwithcraft.com. There you have a page with (visual) sections ("A new kind of flexible", "Ready where you are" and so on). Each one has ...
1
vote
1answer
31 views

In a large set of entries across multiple sections, how can I loop through each section type in the set?

I have a set of entries from multiple channels and I want to loop through each section type that is in the set. Something like {% set entries = craft.entries.search(query).order('score') %} {% for ...
1
vote
1answer
292 views

Translate Section name

I can see in the CP (craft 3) that my sections have a 'translatable' icon but I don't find anywhere in the UI to translate section names. What's the best way to translate these?
8
votes
2answers
351 views

Is there any way to set a default status for Entries, either globally or per Section?

The subject more or less covers it — is there any way to set the default status for Entries, either on a Section by Section basis, or globally? I have a client that doesn't want to accidentally set ...
2
votes
1answer
187 views

First Craft website: how to organize different content

I am new to Craft and read a lot of arctilces and most of the docs. Most parts are quite easy. Now I plan how to organize all the different parts and pages. Below is a simple outline. Not every page,...
2
votes
2answers
100 views

List most recent items combined from Channel and Structure sections

If we pass through an array of Channels & Structure sections we find that Channels entries tend to be listed first. So the first 15 will comprise of ChannelOne and ChannelTwo and then start ...
1
vote
1answer
436 views

How to get fields from another section?

I need to get data from fields from another section. My code is: {% for kontaktEntry in craft.entries.section('kontakt').entry.kontakter %} <div> <a href=...
2
votes
2answers
33 views

Any ID I could reference in sections

I created a section for appointment record (channel type). Each appointment record has different fields, i.e. customer name, phone#, address, etc... I would like to set a unique appointment_record_id (...
1
vote
2answers
417 views

Nested IA Structure - What's the best way to get it set up?

I'm beginning to work on my first Craft CMS website. (I'm really excited!) I've read a ton of documentation and am getting my head around setting up a structure within the system. The website will ...
0
votes
1answer
69 views

Can structure entries have their own entries?

I have a bunch of categories within a section on my website, but I want each category item within that section to be able to have an additional slug. For example: mywebsite.com/categories/category/...