IndieIndeed Posted July 3, 2017 Share Posted July 3, 2017 HTML templates can utilize $record but HTML blocks on the same page cannot? If that's correct, is there a proper solution to obtain the $record variable in a block on a database record page. Link to comment Share on other sites More sharing options...
xtech Posted July 3, 2017 Share Posted July 3, 2017 Yes, for some reason you cannot. I've came across this situation too.. Link to comment Share on other sites More sharing options...
TAMAN Posted July 3, 2017 Share Posted July 3, 2017 How could a custom html block know what is $record if you don't specify the variable yourself? Link to comment Share on other sites More sharing options...
xtech Posted July 3, 2017 Share Posted July 3, 2017 In pages record view template you have the $record variable. Link to comment Share on other sites More sharing options...
IndieIndeed Posted July 4, 2017 Author Share Posted July 4, 2017 1 hour ago, TAMAN said: How could a custom html block know what is $record if you don't specify the variable yourself? I thought blocks just held code that would get placed wherever I used {block="block_name"}. Some HTML Template Code [Injected Block HTML Code] The rest of that HTML Template Code Though that does not seem to be the case. Link to comment Share on other sites More sharing options...
opentype Posted July 4, 2017 Share Posted July 4, 2017 4 hours ago, IndieIndeed said: I thought blocks just held code that would get placed wherever I used {block="block_name"}. Exactly. But it is parsed by itself. It can’t know anything about code that happens to be placed outside that block later on. Link to comment Share on other sites More sharing options...
IndieIndeed Posted July 4, 2017 Author Share Posted July 4, 2017 1 hour ago, opentype said: Exactly. But it is parsed by itself. It can’t know anything about code that happens to be placed outside that block later on. Oh. I did not know that. Thank you. I will have to try and find a more convenient way of handling it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.