Questions tagged [sections]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
414 views

Using a macro for entries loop

I'm trying to use a macro to output a list of entries (and the title of a section), this is my code: {% macro sections(sectionName)%} {% set index = craft.entries.section('{{ sectionName }}Index'...
3
votes
1answer
75 views

Section/category setup input

Looking for some input on how to setup a Craft site. I have 2 sections of the site containing content grouped by the same set of topics (or categories). For example, within Services there 6 sub-...
0
votes
2answers
444 views

Multiple Sections Within a Structure Group?

My site has a set of different layout types with their own templates: Brochure Listing Plain Text And the site has a group of hierarchical pages that each use a different layout: About (Brochure ...
3
votes
1answer
404 views

Localization - Getting page not found from CP when trying to edit new locale

I've set up a new locale fr_ca according to the localization guide. I've defined my site url's accordingly and set the files like so that english is on the top level and an fr_ca folder contains the ...
3
votes
1answer
1k views

How do I sort a collection of entries from multiple sections by date?

I want to create a featured story slider on my website and gather the latest entries from multiple channels to populate it. Here is what is working: # fetch the entries {% set featuredBlog = craft....
2
votes
1answer
67 views

Show a partial list of sections

I would like to selectively show a subset of my sections in the main navigation. Is it possible to do something like this? {% set sections = craft.sections.getSectionById(1,2,3) %} {% for section in ...
4
votes
1answer
132 views

Section Single Title Caching

I have the following - {% set press = craft.entries.section('press').first() %} {{ press.title }} If I change the section title in the Sections area of the back end from something like "Press" to "...
0
votes
0answers
75 views

How to create a plugin which will update a field in a section when an entry is saved

I am looking to create a plugin which will update a field in a section when I save an entry. I will be getting the length of an MP3 file (using FFMPEG) I upload via assets and output the time to ...
1
vote
2answers
981 views

Only display entries based on a field conditional

Hey I am trying to get 4 entries, but only want 4 that have a body length > 100. How would I accomplish this? {% for entry in craft.entries.section('artists').order('RAND()').limit(4) %} // only ...
1
vote
2answers
741 views

Conditional logic to add class for specific section entries

I'm trying to create a conditional logic so that the class 'white-nav-bg' is added to the element on the 'blog' section entries only. Below is the code I'm currently using to try and achieve this ...
2
votes
1answer
288 views

What are the consequences of choosing structures over channels?

I want to build an international directory of fishing port centres in Craft. Each port will have the same custom fields and be geocoded. The documentation here just doesn't make clear the ...
4
votes
2answers
302 views

Why would I choose Channels as opposed to Structures

I can sort structures alphabetically, by date or by specific field. Structures also allow me to sort by the order specified in the Control Panel. So what is the use case for using Channels instead of ...
3
votes
1answer
299 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 ...
0
votes
1answer
465 views

Is it possible to reorder fields with drag and drop?

I'm trying to understand how most people deal with this likely common issue, I've been looking around for answers, apologies if this is a subjective question, but I imagine there is a 'correct way' of ...
4
votes
2answers
582 views

Structure(s) vs. Categories for product catalog

So I am working on a project that includes an online product catalog. Is there a recommended way of setting up a catalog regarding the use of structure(s) vs. categories or a combination both? I ...
3
votes
2answers
2k views

How do I return ALL entries that are singles

I'm trying to generate a sitemap and wish to output all the entries that have a section type of 'single' but can't get the the correct syntax. All of the entries need to return 'single' for {entry....
3
votes
1answer
3k views

How does the Structure section type work?

I read the documentation but I'm still confused about the Structure sections.. What they are usually used for? What are the advantages of using it? And most important how to use them? Please can you ...
2
votes
1answer
724 views

How do I loop through and access all sections of returned entries?

On my search results page I want to add a section filter depending on the different sections that are included in all of the returned entries. I am getting all the sections like this: {% set entries ...
1
vote
1answer
80 views

Problem after renaming section

I had a section called vision which i renamed to articles. I did so by going in to sections and clicking the section and then changing.. Handle, Entry URL Format and Entry Template. I also copied and ...
0
votes
1answer
201 views

Simple linkage to singles

For some reason there is not really a clear mention on the Craft documentation about this. And I couldn't really find anything in here that explains it either. I know this is kind of basic knowledge ...
3
votes
2answers
788 views

Custom navigation URLs?

I have an existing ExpressionEngine site which I'm looking at moving to using Craft instead. Only really had a quick cursory glance at the system so far but a little confused on a few things. Say ...
5
votes
2answers
5k 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 ...
1
vote
2answers
669 views

Any plugins to add drop down for selecting template?

One of my biggest issues with craft so far is having to type out which template file a section is using, I don't understand why we don't have a location to enter all our possible templates, which ...
0
votes
1answer
119 views

Click read more on a single and it takes you to items in a structure

Hey guys I was wondering if anyone could help me... I am trying to link from a readmore button in a single( it's like a services page) to pages in a structure. So instead of having a top level ...
2
votes
0answers
614 views

Asset dynamic subfolder paths referencing entry section not available until saved

I have an asset field within a matrix block, for which uploads are restricted to a single folder. The upload location path is set to {owner.section.handle}/{owner.slug}. Using this pattern the asset ...
1
vote
1answer
735 views

Resaving blog entries keeps failing

Recently changed the URL format for a section. Now I have a red circle in the upper right and an error message of "resaving blog entries - failed". Trying again results in same error. Any ideas what ...
3
votes
1answer
496 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 ...
1
vote
1answer
39 views

Starting a section with a number

I have a section of type structure where I need the url to be /5minutes. I cannot make this work (note that I have changed the handle to fiveminutes. But everything I would like to be 5minutes. I even ...
1
vote
1answer
404 views

How to output entries related to a locale, IF a section is targeted to all locales?

The documentation doesn't say much about it, only How to access it. What I'm trying to achieve here? Display entries only related to a locale. I'll present it you with an example. There are 3 ...
5
votes
3answers
3k views

How to use a Structure including a homepage

As far as I can tell, it's mandatory to have a Single as the site index. I always use a Structure for organising my pages, and different entry types for different page templates. I intend to use a ...
14
votes
1answer
3k views

Is it possible to exclude multiple sections from an entry search query?

I'm trying to build a search function that excludes results from certain sections all together. This is the code I was trying to use. {% set entries = craft.entries.search(query).section('not ...
1
vote
1answer
808 views

Output section and tag name with URL in entry loop

I'm trying to loop through entries in specific sections and output Entry's: - URL - Title - Type - Asset's image - asset's URL - Section's name - Section's URL - Tag's ...
7
votes
3answers
574 views

Can I extend entries listing views (currently or in the future)?

Is there a way to show custom columns in the backend with entries listing views? Or can it be a feature in the future? For example: show category as a column in the news overview in the backend
0
votes
0answers
97 views

Get Handle/Name of Entry's Section [duplicate]

For theming, I need to get the Section Handle for the current Entry. When using dump(entry), I see sectionId is available. This works fine: {{ entry.sectionId }} But I'm not seeing a way to get the ...
1
vote
1answer
643 views

How to build a navigation from sections

I've went through several examples related to my issue, but I quite couldn't find What I'm looking for. Well, there was one, but with pre-defined array. What I'm looking for is to only output all my ...
1
vote
1answer
180 views

Search Assets in Matrix fields, if they appear in a Section

I want to run a search on Assets that are in use within a particular section. The Assets are added to entries via a Matrix field. The search term is provided via a url parameter: {% set searchTerm = ...
4
votes
2answers
496 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
2answers
917 views

Building a website containing restaurant menus from multiple vendors — need some advice on Section hierarchy of data

Figure I'd query with the geniuses over on StackExchange as I think I've hit a roadblock in my project. I'm building a website containing menus from multiple restaurants with the vision that it could ...
1
vote
1answer
224 views

Content from two sections but one of which is related to a specific category

I am looking to do the following. I'd like to display a list of entries from two sections. That much is straightforward; however the kicker is that I only want entries related to a specific category ...
1
vote
1answer
102 views

Title vs Heading in Fresh Install?

In a fresh installation the 'Home Page' seems to make use of the custom 'Heading' field whilst the 'News' channel makes use of the 'Title' field. What is the advantage of using the 'Heading' field ...
1
vote
1answer
64 views

Architecting a Solution with many Sites within a Site (Chapters) - How many sections can Craft Handle?

I am working on a plan for a site build that includes national content as well as many chapters' content. The latter has a number of requirements that are leading me to using separate sections ...
0
votes
1answer
784 views

How to load a template based on the first segment (and ignoring the second)

So I have my dinnermenu at example.com/dinnermenu but I want to show specific content for the next week if someone asks for it via example.com/dinnermenu/nextWeek but it should still use the entry ...
1
vote
2answers
202 views

Workaround for deprecated regex pattern modifier in PHP 5.5.0 and up (10.10 Yosemite)

I'm relying on the Low Regex plugin to convert section handles from camelCase to lower-dash-case to use them in URLs, like so: {section.handle|regex('/(^|[a-z])([A-Z])/e', 'strtolower(strlen("\\1") ? ...
0
votes
2answers
271 views

Insert a url segment without creating sections

I have a very simple site split into sections. All pages use just one template. The previous site had sections such as /section/subject. I had thought I could have all entries in just one section ...
1
vote
1answer
184 views

How to create sub-nav when using a structured navigation heirarchy?

I have my navigation in a Structure like here and I want to build a sub-navigation on my Information page containing Specials, Reviews, and About, but I can't figure out how. {% set active_item = ...
8
votes
2answers
2k views

Output children of a structure section in reverse order

How do you output the all the children of a structure in a reverse order (assuming the children are limited to max depth). Using the order parameter, Craft requires that you use a second parameter ...
2
votes
1answer
674 views

How to check if on a channel/category index?

In the previous question I asked for a way to detect the 404 page from a plugin. Brandon gave me a good starting point with this answer. However, I wondered what method I could use to also detect ...
4
votes
1answer
415 views

Easy way to copy sections to a new install

Is there an way way to copy sections I have in an existing site to a new website I am doing with a fresh install? E.g. To Copy the News Channel Section and all the field types Also copy the structure ...
5
votes
1answer
865 views

Output URL to section

Is it possible to output the path to a given section? I'm using this to define the section model for the contact page (a single): {% set contactPage = craft.entries.section('contact') %} But then, ...
5
votes
1answer
565 views

Use postDate in section title format field

I'm trying to generate titles for a section's entries based off of the given post date (if it exists). Here's the configuration I've got in the Title Format field for this section's entry types: New ...