Skip to main content

Timeline for How can I get entry id in field

Current License: CC BY-SA 4.0

8 events
when toggle format what by license comment
Jun 8, 2018 at 0:26 vote accept yu xia
Jun 11, 2018 at 1:19
Jun 7, 2018 at 3:11 comment added yu xia @BenParizek You are absolutely right! I can get element via getInputHtml. But I have to rewrite the template in this function which is gonna take too much effort
Jun 6, 2018 at 23:23 comment added yu xia @BenParizek Thanks for your code. But I don't understand what the getInputHtml do. Maybe I didn't make myself clear. Basically there are two Asset field types: A and B. Let's say a user selected three images to A, Ctrl+s to save and then he can only select these three images to B. The field B is what I want to create. afterElementSave has the limit which is users have to save to trigger this function.
Jun 6, 2018 at 13:35 comment added Ben Parizek I've updated my answer to include the getInputHtml method Robin mentions as well.
Jun 6, 2018 at 13:35 history edited Ben Parizek CC BY-SA 4.0
added 525 characters in body
Jun 5, 2018 at 4:50 comment added Robin Schambach @yuxia then the getInputHtml docs.craftcms.com/api/v3/… might be something for you.
Jun 5, 2018 at 3:15 comment added yu xia Thanks! But I hope I can get the entry id after I open the entry editing page in CP. So this function is not for me.
Jun 5, 2018 at 2:53 history answered Ben Parizek CC BY-SA 4.0