Page 1 of 1

Re: Cataloger module: how to change the annotation "Notes"?

Posted: Fri Oct 26, 2007 8:45 pm
by alby
Sven A wrote: Q1 - That's OK for me but how can I change the word "Notes" to
something else?

Q2 - How can I show Notes below the third user defined item
attribute and not before it.
In Cataloger admin you have a sub_template (Item-CSS-based or your default) for this

Alby

Re: Cataloger module: how to change the annotation "Notes"?

Posted: Sun Oct 28, 2007 11:41 am
by peedub
Sven A wrote: I've searched for several hours for a solution on a question I have about
the Cataloger module but couldn't find it.

I have 3 user defined item attributes on a Catalog Item page.
If I type something in the "Notes" it is shown on the actual web page.

Q1 - That's OK for me but how can I change the word "Notes" to
something else?

Q2 - How can I show Notes below the third user defined item
attribute and not before it.

regards,

Sven
Hi Sven,

I was having the exact same problems as you and now, with help, I've found a suitable solution for both of your questions...

Here's an example snippet from the default Item-CSS-based template, which is the troublesome area:

Code: Select all

{/section}</div></div>
{section name=at loop=$attrlist}
<div class="item_attribute_name">{$attrlist[at].name}:</div><div class="item_attribute_val">{eval var=$attrlist[at].key}</div>
{/section}
You need to add-to/change that area to look like the following:

Code: Select all

{if $notes != ''}
	{assign var='sectionStart' value=1}
{else}
	{assign var='sectionStart' value=0}
{/if} 

{section name=at loop=$attrlist start=$sectionStart}
	<div class="item_attribute_name">{$attrlist[at].name}</div>
	<div class="item_attribute_val">{eval var=$attrlist[at].key}</div>
	<br />
{/section}

{if $notes != ''}
	<div class="item_attribute_name">Details:</div>
	<div class="item_attribute_val">{$notes}</div>
{/if}
The code above basically does the following:
- If there is no data given for the 'Notes' content area, then it will not show at all on the web page (like you would generally expect).
- If there is data given for the 'Notes' content area then the 'Notes' attribute is added at the end of the user attributes. Be warned that this always adds the notes to the very end of the attributes, so you can't insert it in-between, say, the third and forth user attribute.
- The 'Notes:' label which appears on the web page by default, is replaced with 'Details:'.

Furthermore, if you want the 'Notes:' label on your category/item content page in the CMS to say otherwise, then open the file; 'Cataloger.module.php' found in YourCMSFolder/modules/Cataloger/, and find 'function SetParameters()' - around line 80 - and edit the function to look like the following:

Code: Select all

  function SetParameters()
  {
    $this->RegisterContentType('CatalogItem',
			       dirname(__FILE__).DIRECTORY_SEPARATOR.'contenttype.catalogitem.php',
			       'My Special Item Name');
    $this->RegisterContentType('CatalogCategory',
			       dirname(__FILE__).DIRECTORY_SEPARATOR.'contenttype.catalogcategory.php',
			       'My Special Category Name');
    $this->RegisterContentType('CatalogPrintable',
			       dirname(__FILE__).DIRECTORY_SEPARATOR.'contenttype.catalogprintable.php',
			       'My Special Printable Name');
  }
And that's about all you need to do!

Let us know how it goes. It worked a treat for me!