To give a little context, I am working with BigCommerce theme template files right now, and I do not understand some of the syntax.
They use a double percentage sign to wrap certain things in the document. An example:
<!-- Include visitor tracking code (if any) -->
%%GLOBAL_TrackingCode%%
%%GLOBAL_DesignModeStyleSheet%%
%%GLOBAL_HeaderImageStyle%%
They will also be included in source attributes sometimes, like this:
<script type="text/javascript" src="%%GLOBAL_TPL_PATH%%/js/imagesLoaded.js"></script>
I can't for the life of me figure out what the %% means.
Hopefully that will give enough info to answer the question, if anything else is needed let me know. If this is not a JavaScript thing like I assumed, feel free to move it to the appropriate category.
Thank you in advance!
It appears to be a templating tool, that the people who made the template would change according to what they want to put in there.
This is not JavaScript, it's clearly a templating language's marker for variables.
Related
I was wondering whether there is any way to "partially" include an external resource in HTML/CSS.
I got this idea when I tried to include Materialze.css in my project and I already had Bootstrap included. Materiliaze messed up my navigation bar as there were certain classes that shared their name between these two frameworks. The thing is I don't want to give up on any of them so I was curious if there is an actual way to only include one of them when is is needed.
Use the #import to import fonts from the internet to css.
If you want to include scripts and stylesheets from files, use <style src="materialize.css"><style> or <script src="hey.js"></script>
P.s. I hope could answer your question, please explain what partial is in detail, cause i didnt understand what "partial" is? THank you
So i am working on a Math website for School. Now, I'm creating a button where its gonna check whats the value in a textbox i just made. And in the script it would check if it was the answer which id Write in the code myself, and the once its pressed, a message-box comes up, saying "Wrong!" or "Correct!". How would i do this? Dont mind the part of it being Norwegian though.
http://pastebin.com/VB7YvrEK
To add to Niet's comment, the = in if(val = 2) is an assignment operator. You want a comparison operator. Have a look at MDN's guide to Expressions and Operators.
This question is far too general. You need to read some articles or books on the basics, i.e. HTML, CSS, and Javascript, or take some interactive lessons online, e.g. on Codecademy. You can't expect someone to create an entire website for you and post it here.
I agree. Most likely you would have to look for tutorials on how to do this. It's general. Since you're writing that part of your code in javascript, look up javascript tutorials to help guide you.
As far as I can see, a piece of code like:
/ This is a comment that will never get displayed, even in the source code
Will never be seen, and so seems to have no use? Why would a person ever use it when there is
/! This is a comment that will only get displayed in the source code
Which will comment the code when it is compiled to HTML.
Is there something that I am not getting? Why would anyone make an invisible comment?
I think you mean /! - you had them the other way around in your example.
/! produces an HTML comment
/ produces a comment in the code which doesn't compile to HTML
Sometimes you want to published your comments so the outside world can see them. Code copyright, attribution or legal notices would be a good example of comments you want everyone to see when this compiles to HTML.
Code comments stay in your slim templates so will only be visible by people working with the template. Since comments are usually there to help developers and people working with the code rather than the general public, it makes sense to not compile most of this stuff into HTML. So "invisible" comments are actually visible to the people that need to see them.
The "invisible" comment will be seen by the coder reading the slim template, so it can be useful for a future coder to understand why you did something. This comment won't be seen by anyone checking the generated html source code once the page is online.
The other type of comment will also add html comments, so thru will be visible online.
I'm an old hand on programming but a wet-behind-the-ears newbie on webprogramming. I ran in to this in a project and I need help identifying the technique/language used.
It is some sort of dynamic web-page that fetches information from a database and displays it in a table. In the html-page that is used these tags are
<!-- some text that has to be some form of commands -->
What is it called? It is impossible to google either the starting tag or the closing tag :/
I know that it somehow uses a c-program to do the actual fetching of the data, but i'm at a loss how it actually works.
What I need is the name so I know what to look for in the form of online resources to learn this and I do hope that this kind of tag-usage is only used by one type of language/technique :)
thanks in advance from archie!
Those tags are just html comments. It's possible that they're being used in a template file, and a server-side scripting language is doing some kind of search/replace to execute commands on the template. If so, it's impossible to say what language it is.
This looks like an HTML comment
http://www.w3schools.com/tags/tag_comment.asp
lessthan-bang-dash-dash is a comment, which closes at dash-dash-greaterthan.
Its a HTML comment, if you need further information http://www.w3schools.com/tags/tag_comment.asp
;)
The tags you posted in code are Comment Tags. They are for adding non-functional comments to code to help readers understand what is being done in the code.
sorry for this ultimately newb question. I want to create a menu and not have to repeat the code of the menu on every single web page. I have done this with iframes in the past, but I know they aren't recommended. I have a pretty decent knowledge of HTML & CSS but I feel like I am missing something big here.
I am also not looking for the PHP solution which I believe is represented by:
<?php include("navigation.html"); ?>
Is there a good tutorial I can follow? I've heard this can be done with XML but I haven't been able to find what I am looking for exactly, and don't have any knowledge with it in the past.
In what I think is a related problem, I want to be able to place my google analytics code on just my index page and have it reference the entire website of pages, not just the index. Again, what am I missing here? Do I need to be using a content management system of some sort to pull off this slightly dynamic task? I don't think so...
Thanks for your help and please let me know if I can clarify my question any better!
Why don't you want to use PHP? It can be done with JavaScript (using AJAX), but you need to provide search engines with a way to crawl your site if you go that route.
Using includes in PHP to achieve this is simple and requires extremely little knowledge. Much easier and more efficient than doing it with JS. Also, I don't see how XML would be of any help here unless you read it in with JS (in which you'd have the same issue mentioned above.)
Use server side includes as mentioned already. They are support by pretty much all major webservers so php is not even required.
Check out the following articles:
http://en.wikipedia.org/wiki/Server_Side_Includes
http://httpd.apache.org/docs/1.3/howto/ssi.html (from apache, note no php needed)
http://www.boutell.com/newfaq/creating/include.html
Good Luck
I'm not really sure what options you have other than a .php include. I'm not sure of why you would be avoiding PHP unless the server didn't support it, as it's very simple to do an include (you really don't even need to know PHP to do this except for the include statement).
For your analytics code, you could put this in a .js file and just include it on every page:
<script type="text/javascript" src="analytics.js"></script>
Hope this was at least slightly helpful.
How about javascript? You could write a Javascript file that is included on each page that you wish to display the menu. The javascript could read an XML that contains your menu items and generates HTML to display the menu.
Parse and XML document with JS
http://www.w3schools.com/Xml/xml_parser.asp
jQuery menu solutions
http://speckyboy.com/2010/12/01/15-super-simple-jquery-menu-and-navigation-plugins/