Matt Summers Posted December 9, 2019 Share Posted December 9, 2019 I'm having a really frustrating experience with this "CSS selector" feature. I'm simply trying to disable the "Show results" button in polls. I can successfully control other elements of the poll's rendering, but anything "deep" doesn't seem to be targetable. I've tried the built in picker. I've tried manual selectors. I've verified in a browser that they select one and only one correct element. It simply doesn't do anything. What am I not understanding? Example #1: Replacing the entire pollcontents works div.ipsPad.ipsClearfix[data-role='pollContents'] Correct: Example #2: div.ipsPad.ipsClearfix[data-role='pollContents'] ol.ipsList_reset.cPollList Doesn't do anything. I can confirm this selector works in jQuery and picks the correct item. Example #3: a[data-action=viewResults] Targeting the button directly with a super simple selector doesn't work either Example #4: Targeting just a simple h2 works I am absolutely baffled. Can anyone give me a push in the right direction? Thanks Link to comment Share on other sites More sharing options...
Matt Summers Posted December 10, 2019 Author Share Posted December 10, 2019 As is typical with these sorts of problems, I figured it out shortly after throwing in the towel and posting about it. Just as I was about to close down for the evening, I noticed that form.phtml calls another template to render the <form> version of the poll. The 'pollForm' template is where that particular button actually existed. {$pollForm->customTemplate( array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' ), 'pollForm' ), $url, $poll )|raw} And sure enough, changing my plugin to hook both poll and pollform worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.