Skip to content

Request for entryType data attribute in Control Panel entry edit view #12114

Answered by watershed
watershed asked this question in Ideas
Discussion options

You must be logged in to vote

Actually, using Control Panel JS gets the job done just fine, so maybe this request is redundant.

Here is what I did to create the hook I needed:

const savedEntryType = document.querySelector('#entryType option[selected]') || null;

if ( savedEntryType ) {
    const eType = savedEntryType.textContent;
    document.querySelector('#main-form').setAttribute('data-saved-entry-type', eType);
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@brandonkelly
Comment options

@watershed
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants