| Author |
Message |
ourbetterworldnow2038

Joined: 29 Oct 2008
Posts: 22
|
Posted: Nov 14, 2008 03:33pm Post subject: the proper way to comment out QuickCode Tags? |
|
|
In working with the design templates, I would often comment out the QCTs with html comment tags:
But I just realized that the QCT may also have html comment tags embedded in it which may affect it and the page would not be dipslayed properly.
Is there a recommended/official way to comment out QCTs, custom or otherwise?
Thanks! |
|
bavery261

Modular Merchant: Development
Joined: 08 Oct 2008
Posts: 7
|
Posted: Dec 01, 2008 10:55am Post subject: The proper way to comment out QuickCode Tags? |
|
|
To answer this question, Comments, by their very nature, do not affect the code in any way. Comments will not output to the browser window nor will they execute a command; the only purpose of comments in programming languages is to make the code more readable to the developer or to future developers who might look at the code later on. If there are any comments in the QuickCode Tags, they will not affect the code in any way. Here are the two most commonly used PHP commenting tags.
| Code: | //Custom Comment here
/*Custom Comment here*/ |
An example of how commenting a QuickCode tag would be:
| Code: | /*This QuickCode Tag displays the Email Field*/
{FIELD-EMAIL} |
I hope this information was helpful. If you have any further questions, please let us know. |
|
ourbetterworldnow2038

Joined: 29 Oct 2008
Posts: 22
|
Posted: Dec 01, 2008 12:30pm Post subject: |
|
|
how would you comment OUT a QCT you don't wish to use at this time.
For example, I am currently doing it like this:
but I am presuming that if "custom-42" also has HTML comment tags, that it may not work properly.
Per your recent comment, can I then comment it out like:
| Code: |
/* Comment Tag A
{CUSTOM-42}
{CUSTOM-43}
{CUSTOM-44}
*/
|
But what happens if CUSTOM-42 has comments within it so let's say {CUSTOM-42} =
| Code: |
<Comment>
Hello World
/* Comment Tag 2: Here is another comment */
Hello World Again
<p>What happens to these comment tags?
|
I have yet to try this, but just wanted to see if this would work. I am thinking that the open comment tag A will inadvertently be closed by the close comment tag of Comment Tag 2, which would result in displaying the remainder of {CUSTOM-42} which is not the intent of commenting out the entire QCT.
Thanks! |
|
bavery261

Modular Merchant: Development
Joined: 08 Oct 2008
Posts: 7
|
Posted: Dec 01, 2008 02:41pm Post subject: The proper way to comment out QuickCode Tags? |
|
|
To answer your question, in this example the comments tag(s) would appear something like this within the Custom QuickCode Tag area.
HTML Comments
| Code: |
<!--Comment -->
Hello World
<!--Comment Tag 2: Here is another Comment-->
Hello World again
<p>What happens to these comment tags?</p>
|
PHP Comments
| Code: |
<?php
/*Comment*/
echo ‘Hello World’;
/*Comment Tag 2: Here is another Comment*/
echo ‘<p>What happens to these comment tags?</p>’;
?>
|
Note: if the comments are not to be within PHP tags <?php ?> it is recommended to use HTML comment tags such as are used in the example below.
| Code: |
/* Comment Tag A
{CUSTOM-42}
{CUSTOM-43}
{CUSTOM-44}
*/
|
This example would only work as a true comment, meaning the actual code within the comment tags would not be treated as live code and ignored, if it was within PHP tags. If no PHP tags are present, this is not PHP code and the code within the comments tags will be treated as live code.
The following example would be used if no PHP tags are present.
| Code: |
<!--Comment Tag A
{CUSTOM-42}
{CUSTOM-43}
{CUSTOM-44}
-->
|
I hope this information was helpful. If you have any further questions, please let us know. |
|
|