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?
Re: Hide item labels in frontend?
You'll have to customize the template to your liking.
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.
Re: Hide item labels in frontend?
How about hiding them using css?
This works for the default templates (I think :oops: ). Otherwise look up what the correct class name is in the html source.
Code:
.label { display: none; }
(add the code to your css)
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. :oops:
@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!
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.
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.