Is there a way to open a node using colorbox node in an iframe? the module seems to ignore "iframe=true"
Here's my reason for asking:
I'm using colorbox node and everything is working as expected BUT I've added a feature to my site that allows certain nodes to be assigned a custom style by the author. In node.tpl.php file I use drupal_add_css to append the appropriate stylesheet when the setting is present. Unfortunately, the styles remain in effect after the colorbox window is closed and are liable to change the appearance of the next node displayed. I believe opening the nodes in an iframe would solve the problem. I could fix the problem by building a custom page template and skipping colorbox node, but I like the module and it works well for me.
Comments
Comment #1
woodhome commentedComment #2
iLLin commentedTry this instead. Load your style sheet into the top of the node, via a drupal_alter hook.
I provide the ability to do that. Then when you load a new node, those styles should be removed and new ones loaded. Maybe? I don't use iframes currently, but maybe I can add in that functionality. Haven't looked into it as I don't like them ;)
Comment #3
iLLin commentedActually here is a better method.
Use whatever value you are using on your NODE that says, use this style or use that style. Then preprocess the node and add a class to the classes array for output in your template. Then u can target each node respectively based on that class. Then you can load all the styles on page load and it will render differently based on that class. That's probably a better method :)
Comment #4
woodhome commentedGood suggestion. I'll give it a shot.
Comment #5
woodhome commentedThanks for the suggestion, I implemented the second, though the first still holds some appeal. I added a class to the to the outermost wrapper, then included it in the stylesheets. The one drawback being that I wanted to avoid having to do anything special in the stylesheets since I'd like people other than myself to be able to produce them, and the extra class make it a little less simple and bullet-proof. Works for now though. Thanks
Comment #6
iLLin commentedWhat do you mean add it themselves? You should be able to dynamically add it. I would setup a dropdown menu that says, Template 1, Template 2... etc. Then you could hook into the node form, add an image to show them which is which and then modify your node.--contenttype.tpl.php file to change the class dynamically so its very easy on the end user.