Results 1 to 7 of 7

Thread: Hide item labels in frontend?

  1. #1

    Default Hide item labels in frontend?

    Hi all, I'm new to Typolight and to the forum. I hope someone can give me a hand.
    I've created my first product catalog, set the items and added two sample products.
    I check the items list and the details page and everything works good.

    But for before every field value appears the field name such as:
    product_name: Product 1
    type: Lamp
    Description: blah blah blah...

    Instead I would like to have
    Product 1
    Lamp
    blah blah blah...

    I read the three tutorials about catalog module but I still can't figure out how to make it. Please can anyone help me?

  2. #2
    User
    Join Date
    06-20-09.
    Posts
    63

    Default Re: Hide item labels in frontend?

    You'll have to customize the template to your liking.

  3. #3
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: Hide item labels in frontend?

    Have you seen this particular one yet?
    http://code.google.com/p/typolight-cata ... esTutorial

    Basically it involves creating your own template file and changing it to show only what you want.

    The trickiest part is knowing how to plug in your catalog data, but the above link takes you through all of it.
    Brian

  4. #4
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Hide item labels in frontend?

    How about hiding them using css?

    This works for the default templates (I think ops: ). Otherwise look up what the correct class name is in the html source.
    Code:
    .label { display: none; }
    (add the code to your css)

  5. #5

    Default Re: Hide item labels in frontend?

    @tosca
    I know I have to deal with the template file, but I don't know exactly which parts of the code to edit.

    @medianomaly
    I already read it, it's the same as the one available at http://dev.typolight.org/wiki/1/TutorialsCatalog
    It' useful to understand the data structure, but unfortunately it doesn't show the exact code which prints the field label... or, most probably, I'm not good enough to find it. ops:

    @Vera
    Thank you very much for the tip. I'm going to use the CSS solution until I get the right way to do this.

    Thanks to everybody for the help!

  6. #6

    Default Re: Hide item labels in frontend?

    Ok, I figured it out. Speaking at things done, it's pretty simple...
    In the template file (wich by default should be cat_template_simple.tpl) search for this string:
    Code:
    <div class="label"><?php echo $data['label']; ?></div>
    This string is inside a cycle which 'scans' every field of every item in the catalog (name, type, alias, etc)
    Before each field value it tells to print its own label, so just comment it...
    ...and all the labels will not be printed.

  7. #7
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Hide item labels in frontend?

    Like Vera said, its just much easier to control the individual visibility of labels with css. I use it all the time with client catalogs. Some items they need to see the label, other items the label must be gone, or replaced with a graphic. Using CSS this is the easiest thing to do, and it also means you never code around in the template and also the option to turn the label back on is simply a CSS statement removed, away.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •