0

Does anyone know, if there is any work-around or regular setup for panels or custom code known, to be able to use a url/node/%id or node menu-callback to render node/entity content delivered without the rendered page wrapping (<html> <header>,etc)?

I am not asking for Panels_everywhere behavior nor for Drupal modules like Colorbox, Lightbox, and all the others, nor Colorbox_node popup and such. I only try to have the node/entity callback url at hand to render entity or node content without any page.tpl.php or html.tpl.php involved, to use it somewhere else like for bootstrap modal, node_panels rendered into modals, or for custom scenarios to get most flexibility.

I took a look into Ctools module suite's modal callback and Entity_popup but the lack of documentation (no offense) and the confusion in my mind lead me to here asking for some breadcrumbs and ideas.

Thanks for any help on this.

2

After some research I maybe found an answer by myself for this question, not sure yet. Maybe temporary or at first glance only.

While I embrace user5482's (Thanks for your fast reply!) approach using hook_menu() in a custom module, what I have considered already, I still have 2 worries. First: there is missing experience on my side and missing documentation on the functions side for its underrated delivery argument (take a look here). Second: Custom modules should only be considered for very rare individual situations, otherwise you fastly run into 10 custom modules on a project which need to be maintained on core updates. If the scenario what you are looking for is more common, the chance is 99%, that there is a module for that.

So, at first, I will try to achieve this with the JQuery_Ajax_Load module, which actually builds on the mentioned hook_menu() and I will report back when I have any news on this.

  • SInce this work-around def. works, I shamelessly mark my own anwer since this is the fastest way to reach the goal. – nilsun Apr 21 '16 at 18:21
1

You can definitely do this with the hook_menu() function. It'd look almost exactly like the tutorials you'll see out there for an AJAX request using hook_menu()

hook_menu() lets you create your own URL that can access any Drupal or custom function, including making something that just spits out the info you want.

  • Hi. Wow. :) Thanks for your fast reply, user5482! Would you mind to elaborate a little bit more on this? Because most of what I think you maybe talk about need a custom or separate module, which will provide this on a level where it is too late for my approach, is isn't it?. Not a problem. But I am not sure if I will finally have this callback at hand, for example: for context or selection rules to render the node into a node_panel before the modal comes into play, just for an example. But maybe I am wrong ... – nilsun Feb 25 '15 at 14:48
  • 1
    You can use it in a custom module without an issue. If you're looking at loading the content in to a bootstrap modal you can do it actually using AJAX and fill your modal with the response. – user5482 Feb 25 '15 at 14:50
  • 1
    Thank you user5482 for your help, but I would like to achieve a stackexchange like how-to for others finding this issue. Hopefully we can finally provide a more clear an detailed answer. I've posted another module link and a link to a how-to on Drupal.org in another answer below. – nilsun Feb 25 '15 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.