Questions tagged [entry]

The tag has no usage guidance.

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

Does anyone have a working example of frontend form with multiple file upload, drag & drop etc?

I'm trying to create a frontend entry form for a logged in user, with a field to upload multiple assets to that entry. I've tried using the Jquery FileUpload plugin, but can't seem to get that working....
15
votes
1answer
11k views

Get the current section handle

I can't help but think this is a silly/obvious question, but I'm trying to retrieve the current section handle so I can use it as a class. Maybe I'm going about it wrong, but {{ handle }} does ...
10
votes
1answer
2k views

How do you delete assets from a frontend form?

I am creating a proof of concept for a client in Craft where the client's customers can manage projects from the frontend of a Craft install. I have a frontend form working correctly for creating a ...
7
votes
1answer
2k views

How do you delete entries from a frontend form?

Part 2 of a 3 part question: I am creating a proof of concept for a client in Craft where the client's customers can manage projects from the frontend of a Craft install. I have a frontend form ...
6
votes
4answers
3k views

Programmatically update entry field

I'm trying to update an entry's field value from a Craft plugin. First I was trying to just update the attributes of the entry like so: $entry->getContent()->setAttributes(array( 'metaStatus' ...
3
votes
1answer
637 views

How can I get the requested entry from a plugin?

If I’m accessing an entry’s URL (the 4th check in Routing), how can I get the entry that the URL matched from a plugin?
4
votes
1answer
470 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 - (/...
2
votes
3answers
2k views

Custom HTML in Rich Text Fields

I've noticed the HTML option above Rich Text Fields for entries is now gone in Craft 2.5, regardless of being configured as Default, Simple, or Standard. Is this a feature that has been removed from ...
1
vote
1answer
2k views

How to save a new entry with custom fields - Craft 3

I'm trying to create a new Entry via PHP, with custom fields (Craft 3). I can save it, however my custom fields don't appear. I've tried using setFieldValue, as well as $entry->excerpt = 'Lorem...';...
1
vote
2answers
2k views

Set status in a plugin

I was wondering if it's possible to modify the status of an Entry within a plugin? I've tried setting the status property but I get a readonly error. $entry->status = $status
9
votes
2answers
2k views

Exclude multiple entries by their IDs

I have a structure people that I need to grab entries from. However, I need to exclude certain entries as some are already displayed on the page in a different manner. I know that you can exclude a ...
5
votes
1answer
352 views

How do I allow a user to remove an uploaded asset from a front-end entry form?

I see for users, I can add a hidden field <input type="hidden" name="deleteUserPhoto" value="1" /> to remove the uploaded photo, however I need to allow this functionality for an assets field in ...
5
votes
3answers
2k views

How do I get Matrix elements to copy their content across language Locales?

I returned to a site designed months ago, and added a second language to it. From the beginning, this site had prominent composition of entries out of multiple elements in their matrix, with ...
6
votes
1answer
328 views

Is it possible to use the assets modal on the front end?

Part 3 of a 3 part question: I am creating a proof of concept for a client in Craft where the client's customers can manage projects from the frontend of a Craft install. A missing piece to the ...
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 ...
5
votes
1answer
975 views

Save matrix block to new entry in plugin

I have been trying two separate methods to accomplish and both keep resulting in the same errors no matter what I try. The entry I am saving has a few fields the last of which is a matrix block (I am ...
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
382 views

Possible to redirect elsewhere after saving an entry?

I'm editing an entry in the CP... mysite.com/admin/entries/mySection/33-my-awesome-entry Now when I save this entry, it will redirect me back to the entry index page. However, I'd like to override ...
2
votes
2answers
2k views

How to filter entries based on Tags

I am working on a site that requires a filter option based on tags. Each entry will have two sets of tags (e.g., colors and shapes) {% for tag in craft.tags.group('colorTag') %} {% for tag in craft....
2
votes
1answer
125 views

Checking for first time an entry is “published” i.e. saved with a Live status

Is there a way, via an Event or otherwise, to catch the first time a post is saved and isn't in disabled mode? I want to send out an email alert to users when a new entry is published, but I want it ...
2
votes
2answers
1k views

What's the best way to link to an entry in a template?

I have the following code and I'm looking for the best way to link to another entry page. <a href="#" class="btn-quote">request a quote</a> I tried something like this with no luck: <...
0
votes
1answer
693 views

How can I copy an entry?

How can I create a plugin that will let me copy entry? I found this question but don't have a good answer.
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, ...
7
votes
2answers
752 views

Get entry index - structure not channel

I want to display the current entry's index - like in this post Get entry index. However my entries are in a structure section type not a channel, so they are not ordered by date. Is is possible to ...
3
votes
1answer
407 views

Title field character length

Is it possible to limit the title field in an entry? As with other fields I can adjust so that it only takes a certain amount of characters.
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
0answers
505 views

Updating a single custom field within an Entry

I've got the beginnings of a simple plugin to track views of an article page, just an entry with custom fields including 'dataViews' used below. Within Twig: {% do craft.demoPlugin.incrementView(...
2
votes
1answer
63 views

How to get entries with or

it is possible to do like this: $users = Entry::find() ->userLevel('>3') ->or group('admin') So in database level,the sql will go like this: select * from users where users.userLevel ...
1
vote
1answer
64 views

orderBy title, but remove the word “The” from titles

If I have a huge list of TV shows and Movies, many of them have "The" in the title, meaning they all get grouped together if you order by title. Is it possible to "filter out" a ...
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 ...
1
vote
2answers
191 views

Targeting entries in a structure

In a structure like the following: Offices US Albuquerque [offices] Boston Chicago Denver ...
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
3answers
845 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 ...
1
vote
1answer
134 views

Handling Endless Recursion in saveEntry?

I'm trying to update the expiry field—based on an existing field (in this case classDate)—as soon as an entry is saved. Based on this answer, the clever recursion code in carlcs' Auto Expire plugin, ...
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.
1
vote
1answer
217 views

craft.request.getParam('entryId') returns null on edit page of an entry

I have a plugin that's loaded on the edit page of an entry. Whenever I open the entry edit page, I would like to retrieve the id of this particular entry. I've tried this: {% set someId = craft....
0
votes
2answers
993 views

Entry field not outputting after {% set… %} code in template

I have an {entry.footer} field outputting just fine everywhere before {% set entry... %} Added {% endset %} tags after closing anchor tag and caused an error. Any idea what the issue is? {% extends "...
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 ...