Member Offer
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I don't post in this part very often.

Discussion in 'Website Design Forum:' started by mrp2049, Feb 19, 2010.

  1. mrp2049

    mrp2049 Senior Member

    And there is a reason for that! Jaz, Glen, Andy etc, you all frighten me with your ability/knowledge of coding.

    I do however have a question, I tried googling it, but its rather difficult mostly because I don't know how to describe it!

    I am coding something for a friend and I am trying my best to learn how it all works, but I am struggling as there is a big mess of code and I want him to be able to edit certain sections of text, but also find them a little easier.

    now thats what I want it to say, but if I want to help him find it can I use the <-- or <!-- whichever one it is (if you know that would also help) so the code looks something like this

    with the text inside <!-- obviously not seen on screen.

    Is that correct?

    Sorry if this is real idiot grade stuff, I'm new at this.
  2. ralphsaunders

    ralphsaunders Senior Member

    Yeah. Thats a comment in HTML.
  3. Harry

    Harry Senior Member

    If he's editing the code in a text-editor, use server side comments so that they don't uglify your rendered markup.

    <? /* This is the space for your about me text */ ?>

    <div class="aboutme">


  4. Renniks

    Renniks Senior Member

    <!-- Fill this space with comments -->

    It has the exclamation mark, and indeed it is a comment which in alot of text editors will show up in different colours to help distinguish it, aswell as being able to make it stand out with asterix' or similar.
  5. Renniks

    Renniks Senior Member

    Why do normal HTML comments uglify rendered markup :) ?
  6. Harry

    Harry Senior Member

    If they're comments like that, there's no reason for them to appear in rendered source. They serve no purpose to anyone other than people who edit the original files. A comment like <!-- /wrapper --> serves some use to people viewing source, but <!-- Info about you goes here --> is extraneous and unnecessary.
  7. Renniks

    Renniks Senior Member

    Cheers, was under the impression you meant <! -- wrapper --> type comments also should go in <? /* */ ?>
  8. Renniks

    Renniks Senior Member

    Sooo to clarify

    If the comment you are making is directed at your friend or anyone just intended to see it in a text editor

    <? /* COMMENT GOES HERE */ ?>

    If the comment is more section headings etc. you can use that, or you can use

    <!-- COMMENT GOES HERE -->

    As that is visible in the online source code, aswell as in text editors.
  9. Harry

    Harry Senior Member

    Yeah, if the comment is an instruction of some info for a developer or someone who will be actively editing the code at its source, use a server side comment. (<? /* */ ?> being PHP).

    If the comment will be of use to anyone just browsing the rendered source then use a HTML comment.
  10. tbwcf

    tbwcf Active Member

    To make it even easier for your friend and save him having to phone you when he accidentally deletes a closing tag or something use one of these:

    Free and simple CMS CushyCMS (free version!)
    Perch - A really little content management system (CMS)

    Basically you don't have to set up a CMS and get all technical Simply the bits of your html you want to be editable give them a class of - class="cushycms" so you'd have <div class="aboutme cushycms">

    Then you pop your ftp info into your cushy (or pearch) account bobs your uncle fannies your aunt and you mate can log on and easily edit in a WYSIWYG editor.
  11. Sunburn

    Sunburn Active Member

    Really love perch, have brought it several times!
    very good solution.
  12. mike_watts

    mike_watts Member

    yep second Perch, dead easy to implement
  13. glenwheeler

    glenwheeler Senior Member

    Harry is using the best method I would say if its server side.

    However if your commenting a style sheet you can use the /* WHATEVER HERE */

    Comments are also used if you are testing a page. Instead od deleting code and losing it you can use the start and end comment commands to just comment out code. You can then remove them if needs be to make the code active again.
  14. mrp2049

    mrp2049 Senior Member

    Guys, wow! More than answered my question! Thank you all sooo very much!
  15. Renniks

    Renniks Senior Member

    That's why this section isn't scary. Much more clear cut answers most of the time ^_^ so many questions, but lots of answers
  16. Jazajay

    Jazajay Active Member

    Really I would go with <?php //CSS comment goes in here ?> TBH, and then get fancy with some coding and mod-rewrite.

    But yeah Harry's spot on, unless it is an Ebay template due to Ebay having shocking code and it not really any benefit for any reason.

    But the reason server side comments should be used, bare in mind the page in this example would need a .php extension or the server would need to be told to parse whatever extension is for PHP code otherwise all you will get is <?php //comment ?> outputted to the user as it would be parsed as HTML and not PHP, but the main reason is <!--comment --> adds bytes that have to be downloaded when they don't need to.

    But dude don't get worried about posting I, and I'm pretty sure everyone else on that list including all the others listed under etc..., value opinions I wont think any less of you for asking a question or getting it wrong. Everyone learns that way, including me from time to time. ;)
  17. mrp2049

    mrp2049 Senior Member

    I am totally blown away by everyones response! And it has been muchly appreciated!

    I will be back to hound you coding nerds soon enough!

Share This Page