Forums / General Questions / Edit Category Landing Page

Edit Category Landing Page

Views: 2,080

Results 1 to 20 of 23
19 Dec 2012, 11:47 PM
#1
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Edit Category Landing Page

Hello,

Have a client who wants something unique. I am using zen cart 1.5

We have built this landing page for the categories. http://www.domo-online.com/Outboard-Motor-Oil/evinrude-c-1/

The pictures are coming from the sub categories on this page. Here is what the client wants

Category 1 pic-------Category 1 description

Category 2 pic-------Category 2 description

Category 3 pic-------Category 3 description

So I need to figure out how to change the "category landing page only" to display the pictures vertically but also pull the 'category description' from the sub category and put it next to the category

any help would be greatly appreciated

20 Dec 2012, 12:17 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

For starters, using the subcat names, you can add to your stylesheet

.categoryListBoxContents img+br {display: none;}
.categoryListBoxContents img {position: relative; top: 3.5em;}

Put this in a per-category stylesheet if you want it only on one category listing page. If you want all category listings to have this layout, change the categories per row in admin. If not, add another rule:

.categoryListBoxContents {clear: left;}

To get the actual subcat descriptions, you will need to add a database lookup and output the information in the listing code. /includes/modules/your_template/category_row.php would be a good place to start.

20 Dec 2012, 4:38 PM
#3
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

Thank you. The cart is already setup for rows though, but it still displays the category pages horizontally

Product Page-http://www.domo-online.com/Outboard-Motor-Oil/yamalube-c-4/2m-c-4_11/

Category Page--I'm trying to edit http://www.domo-online.com/Outboard-Motor-Oil/yamalube-c-4/

any ideas

20 Dec 2012, 5:37 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

There is no "rows/columns" setting for category listing pages. You can only set the category listing to maximum 1 per row.
Configuration > Maximum Values > Categories To List Per Row.
If you want all category listings vertical, set this to 1.

To get the subcat descriptions, you do need to modify main_template_vars.php and category_row.php, as mentioned above.
Add
, cd.categories_description
to this section in main_template_vars.php (around line 96) to get

        $categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, cd.categories_description
                             FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                             WHERE      c.parent_id = :parentID
                             AND        c.categories_id = cd.categories_id
                             AND        cd.language_id = :languagesID
                             AND        c.categories_status= '1'
                             ORDER BY   sort_order, cd.categories_name";

        $categories_query = $db->bindVars($categories_query, ':parentID', $category_links[$i], 'integer');
        $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
        break; // we've found the deepest category the customer is in
      }

In category_row.php, add
<p class="catListingDesc">' . $categories->fields['categories_description'] . '</p>
to this line to get```php
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . $categories->fields['categories_name'] . '</a><p class="catListingDesc">' . $categories->fields['categories_description'] . '</p>');

'<br />' . 
that you will see in the original before $categories->fields['categories_name'] .
You might need a slightly more verbose edit to category_row.php, depending on exactly how you want the layout to work.
21 Dec 2012, 2:53 PM
#5
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

I will try that, thank you.

3 Jan 2013, 4:20 PM
#6
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

Thank you, it looks like that made a bit of a difference but it still isn't pulling the descriptions for the category.

Here is what is looks like now http://domo-online.com/Outboard-Motor-Oil/index.php?main_page=index&cPath=1

I would like the categories left justified and the category description in the blank section to the right

Here is where I edited the category_row.php file

 if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif';

    $cPath_new = zen_get_path($categories->fields['categories_id']);



    // strip out 0_ from top level cats

    $cPath_new = str_replace('=0_', '=', $cPath_new);



    //    $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);



       $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
                                           'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . $categories->fields['categories_name'] . '</a><p class="catListingDesc">' . $categories->fields['categories_description'] . '</p>');  



    $col ++;

    if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {

      $col = 0;

      $row ++;

    }

here is what I did to the main_template_vars

 $sql = "update " . TABLE_PRODUCTS_DESCRIPTION . "

            set        products_viewed = products_viewed+1

            where      products_id = '" . (int)$_GET['products_id'] . "'

            and        language_id = '" . (int)$_SESSION['languages_id'] . "'";



    $res = $db->Execute($sql);

$categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, cd.categories_description
                             FROM   " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                             WHERE      c.parent_id = :parentID
                             AND        c.categories_id = cd.categories_id
                             AND        cd.language_id = :languagesID
                             AND        c.categories_status= '1'
                             ORDER BY   sort_order, cd.categories_name";

        $categories_query = $db->bindVars($categories_query, ':parentID', $category_links[$i], 'integer');
        $categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');
        break; // we've found the deepest category the customer is in
      }  

    $sql = "select p.products_id, pd.products_name,

                  pd.products_description, p.products_model,

                  p.products_quantity, p.products_image,

                  pd.products_url, p.products_price,

                  p.products_tax_class_id, p.products_date_added,

                  p.products_date_available, p.manufacturers_id, p.products_quantity,

                  p.products_weight, p.products_priced_by_attribute, p.product_is_free,

                  p.products_qty_box_status,

                  p.products_quantity_order_max,

                  p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter

           from   " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd

           where  p.products_status = '1'

           and    p.products_id = '" . (int)$_GET['products_id'] . "'

           and    pd.products_id = p.products_id

           and    pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";

any ideas

thank you

3 Jan 2013, 6:23 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

I think the query addition needs to be made in a different section... the "deepest category the customer is in" may not be what we need to use. That will execute for subcats of a subcat; we need subcats of a top cat here.
Try adding
, cd.categories_description
here to get ```php
} else {
$categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, cd.categories_description
FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
WHERE c.parent_id = :parentID
AND c.categories_id = cd.categories_id
AND cd.language_id = :languagesID
AND c.categories_status= '1'
ORDER BY sort_order, cd.categories_name";

$categories_query = $db->bindVars($categories_query, ':parentID', $current_category_id, 'integer');
$categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');

}
$categories = $db->Execute($categories_query);

3 Jan 2013, 6:37 PM
#8
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

gjh42:

I think the query addition needs to be made in a different section... the "deepest category the customer is in" may not be what we need to use. That will execute for subcats of a subcat; we need subcats of a top cat here.
Try adding
, cd.categories_description
here to get ```php
} else {
$categories_query = "SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, cd.categories_description
FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
WHERE c.parent_id = :parentID
AND c.categories_id = cd.categories_id
AND cd.language_id = :languagesID
AND c.categories_status= '1'
ORDER BY sort_order, cd.categories_name";

$categories_query = $db->bindVars($categories_query, ':parentID', $current_category_id, 'integer');
$categories_query = $db->bindVars($categories_query, ':languagesID', $_SESSION['languages_id'], 'integer');

}
$categories = $db->Execute($categories_query);


thank you, where do I add this code though? Do I remove the one you had me add before? I see it starts with an Else clause so not sure where to put it
3 Jan 2013, 7:27 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

Find the code block I show and add the ", cd.categories_description" bit to the query. It is just below the first addition area. Line numbers would be pointless, as I see you have a customized version of main_template_vars.php with a lot of added code.

I don't think it matters if you leave the first addition; it will come into play only if you have sub-subcategories.

3 Jan 2013, 7:37 PM
#10
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

Very sorry but I do follow you. I'm using Zen Cart 1.5 and maybe that is the issue. I searched in the my original version of main_template_vars.php I don't have this in there anywhere: categories_query

here is what my main_template_vars.php looks like```

<?php /** * document_general_info main_template_vars.php * * @package productTypes * @copyright Copyright 2003-2011 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: main_template_vars.php 19690 2011-10-04 16:41:45Z drbyte $ */ /* * Extracts and constructs the data to be used in the product-type template tpl_TYPEHANDLER_info_display.php */ // This should be first line of the script: $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_START_DOCUMENT_GENERAL_INFO'); $module_show_categories = DOCUMENT_GENERAL_INFO_CATEGORIES; $sql = "select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; $res = $db->Execute($sql); if ( $res->fields['total'] < 1 ) { $tpl_page_body = '/tpl_product_info_noproduct.php'; } else { $tpl_page_body = '/tpl_document_general_info_display.php'; $sql = "update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$_GET['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'"; $res = $db->Execute($sql); $sql = "select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_quantity, p.products_weight, p.products_priced_by_attribute, p.product_is_free, p.products_qty_box_status, p.products_quantity_order_max, p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; $product_info = $db->Execute($sql); $products_price_sorter = $product_info->fields['products_price_sorter']; $products_price = $currencies->display_price($product_info->fields['products_price'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])); $manufacturers_name= zen_get_products_manufacturers_name((int)$_GET['products_id']); if ($new_price = zen_get_products_special_price($product_info->fields['products_id'])) { $specials_price = $currencies->display_price($new_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])); } // set flag for attributes module usage: $flag_show_weight_attrib_for_this_prod_type = SHOW_DOCUMENT_GENERAL_INFO_WEIGHT_ATTRIBUTES; // get attributes require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_ATTRIBUTES)); // if review must be approved or disabled do not show review $review_status = " and r.status = '1'"; $reviews_query = "select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$_GET['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'" . $review_status; $reviews = $db->Execute($reviews_query); } require(DIR_WS_MODULES . zen_get_module_directory('product_prev_next.php')); $products_name = $product_info->fields['products_name']; $products_model = $product_info->fields['products_model']; $products_description = $product_info->fields['products_description']; if ($product_info->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') { $products_image = PRODUCTS_IMAGE_NO_IMAGE; } else { $products_image = $product_info->fields['products_image']; } $products_url = $product_info->fields['products_url']; $products_date_available = $product_info->fields['products_date_available']; $products_date_added = $product_info->fields['products_date_added']; $products_manufacturer = $product_info->fields['manufacturers_name']; $products_weight = $product_info->fields['products_weight']; $products_quantity = $product_info->fields['products_quantity']; $products_qty_box_status = $product_info->fields['products_qty_box_status']; $products_quantity_order_max = $product_info->fields['products_quantity_order_max']; $products_base_price = $currencies->display_price(zen_get_products_base_price((int)$_GET['products_id']), zen_get_tax_rate($product_info->fields['products_tax_class_id'])); $product_is_free = $product_info->fields['product_is_free']; $products_tax_class_id = $product_info->fields['products_tax_class_id']; $module_show_categories = PRODUCT_INFO_CATEGORIES; $module_next_previous = PRODUCT_INFO_PREVIOUS_NEXT; $products_id_current = (int)$_GET['products_id']; $products_discount_type = $product_info->fields['products_discount_type']; $products_discount_type_from = $product_info->fields['products_discount_type_from']; /** * Load product-type-specific main_template_vars */ $prod_type_specific_vars_info = DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars_product_type.php'; if (file_exists($prod_type_specific_vars_info)) { include_once($prod_type_specific_vars_info); } $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_PRODUCT_TYPE_VARS_DOCUMENT_GENERAL_INFO'); /** * Load all *.PHP files from the /includes/templates/MYTEMPLATE/PAGENAME/extra_main_template_vars */ $extras_dir = $template->get_template_dir('.php', DIR_WS_TEMPLATE, $current_page_base . 'extra_main_template_vars', $current_page_base . '/' . 'extra_main_template_vars'); if ($dir = @dir($extras_dir)) { while ($file = $dir->read()) { if (!is_dir($extras_dir . '/' . $file)) { if (preg_match('/\.php$/', $file) > 0) { $directory_array[] = '/' . $file; } } } $dir->close(); } if (sizeof($directory_array)) sort($directory_array); for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) { if (file_exists($extras_dir . $directory_array[$i])) include($extras_dir . $directory_array[$i]); } // build show flags from product type layout settings // $flag_show_product_info_starting_at = zen_get_show_product_switch($_GET['products_id'], 'starting_at'); // $flag_show_product_info_model = zen_get_show_product_switch($_GET['products_id'], 'model'); // $flag_show_product_info_weight = zen_get_show_product_switch($_GET['products_id'], 'weight'); // $flag_show_product_info_quantity = zen_get_show_product_switch($_GET['products_id'], 'quantity'); // $flag_show_product_info_manufacturer = zen_get_show_product_switch($_GET['products_id'], 'manufacturer'); // $flag_show_product_info_in_cart_qty = zen_get_show_product_switch($_GET['products_id'], 'in_cart_qty'); $flag_show_product_info_reviews = zen_get_show_product_switch($_GET['products_id'], 'reviews'); $flag_show_product_info_reviews_count = zen_get_show_product_switch($_GET['products_id'], 'reviews_count'); $flag_show_product_info_date_available = zen_get_show_product_switch($_GET['products_id'], 'date_available'); $flag_show_product_info_date_added = zen_get_show_product_switch($_GET['products_id'], 'date_added'); $flag_show_product_info_url = zen_get_show_product_switch($_GET['products_id'], 'url'); $flag_show_product_info_additional_images = zen_get_show_product_switch($_GET['products_id'], 'additional_images'); $flag_show_product_info_free_shipping = zen_get_show_product_switch($_GET['products_id'], 'always_free_shipping_image_switch'); require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCTS_QUANTITY_DISCOUNTS)); $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_DOCUMENT_GENERAL_INFO'); require($template->get_template_dir($tpl_page_body,DIR_WS_TEMPLATE, $current_page_base,'templates'). $tpl_page_body); //require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_ALSO_PURCHASED_PRODUCTS)); // This should be last line of the script: $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_END_DOCUMENT_GENERAL_INFO'); ```
3 Jan 2013, 7:46 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

You're looking at the wrong file. There is a main_template_vars.php for most if not all pages; you want /includes/modules/pages/index/main_template_vars.php.
It has this at the top:```php

  • index main_template_vars.php


You need to remove the additions you made to the other main_template_vars.php, as they don't belong there.
3 Jan 2013, 7:52 PM
#12
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

Perfect thank you. Is there a way to left justify it through this page or do I have to use the stylesheet? I don't want to mess up anything else

thank you so much

3 Jan 2013, 7:53 PM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

I see that I gave the exact location for category_row.php in my first post, but not for main_template_vars.php... sorry, my bad.

You can use the stylesheet to adjust the layout. Let me look at it live and I will give some pointers.

3 Jan 2013, 8:04 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

First issue: you have <p> elements set to only 50 pixels wide:
P, ADDRESS {
padding: 0.1em;
width: 50px;
}

I can't tell exactly where this rule is because of your minimized stylesheets (lines all run together and very hard to read), but hopefully you can find it. A default setting for all paragraphs to 50px wide doesn't seem like a good idea, as very few will want to be that narrow. Maybe the width was intended only for addresses? If so, you need to make a separate rule for that so as not to mess up paragraphs.

3 Jan 2013, 8:34 PM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

Add to your stylesheet (wherever convenient and sensible for you):

.categoryListBoxContents a {display: block; float: left; clear: both; width: 36%; text-align: left;}
.categoryListBoxContents a img {margin: 0 1em -3.5em 0;}
.categoryListBoxContents p, .categoryListBoxContents ul {float: right; width: 62%; text-align: left; margin-top: 0;}

Adjust to taste. There are still things that are not ideal about the layout, but it is a lot closer. I see that you appear to be escaping from the

<p class="catListingDesc">' . $categories->fields['categories_description'] . '</p> so that the class tag does not actually apply to your content, and there are empty paragraphs above and below your paragraph and ul list. Why is that? Is it intentional? It makes styling considerably trickier.

"Escaping" means that your content starts with </p> and ends with <p>, closing out the coded <p class="catListingDesc"> before it can be useful.

3 Jan 2013, 8:46 PM
#16
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

You are the man, thank you so much, it worked great.

http://www.domo-online.com/Outboard-Motor-Oil/evinrude-c-1/

BUT where there is no description everything is messed up http://www.domo-online.com/Outboard-Motor-Oil/drums-c-5/

and
in Chrome the titles are lining up weird, any ideas? http://www.domo-online.com/Outboard-Motor-Oil/mercury-c-3/

thanks

3 Jan 2013, 9:01 PM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

For a stopgap with the no-description piling issue, add to your stylesheet

.categoryListBoxContents {min-height: 160px;}

I see some categories have longer names, so you probably need to increase the width of the link and decrease the width of p and ul elements.

You have a lot of messy HTML/CSS in there, and it will be hard to sort out the styling until that is neater. You didn't answer about the "escaping" content.

3 Jan 2013, 9:08 PM
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

I think it will be easier to handle if you change the addition in category_row.php from
<p class="catListingDesc">' . $categories->fields['categories_description'] . '</p>
to
<div class="catListingDesc">' . $categories->fields['categories_description'] . '</div>

You will then need to change the one style rule from
.categoryListBoxContents p, .categoryListBoxContents ul {float: right; width: 62%; text-align: left; margin-top: 0;}
to
.categoryListBoxContents .catListingDesc {float: right; width: 62%; text-align: left; margin-top: 0;}

3 Jan 2013, 9:34 PM
#19
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: Edit Category Landing Page

Thank you very much. I tried and it seems to work well. Only issue left is the name of the category is messed up, is there a way to put the category name directly under the picture?

honestly not sure about the escaping, I didn't do it intentionally, I have edited this template quite a few times over the last year. Probably screwed it up but appreciate your help.

only two things I would love to fix are:

  1. http://www.domo-online.com/Outboard-Motor-Oil/yamalube-c-4/
    The ringfree picture is not lining up like the rest and it would solve the problem of long names if the name can go directly above or below the picture.

  2. Similar issue, some of the names are pushed left and others are not
    http://domo-online.com/Outboard-Motor-Oil/index.php?main_page=index&cPath=5

3 Jan 2013, 11:07 PM
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Edit Category Landing Page

I think the escaping happened automatically when the browser tried to process the output. It had a <p> from the file code and another <p> from your description. You can't have nested paragraphs in HTML, so the browser closed out the outer one before starting the inner one. It works correctly now with the div wrapper.
The name alignment issues are all as far as I can see caused by width issues - wide images and longer names can't fit on the same line in the set width, so the name drops to the next line and starts at the left edge. Increasing the width or putting the name above/below the image are the only ways to fix it. You really need a handle to style the name; it's not just subtext as the original design made it. Edit category_row.php, changing
. $categories->fields['categories_name'] . '</a>
to
. '<span class="catListingName">' . $categories->fields['categories_name'] . '</span></a>
to get php 'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<span class="catListingName">' . $categories->fields['categories_name'] . '</span></a><div class="catListingDesc">' . $categories->fields['categories_description'] . '</div>'); or if you want the name above the image ```php
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' .'<span class="catListingName">' . $categories->fields['categories_name'] . '</span>' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a><div class="catListingDesc">' . $categories->fields['categories_description'] . '</div>');