Smarty debug console in Jamroom - debugging

I have actually a problem in a skin i'm doing in jamroom.
The problem is that i want to use the {debug} to open the smarty debug console page where i see the template variables, but when i use that command it doesn't open that page and all the info is shown in the same page of the template that calls this function.
Does anyone knows what could be wrong?

My reputation is too low to 'add a comment', so commenting here.
I've seen this happen sometimes when the code for the {debug} comes out in the section. (as in the case of using the meta.tpl templates in jamroom ).
Try it in a different template, or copy the html code of the debug output to its own html file to view it. Not the best solution, but works to find the variable your after.

Related

Lazy load CKEditor 4

Currently finding issue lazy loading CKEditor 4, appreciate any advice. What I tried:
Including ckeditor_basic.js but this already needs a CKEDITOR
instance
Loading ckeditor.js on click but this complains
'Synchronous XMLHttpRequest on the main thread is deprecated because
of its detrimental effects to the end user's experience.' as well as
some others errors, fails badly.
Any advice appreciated!
If you would like to insert CKEditor script dynamically you can use technique from this code pen - https://codepen.io/j_swiderski/pen/qPGRGb. It is important to wait for ckeditor.js to load before creating editor instance thus using setInterval to check if CKEDITOR object is available seems like a good idea.
In your comments you have written, you don't want editor to load every time you load the page. One of the reasons for that might be the size of ckeditor.js file.
If you think editor.js is too big it is important to answer yourself how much plugins you really need and then create editor accordingly to your needs using the online builder. Please have a look at below samples using dev-tools and notice the difference in ckeditor.js size: Full package has 600KB while Basic Package has only 400KB. If you just need the basic formatting then your ckeditor.js could get even smaller and should not be a problem when loading the page.
If you have created some custom plugins then recommended practice is to get CKEditor source code from Githhub, fork it, make changes/add custom plugins, build your editor. That way you will get minified and obfuscated editor instance which includes your custom plugins and again should not be a problem when loading the page.

docpad: getting info on what exactly did got wrong

Docpad is throwing warnings at me all the time:
warning: Something went wrong while rendering: ...
I would love to know some more about what exactly went wrong. Are there any settings that I can tweak to make the output more helpful? In this particular case, the template is an ecofile.
I have tried the -d option, but can't see that it helps.
I would love a special debug mode, where each layout, document, partial etc are rendered inside a border with the name of the file rendered. If the variables available inside the file could be serialized and shown in a popup or something, I would be thrilled. :-)
That special mode sounds a lot like what TraceGL will soon be able to offer. TraceGL seems amazing, but I can't seem to get it to work with DocPad yet.
For the meantime, do the debugging instructions on the DocPad Website help at all?

Javascript location in Magento

Im trying to locate certain javascript code in the codebase with no luck. This code appears in the head of every page. Note that it isnt a link to a file but certain code embedded in the head. I have tried the following ways but no luck
local.xml
head.phtml
page.phtml and all page templates
page.xml
Text search in codebase with keyword and
keyword '{variablename}'
Database search keyword '{variablename}'
but no results so far
Have a missed something? Any help would be really appreciated.
Thanks,
Loveleen
Assuming that the page templates still generally reflect the native Magento structure, if it's in the <head> of the page, then it can only be coming from one of three places:
The page template (1column.phtml, 3columns.phtml, etc.).
The <head> include file head.phtml.
An include of one of the first two.
I know you said you already looked in both of those places, but you can help narrow down the source by comparing what you can see in those locations with what you see in the generated page source. Is the analytics code you're trying to locate before or after something you can see in those template files?
Also make sure that you're looking in the template files of the correct theme.
Ok got it.. it was under System>Config>Design>Misc Scripts

Unable to view content script references in the developer tools window

When I view my extension with the developer tools, I only see the generated background file, background.js; my content script doesn't appear under the content scripts tab. Any ideas why? The relevant part of the manifest looks like this:
"content_scripts": [{
"run_at": "document_end",
"js": ["postMsg.js"],
"matches": ["https://groups.google.com/forum/*"]
}],
postMsg.js gets injected into the page, but never appears in the developer tool window, so I'm unable to debug it.
As long as you are on a page that matches the "Match patterns and globs" from your manifest, you will see the content script(s) under the Sources -> Content Scripts pane.
You may need to refresh (F5) the page (and/or your extension, then the page) to see it:
(Click for larger image)
For more information on matching that cryptic number to an extension, see this answer.
content scripts as a js file are never exposed by pages which are injected.. If your intention is debugging of content scripts it can be possible;
Ex:
mycontentscripts.js
var getStyleofbody = document.getElementsByTagName('body')[0].style;
to debug this i would first run this code in console of page that i am going to inject; After i get expected results i will move code to contentscript js file.
However for any errors after injection you can look at developer's console panel for all errors(they are listed there).
Let me know if you are confused
In 2018, if for some reason you've missed it:
Press the >>. From there select content scripts, and you'll be able to see the content scripts.
hf :)

What is the best way to debug Typoscript in TYPO3 CMS?

What is the best way to debug typoscript in the TYPO3 CMS?
Assuming I have a list, which is not displayed -
what is the strategy to look for the issue?
Debugging Typoscript is not the most comfortable task, but there are several possibilities. Here are the most common techniques:
Use the TS Object Browser in the backend: Choose the Web > Template module, then pick the page from the pagetree you need to debug. If there are any obvious syntax errors or redundant/missing brackets, an error message will be displayed. Switch between constants and setup and use the search field extensively. In your example, search for the myListview parameter if your TypoScript object is named myListview.
Use the Template Analyzer in the backend (also in Template module): It's similar to the Object Browser, but the Template Analyzer gives you valuable insights where in your setup the errors (or warnings) exactly are that have been spotted.
Outsource your Typoscript setup (+ constants) to files, then use a syntax highlighter in your favorite text editor. You get a better overview and the highlighting helps to avoid misspellings. For example:
PhpStorm TypoScript plugin (recommended combo)
Netbeans TypoScript plugin
Eclipse / Aptana: DEV3
Coda: ts4c
Textmate: Textmate Typoscript bundle
PSPad: sweeTS
jEdit: jEdit plugin
Sublime Text: Textmate Typoscript bundle
Activate the admin panel in the frontend and use the section "TypoScript". It shows you selected rendered (config) values, SQL queries, error messages and more. However, it's not complete and I'm not using it frequently so I am also keen on knowing more about it.
Wrap your Typoscript objects with the stdWrap.debugFunc Function or use the build-in debugItemConf method for all MENU objects. Debug output will be seen in the frontend. Read more in the TYPO3 Wiki
Most common errors (apart from typos) are wrong file paths, non-existing HTML-templates or missing subparts in modified templates. Also, forgetting to include static templates for an extension might leave the intermediate user puzzled. Just as a starting point :).
Hope that helps, please post any additions into the comments.
The most important thing is, not to rely on code you found via google. Have a look into TSref and check what is possible.
Just some little additions which are easy to overlook (IMHO):
The template analyser has an option: "View the complete TS Listing", so can search in the whole created typoscript! Including conditions.
TS Object Browser: you can check conditions to simulate different situations
If you need to debug TypoScript configuration in the backend, go to the "Info"-Modul, select a page in the page tree and then select "Page TSconfig" in the main window. There you will get a info about Page TS Config.
These system extensions are usually installed, but they can be deactivated:
tstemplate
tstemplate_ceditor
tstemplate_info
tstemplate_objbrowser
tstemplate_analyzer
info_pagetsconfig (info modul)
tsconfig_help (addition to the info modul)
It may happen, that someone else just deactivated them.
SIMPLE: use headerData in typoscript and view source code by this you can debug typoscript.

Resources