6 replies [Last post]
BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Was this information Helpful?

Hello UC,

Our catalog is arranged in a table-grid of images and is comprised of 3 levels: When you click on a catalog image, it loads a page containing a sub-catalog with more catalog images matching the catalog you are viewing. When you click an image within the sub-catalog, the actual product node itself is loaded.

I've added a few blocks on these sub-catalogs that I use to display content related to the sub-category that the user is viewing. It has been working out so great in fact that we'd like continue spicing up the sub-catalog pages by adding content beneath the catalog images of every sub-catalog level.

But this will require a ton of blocks to be created (of course each one being displayed only on its related sub-catalog/category) and my block configuration page is already riddled with blocks as it is.....

.....so I am wondering: How can I create a configurable input area that I can just simply load a sub-category, and click an Edit link, and what ever text I add it will be displayed underneath the sub-category images just as if it was a block that I had positioned there?

Think about it this way: If you were to create a Page, and add a Block to a region above the content for this Page, you can still hit the "Edit" link for the Page and whatever content you add to the Body of the Page will be displayed beneath the Block that you've added to the top of that Page. This is the same principle that I am looking for.

What do you guys think?

Mike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Anyone

?

Just like how Views have Footer areas where one can add Full HTML. Can we get a footer region added to catalog or sub-category pages?

end user's picture
Offline
Joined: 01/11/2008
Juice: 1198
Re: Possible to add unique content to catalog category pages wit

So you want to add just text to the subcategory pages that is editable by anyone or other data? Can you create an image of what you want your catalog to look like and post it here.

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Thank you for the help! Take

Thank you for the help!

Take a look at this link on our website: http://www.marlincrawler.com/steering This is a main category listing that I have created a Block with HTML I added, and then I am only displaying this block on this URL.

Here is another example, this is a catalog's sub-category's sub-category's, namely, "Catalog > Transfer Case > Line-Ups > T/C Adapters", and this is the catalog page for "T/C Adapters" : http://www.marlincrawler.com/transfer-case/line-ups/tc-adapters Here you can also see that I have added a Block beneath the available products that belong to this sub-category, and I am able to freely configure the HTML of the block to display the content I desire beneath the products.

So this is great, but each time I want to do this I have to create a Block and only display the block on each category or sub-category URL. If I could just add footer HTML to any catalog category that would only appear when someone is viewing that exact catalog category, then it would be so much faster with much less clutter!!

Thanks and I am willing to code this I just don't have any clue how to do this!
BigMike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Re: Thank you for the help! Take

I was looking around at some stuff today and I stumbled across the Description box for taxonomy terms.

The description description reads, "A description of the term. Displayed to customers at the top of catalog pages." This actually is pretty sweet and if I could have this displayed at the bottom of the catalog pages then I'd be set!

So I output all php variables and as far as I can see this Description is inserted in with the 'content', so I am gonna have to do some digging around to see when and where this occurs and then see about moving it beneath my catalog. Then I can just add whatever HTML code I need and WA-LA! NO MORE MESSY BLOCKS!!

BigMike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
BigMike wrote:This actually
BigMike wrote:

This actually is pretty sweet and if I could have this displayed at the bottom of the catalog pages then I'd be set!

Figured this one out. It took me quite a while to find where changes needed to be made, but once I figured it out it was extremely simple. You just need to move 1 line down 1 line:

File uc/catalog/uc_catalog.pages.inc, Move line 129 to line 130.

Change this:

129:    $output .= $catalog->description;
130:    $output .= theme('uc_catalog_products', $catalog->products);

to this:

129:    $output .= theme('uc_catalog_products', $catalog->products);
130:    $output .= $catalog->description;

Now the description for the catalog as configured in the Taxonomy term, found at /admin/content/taxonomy/edit/term/## (where ## is your catalog term number), will be displayed beneath your list of catalog items when you view a catalog page.

Now you can configure this to have whatever you want.

One thing I am still working on is how to get PHP working for this. I have narrowed it down to uc_catalog.module line 264,
variable_set('uc_catalog_description', filter_xss_admin($object['description']));

So I removed the filter out all together like this:
variable_set('uc_catalog_description');

but it makes no difference, so it must be somewhere else. If I enter something simple, like:

test1 <?php echo "test2"; ?> test3

It just writes "test1 test3" so it is ignoring all PHP commands all together apparently. If I figure out a solution to that I will share, but anyway, really glad I figured the rest of this out! NO MORE STUPID BLOCKS FOR ME!! WOOT!

BigMike

BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Re: Possible to add unique content to catalog category pages wit

I just discovered that the above code is valid for sub-categories.

For your main (first-level) categories, you'll have to make the same modification but at line 153:

Change:

153:    $output .= $catalog->description;
154:    $output .= theme('table', array(), $cat_rows, array('class' => 'category'));

To:

153:    $output .= theme('table', array(), $cat_rows, array('class' => 'category'));
154:    $output .= $catalog->description;

And you should be golden Laughing out loud