Questions tagged [entry]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
2answers
2k views

Get the ID of a new entry when it's saved

Is there a way to save a new entry with a template form, then pass the ID of that new entry along to the redirect location? The use case is, I'm interacting with a scheduling service and want to ...
4
votes
1answer
588 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->...
6
votes
1answer
11k views

Display entry post date

How do I display my entry post date, formated as "May 24, 2015"? I know this is a very basic question, but I can never find these easy answers in either the Craft or Twig documentation.
0
votes
1answer
102 views

Any way to create new entry using certain entry type?

I'm thinking this isn't possible but would be nice if it were? Just wondering if you have loads of different entry types for a section then it would be nice if there was a way of creating a new entry ...
3
votes
1answer
369 views

Load correct language Ajax

I'm having a problem with my ajax-loading when I'm on the english version of my page (My main language is Norwegian). I have a file named loadmore.html that I'm loading in on index.html when pressing ...
2
votes
1answer
105 views

404 when clicking on the Disqus embed urls

I've just noticed on a site that the Disqus comment embed is suggesting other articles but they're adding a token to the end of the URL, for example: http://australia.thegospelcoalition.org/article/...
1
vote
1answer
6k views

Impossible to access an attribute (title) on a string variable

I have a Video section with a field called videoCategory. I'm trying to pull in the first category on the _entry.html template. I'm pretty much following the the last example in the documentation at: ...
2
votes
1answer
466 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
0answers
662 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
0answers
239 views

Get entries using Multi-Select Field as Criteria

When querying for entries, I'm stuck on how to query for "selected" fields. The query I'm using: $criteria = craft()->elements->getCriteria(ElementType::Entry); $criteria->section('athletes'...
2
votes
2answers
115 views

Tagging and Associating Photos with Entry Type

We have hundreds of photos on our theater website from past performances. In order to sustainably manage the relationship between cast members and which photos they were in, we wanted to explore ...
2
votes
1answer
125 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 ...
3
votes
1answer
369 views

Saving entries in admin panel

I have a problem with the admin panel being very slow when saving an entry. It takes about 30 seconds to save an entry. I use a matrix for the different part of the entry (imgs, textfields, titles and ...
2
votes
1answer
180 views

Sorting entries based on an a bespoke algorithm

We have been asked to scope a solution for a new site build that we'd like to use Craft for. There is one requirement I'm not sure how we'd approach though. In Craft terms, we would have an Articles ...
6
votes
1answer
2k views

id: 'not' with variable

i think the following code shows the problem: {% for entry in craft.entries({ section: 'news', limit: 2, **id: not this_id** }) %} the big one doesn't work in this way. Has anyone an idea? The ...
0
votes
1answer
695 views

Multiple Photos/Assets in one upload entry [closed]

I'm having a bit of a problem with using craft currently. My site has a gallery section where I would like to mass-upload image files to an entry which is in the area: admin/entries/photos However, ...
0
votes
1answer
623 views

How to get the author of an entry?

I have one user group created, several users in it excludes admin. I've tested it includes admin to that user group, but with no effect. If you create an entry in channel as admin and check at front ...
9
votes
2answers
4k views

Detecting if page is a 'category' or 'entry'

Is there another way of detecting if a page is an 'entry' or a 'category' than the following? Maybe some global variable that I do not know of? {% if entry is defined %} <!-- Code here --> {% ...
1
vote
2answers
87 views

Comments being overwritten on save

I am trying to save comments using the core method "entries/saveEntry", but every time I submit the form the last comment is overwritten, is there a simple way of submitting this information to insert ...
4
votes
2answers
365 views

How to check if entry field value is already outputted, and prevent it again?

For an event page I have the option to filter on cities and countries. Each event has entry fields in which the city and country, of which the values are outputted in a drop down list on the front end....
2
votes
1answer
159 views

Is there a way to output more Matrix fields than one?

I'm struggling to get an element criteria model of more matrix fields at once for entry related to tagField. Example: I have two matrixFields, where I want them in {% for block in entry....
1
vote
1answer
567 views

Output tags from matrix fields related to an entry

Using the code below, Craft was able to get related tags to an entry, before I decided to move TagFieldType to MatrixFieldType. {% set entries = craft.entries %} {% for entry in entries %} <...
4
votes
2answers
6k views

Determine Entry based on URL Parameters?

I have a bit of code that checks if a page's title has been manually set in a parent template, and if it has to use that, otherwise to use entry.title. This is what that bit looks like: {% set ...
1
vote
1answer
654 views

How to create entry from external app webhook?

I want to create an entry in an existing channel via a webhook from zoho crm. It's pretty straightforward. Like many apps, Zoho's webhook allows you to specify destination url, the method (get or post)...
1
vote
3answers
846 views

Get the current entry element in the CP (edit entry view)?

You can listen to entries.onSaveEntry or entries.onDeleteEntry events and then get or modify the entry via $event->params['entry'];. But how would I get the entry element and its properties in the ...
0
votes
0answers
101 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 ...
4
votes
1answer
635 views

Save multiple locale data via plugin

I'm trying to import data from another database using locales, but am having trouble saving the other locale after the primary locale is saved. foreach($row as $data) { $entry = new EntryModel();...
2
votes
1answer
336 views

Update entry.body from Plugin

I'd like to run the entry.body content through some PHP functions before the template outputs it, there probably two approaches to this: Create a twig function via Plug (if possible) and use that in ...
2
votes
1answer
241 views

Find an authorId based on first and/or last name

Is there a way I can reverse use the User Model to return an authorId based on the first/last name (John Doe)? Basically, I'm converting the first/last to a readable URI segment (using email ...
1
vote
2answers
682 views

Auto Expire on entries

I need to automatically set the expire date of a new entry (only) from a specific section. I know that it's possible to do this via the frontend twig templates, however I need the user to have the ...
1
vote
1answer
283 views

How do you route an entry or category URI to a plugin controller?

Craft's documentation states: "If the URI matches an entry’s or category’s URI, the section’s/category group’s template will get loaded". Instead of loading the template, how can I set the route to ...
1
vote
1answer
104 views

Protect entry so that only a “relatedTo” user can see it

I would like to protect the viewing of an _entry.html page so that only a user related to that entry can view it.
2
votes
2answers
1k views

Title Format - Auto Generation via linked entry

Finally hopping back into Craft to finish a large project, and am loving so many of the new features added! One thing I am using extensively is the Title Format feature. For one of my entry types, my ...
5
votes
1answer
2k views

Plugin Controller - Save Entry

I'm testing with the Foxycart Plugin to update the stock in my code. In the FoxyCartController.php I'm able to filter through the XML feed ok and get the new Stock value but it's doesn't seem to be ...
2
votes
1answer
769 views

Output descendants of current structure

I hope I worded the title correctly. I'm trying to output whatever structure's page I'm on - I want the descendants of whatever page that is. I'm currently using this, which at first appeared to work, ...
1
vote
1answer
198 views

is it possible to edit an entry from the front-end when you're not logged in?

I'm working on a checkout process for a takeaway restaurant where anonymous visitors can place orders using guest entries. In this stage the order is saved with a status of "unpaid". Once a visitor ...
1
vote
1answer
2k views

How do I format the date and time I got from an entry?

I am working on a project where the content manager can add events (entries). These events have a date, starting time and end time. The fields in the cms show the option for adding a date, time and ...
3
votes
1answer
1k views

How to display an entry on frontend with status disabled if admin is logged in?

Something like this? {% if craft.session.isLoggedIn %} {% set slug = craft.request.lastSegment %} {% set entry = craft.entries.slug(slug).status(null).first %} {% endif %} {{ entry.title }} ...
0
votes
1answer
164 views

In a matrix, link to entries with a future date

This is somewhat related to this How can I display a "pending" entry in my "_entry" template? I have an 'events' section where some entries have a future date - the above link ...
3
votes
1answer
108 views

Many versions of the same structure of entries?

If I had a structure representing the user guide of a product; is it possible to select a specific version of user guide entries from a URL? http://www.example.com/myproduct/docs/v2.0/installation ...
0
votes
1answer
105 views

Image in entry only showing when using entry.image instead of entry.assetFieldHandle

I discovered that I can replace: {% for asset in entry.assetFieldHandle %} {{ asset.url }} -- {{ asset.width }} -- {{ asset.height }} {% endfor %} From assetFieldHandle to the name of the handle ...
0
votes
1answer
224 views

Assets Content/Fields not available until entry is saved?

I've got Asset location setup with a Photo Caption field. And a Photo Gallery field which references said Asset. When creating a new entry, I'm uploading images to the Photo Gallery field. When the ...
1
vote
1answer
103 views

Posting an entry without using a form?

I'd like to create a history section so logged in users can see which pages they have visited. Is there a way to post an entry without using a form? So the user does not have to click to say he has ...
2
votes
1answer
1k views

Creating a related content subpage to a channel entry?

For a project I'm working on I have set up several channels that are related to each other. What the setup comes down to is the following: Channels: Projects |- News relations (news is a channel and ...
4
votes
2answers
729 views

Can an entry have multiple authors?

I'm trying to create a multi user blog, where multiple authors can edit the same entry. Is this possible with Craft CMS? Is there a way to assign multiple authors to an entry? I only managed to assign ...
3
votes
1answer
188 views

How do you pull a entry field in a global out in a template

I am trying to create an easy way to make a sticky post on my blog and I am using an entry field within a global. Not sure where to even start to pull this out in a template.
1
vote
1answer
258 views

What is the best way to have an entry for top-level categories?

I'm currently working on an eCommerce project with categories for products: - Category 1 - Sub-category 1 - Sub-category 2 - Sub-category 3 - Category 2 - Sub-category 1 - Sub-...
0
votes
0answers
120 views

Is it possible to access backend fields from my own field type?

I'm trying to access the value of an asset field in a backend entry form from my plugins own field type. At the moment it's looking like the following: public function prepValue($value) { $...
5
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 ...
0
votes
1answer
229 views

Output Entry Type and/ or Category

Total noob here. Have managed to output entries and paginate them with this: {% paginate craft.entries.section('woods').limit(5) as entries %} {% for entry in entries %} .... {% ...