changing cakephp debug() html - debugging

The CakePHP framework executes the debug function by placing HTML on the view layer. I have implemented a new CSS but the HTML from the debug doesn't work so well with the CSS.
How can I change cake's default HTML to export customer HTML when the debug is executed?

You can't, just look at the source code, it's all hard coded.
https://github.com/cakephp/cakephp/blob/2.5.2/lib/Cake/basics.php#L73
https://github.com/cakephp/cakephp/blob/1.3.19/cake/basics.php#L126
So either adapt your CSS, or create your own debug function with custom HTML output.

Related

can we create pop-up windows using Freemarker Template Language (FTL)?

can we create pop-up windows using Freemarker Template Language (FTL)?
If so, please point to any resources to check out...
FreeMarker runs on the server to generate the page that contains HTML and possibly JavaScript, then the JavaScript runs in the browser. So with JavaScript you can, just as on any HTML page.

Get particular layout javascript and css

Currently I am trying to get the "checkout_onepage_index" layout css and javascript in another page. How Can i get the javascript and css in a controller or observer. I want to get all the css and javascript that was loaded in checkout_onepage_index layout.
I don't know much using observer but you can defiantly do this using xml just copu your checkout.xml js code and paste it into another file of xml like "catalog.xml".

AJAX: Django's templates flexibility gone? Update CSS & JS?

Leaving all the header/footer/nav parts of pages untouched,
refreshing only page's content with AJAX,
can't use base template extension's block mechanism to set content-corresponding styles, scripts, page title?
Wonder how to get .css and .js for updated content with AJAX?
In general, you will want to make all of your CSS and JS available in the header templates so that they are available when your dynamic content is loaded. The overhead is slight, and you will be following the "Django way."
Another option is to include inline CSS/JS in your dynamic content, but this approach is not recommended. It leads to messy code and can be difficult to troubleshoot.
Can't use full sentences?
Anyway, I have no idea why you think you need to get CSS and JS for partial pages. A set of HTML elements dynamically inserted via Ajax will simply use the existing CSS associated with the page.

How to Supply a Dynamically Built MVC3 MasterPage

I need to use a static html page as an MVC3 razor masterpage.
It needs to be able to inject the controller's razor-built view into a specified span tag on the static html page.
How do i go about:
Load the static html
Parse the static html string to the point where i need to inject the razor-view
Inject the razor view.
Here's the reason why-- a client of ours wants to be able to publish static html (daily) from their CMS and have the application pick up on the "template" and use it for they dynamic sections of their site. They do not have any understanding of .NET and MVC3 and I can not have them interacting in any way with .NET and such.
Any ideas?
Thanks.
Assuming you only need to inject your view into one part of the HTML, you can chop the HTML into "before" and "after" pieces. Create a Layout.cshtml that has "before", "middle", and "after" sections. before & after are the parts you parsed from the .html, and middle is the result from your Razor view.
Static pages aren't executed by the server, so if the requirement is to import a dynamic page into a static page, your best bet will be to use an iframe or javascript to place the generated html from the mvc3 site on the page.
You can do this using jQuery pretty easily:
$(function() {
$("#ContentFromMVCSite").load("http://mysite.com/url/to/mvc/view");
});
<div id="ContentFromMVCSite"></div>
This code will download the html output from the mvc site and place it inside the div. For more information see the documentation.

Load html without refresh

Im unsure of how to approach this, should I have the html to be loaded hidden or load it from somewhere? I want to load a form in one page, and dynamic content on other pages.
The form can be saved to mongo db, and when the page loads should load the data into that form from mongo db.
Where does the html live for all the pages? I want to have a clean html5 document with lets say a content div. all content goes into that block.
Server running Django
Im want to use backbone.js for the app
any help would be appreciated
The initial page should include the basic layout of the application (header, content, sidebar, different placeholder for your views, etc.)
Then you load the application (usually with a controller) and render the different view that will replace the placeholders you had in your layout.
To render the views, I suggest to use a templating engine. With backbone.js there is already underscore.js on the page, so you can use the templating engine included (http://documentcloud.github.com/underscore/#template). You then have to load the template on the page. The easiest way is to create include a script element on the page with your template inside:
<script type="text/template" name="template1">
your template here...
</script>
And you can load it using this:
var template = _.template( jQuery("script[name=template1]").text() )
and execute with your data
var html = template(model)
You build your page with different backbone views using different template.
I hope that help!

Resources